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,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,953e1a6689d791f6 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public From: vsnyder@math.jpl.nasa.gov (Van Snyder) Subject: Re: Eiffel and Java Date: 1996/11/23 Message-ID: <575g9o$7tl@netline-fddi.jpl.nasa.gov>#1/1 X-Deja-AN: 198168989 references: <1996Oct31.202857.3481@merlin.hgc.edu> content-type: text/plain; charset=US-ASCII organization: Jet Propulsion Laboratory mime-version: 1.0 newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c++ Date: 1996-11-23T00:00:00+00:00 List-Id: In article <1996Oct31.202857.3481@merlin.hgc.edu> jcm@hgc.edu (James McKim) writ es: >In article donh@syd.csa.com.au writes: >>Matthew Heaney writes: > >[..] > >> >> >>:About subprogram calls. C++ or Eiffel programmers call objects this way: >>: >>: theStack.push (5); >>: >>:and Ada programmers do this >>: >>: Push (5, On => The_Stack); >>: >>:It's not a moral issue which way is better, just a difference in syntax. >>:They both do the same thing. >> >>Yes - not something to lose sleep over. The Ada syntax can be justified >>because it is a hybrid language. IMO, the dot notation is preferable for >>Eiffel because it is a pure, single-dispatched language. For such >>languages, it makes sense to isolate the dispatching parameter to show that >>it is special. The downside is that symmetric operations do not appear as >>such. Well, not really, because you can always regain it by inventing another >>class for performing symmetric operations: >> >>eg. class SET_OPS >> ... >> union (a, b: SET): SET is ... >> intersection (a, b: SET): SET is ... >> ... >> end >> >>In any case, truly symmetric operations are relatively few, IMO. > >In an article in the 10/94 issue of JOOP, Richie Bielak and I argued that >such features should really be creation routines in class SET. > >IMHO, the dot notation and the desire for symmetry are almost orthogonal >issues. For better or for worse many library classes for languages that support >the dot notation have chosen to design intrinsically symmetric operations in >an asymmetric way, but that is not the only way. In Mesa, a.b.c and c(b,a) and c(b(a)) were entirely equivalent. The author could use whatever syntax he hoped would most help the reader understand his frame of mind at the instant he wrote the code. This worked no matter whether "c" was a function, or a "data member" of the class a.b. To make the symmetry complete, one could define "updaters," that is, procedures that could appear on the left of an assignment operator, or be bound to procedure arguments of "out" or "input" mode. These were different from "left hand functions" as described by Aho et. al.: The procedure received the value to be "absorbed," exactly antisymmetrically to the way a function works. As a side effect, one could change the representation of an object from record field to procedure, or array element to procedure, or array element to record field, ... without any change in the referential syntax. See Geschke and Mitchell, "On the problem of uniform references to data structures," IEEE TSE SE-1, 2 (1975). Too bad the work was done at Xerox. -- What fraction of Americans believe | Van Snyder Wrestling is real and NASA is fake? | vsnyder@math.jpl.nasa.gov