From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1ebfe7f8f5e385d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-02 02:14:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!freenix!skynet.be!skynet.be!louie!tlk!not-for-mail Sender: lbrenta@lbrenta.corp.emc.com Newsgroups: comp.lang.ada Subject: Re: Generic formal access types References: <3eb01630@epflnews.epfl.ch> <3eb0e397@epflnews.epfl.ch> <1459423.SpdnhGgvRt@linux1.krischik.com> <3eb11a85@epflnews.epfl.ch> From: Ludovic Brenta Date: 02 May 2003 11:14:36 +0200 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 213.190.149.159 X-Trace: 1051866853 reader0.news.skynet.be 723 fa058819/213.190.149.159:54369 X-Complaints-To: abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:36840 Date: 2003-05-02T11:14:36+02:00 List-Id: Do you absolutely have to return null in one of the functions of your generic package? How about raising an exception instead? Something along the lines of: generic type Element (<>) is private; package List is No_Element_Error: Exception; type List is private; function Get_Element (L : List) return Element; private type List is ... ; end List; package body List is function Get_Element (L : List) return Element is begin raise No_Element_Error; -- instead of return null end Get_Element; end List; I'm sure you've thought about that, but I'm curious to know why it wouldn't work for you. -- Ludovic Brenta.