home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / ada / 3718 < prev    next >
Encoding:
Text File  |  1992-12-16  |  1.3 KB  |  44 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!nwnexus!emagnuso
  3. From: emagnuso@halcyon.com (Erik Magnuson)
  4. Subject: Re: Language pitfalls (was Re: FORTRAN bug)
  5. Message-ID: <1992Dec16.202735.596@nwnexus.WA.COM>
  6. Summary: One example of function w/o return
  7. Sender: sso@nwnexus.WA.COM (System Security Officer)
  8. Organization: The 23:00 News and Mail Service
  9. References: <1992Dec15.203558.18211@inmet.camb.inmet.com>> <EACHUS.92Dec15202249@oddjob.mitre.org> <256@visicom.com>
  10. Date: Wed, 16 Dec 1992 20:27:35 GMT
  11. Lines: 31
  12.  
  13. In article <256@visicom.com> rlk@VisiCom.COM (Bob Kitzberger) writes:
  14. >Robert, I can't think of a reason to have a function that does nothing
  15. >but raise an exception... can you provide an example?  (I'm not
  16. >questioning the need for it -- just curious)
  17.  
  18. Howabout when you have a common interface, but cannot (or choose not
  19. to) implement the function for a specific implementation.
  20.  
  21.     function Foo return Foo_Type is
  22.     begin
  23.        raise Not_Supported;
  24.     end Foo;
  25.  
  26. Currently you have to write:
  27.  
  28.     function Foo return Foo_Type is
  29.        Dummy : Foo_Type;  -- should this be initialized?
  30.     begin
  31.        raise Not_Supported;
  32.        return Dummy;
  33.     end Foo;
  34.  
  35. >
  36. >    .Bob.
  37. >----------------
  38. >Bob Kitzberger          VisiCom Laboratories, Inc.
  39. >rlk@visicom.com         10052 Mesa Ridge Court, San Diego CA 92121 USA
  40. >                        +1 619 457 2111    FAX +1 619 457 0888
  41. -- 
  42. Erik
  43.  
  44.