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,ce0900b60ca3f616 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-22 23:18:14 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.media.kyoto-u.ac.jp!sjc-peer.news.verio.net!news.verio.net!sea-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Side-Effects in Functions [Rosen Trick] In-Reply-To: Message-ID: References: <20011105134531.P817-100000@shell5.ba.best.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Fri, 23 Nov 2001 07:18:21 GMT NNTP-Posting-Host: 192.220.65.223 X-Complaints-To: abuse@verio.net X-Trace: sea-read.news.verio.net 1006499901 192.220.65.223 (Fri, 23 Nov 2001 07:18:21 GMT) NNTP-Posting-Date: Fri, 23 Nov 2001 07:18:21 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:16894 Date: 2001-11-23T07:18:21+00:00 List-Id: On Thu, 22 Nov 2001, David Thompson wrote: > Brian Rogoff wrote : > > It's called void, not null. The problem with C is that it ignores returned > > value types so even though it has void it doesn't really use it. I imagine > > a reworked Ada would only allow void returning function/procedure values > > to be ignores, and so wouldn't lose type safety. > > > I'm not sure what you were trying to say there. [...snip...] > What you may be after is that the value of any non-void expression > in C, whether it is the return from a function or not, is discarded > if that expression constitutes an entire statment. This is exactly what I was trying to say, thanks. In ML, an expression oriented language, things separated by ";" must return unit (which is like void) so you can't just ignore the results of functions unless you explicitly request to do so. If we got rid of the function/procedure distinction in an Ada like language then we'd do things this way I think. -- Brian