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: fac41,8ff80a74f45b5cd3 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,8ff80a74f45b5cd3 X-Google-Attributes: gid103376,public From: doylep@ecf.toronto.edu (Patrick Doyle) Subject: Re: Visibility and access to "public" attributes Date: 1997/09/02 Message-ID: #1/1 X-Deja-AN: 269888370 X-Nntp-Posting-Host: skule.ecf Sender: news@ecf.toronto.edu (News Administrator) References: <01bcb787$eeb5a180$7e80400a@gavinspc> Organization: University of Toronto, Engineering Computing Facility Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-02T00:00:00+00:00 List-Id: In article <01bcb787$eeb5a180$7e80400a@gavinspc>, Gavin Collings wrote: > > [Discussion of how Delphi can make functions use the syntax of > an assignment statement] > >Apart, perhaps, from the overhead of having to declare fRadius separately, >this method looks certainly more flexible and probably in most interesting >cases more direct than the Eiffel approach. IMO, this is equivalent to being able to do this: class GOOBER feature volume : INTEGER is do ... end volume := (new_value : INTEGER) is do ... end end Now I could write something like this: my_goober.volume := my_goober.volume + 1 While apparently an assignment, this would call "volume", add 1 to the result, and then call "volume :=" passing it the new value as an argument. While this may be nice syntactic sugar, naming a feature "volume :=" seems to have virtually no advantage over "set_volume". -PD -- -- Patrick Doyle doylep@ecf.utoronto.ca