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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1df6bc3799debed X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Syntax for tagged record types (was Re: Not intended for use in medical,) Date: 1997/05/21 Message-ID: #1/1 X-Deja-AN: 243580892 Distribution: world References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com> <5kl9qc$g4d@bcrkh13.bnr.ca> <5kmek2$9re@bcrkh13.bnr.ca> <33727FA5.5C7A@sprintmail.com> <3374C19F.15FE@sprintmail.com> <3376CF85.3E15@sprintmail.com> <33828299.2A3@world.std.com> Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-05-21T00:00:00+00:00 List-Id: In article mheaney@ni.net (Matthew Heaney) writes: > What would be really cool is to have the compiler treat a selector > "invokation" that same as if it were a reference to a record component. > That way I could say > > The_Stack.Top := 5; This is similar to the issue of allowing function results to be L-values. I'm not entirely sure why this was considered a "bad" thing (there's been many occasions I've seen where this would be nice). At the moment it is prevented for at least the reason that function results are considered to be _constant_ objects. > While we're at it, maybe we can throw in real constructors, too. We can > solve the "problem" with limited types, by allowing a constructor to be > called in the declarative region. That way limited types wouldn't have to > be definate, or go on the heap unnecessarily. That's more or less what Limited_Controlled gives you. You can "pass parameters" to Initialize via discriminants. You can also play the "rename the function result" game for limited types (which I think is actually pretty nice) and that does what you want as well. /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com