Xref: utzoo comp.lang.c++:3943 comp.lang.eiffel:302 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucsd!hub!eiffel!bertrand From: bertrand@eiffel.UUCP (Bertrand Meyer) Newsgroups: comp.lang.c++,comp.lang.eiffel Subject: Re: Eiffel vs. C++ Summary: Correction of statements about programming languages Message-ID: <170@eiffel.UUCP> Date: 10 Jul 89 03:44:18 GMT References: <2689@ssc-vax.UUCP> <6590138@hplsla.HP.COM> <149@eiffel.UUCP> Organization: Interactive Software Engineering, Santa Barbara CA Lines: 60 From article , by pcg@thor.cs.aber.ac.uk: > Pascal and Ada have a concept of pointer, > and indeed := is used by them to do *copy* of pointer objects. This > is VERY different from Eiffel. Unless there is something I don't understand I am afraid Mr. Grandi is mistaken. Both in Pascal and in Ada := is used for pointer assignment. For Pascal, see chapter 10 of Pascal User Manual by Kathleen Jensen and Niklaus Wirth, Springer-Verlag, 1974 (pages 62-66 in the second edition); also the ``Report'' part of the same book, section 7.3. For Ada, the relevant section of the Reference Manual (3.8) is not the most luminous piece of technical literature ever written, but there is no doubt that the semantics is indeed that of pointer assignment. (See for example ``Ada for Experienced Programmers'' by A. Nico Habermann and Dewayne E. Perry, Addison-Wesley, 1983, page 197.) Interestingly enough, Pascal and Ada both also use := to prescribe value assignment for referenced records. I believe the correct notations are p^ := q^ in Pascal and p.all := q.all in Ada. As explained in my article on ``Eiffel types'', there are cases in which one *explicitly wants* to have the same symbol express different semantics for reference types and expanded types. (The latter is Eiffel 2.2 terminology for types whose elements are objects rather than references to objects; expanded types include the basic types INTEGER, REAL, DOUBLE etc.) Thanks to expanded types and the associated assignment and argument passing conventions, Eiffel 2.2 allows programmers to choose exactly what they need in a given case: uniform copy semantics, or variable semantics. This is particularly important for generic classes. > I find it worrying that the author of Eiffel [...] > is not extremely familiar with Simula67 and Lisp. > Now some embar[r]assing questions: Has he ever read the Simula67 > Common Base standard? Simula BEGIN? What is Hash Consing and how > does it relate to this discussion? What is rplac[ad] and how does > it relate to this discussion? > This is an interesting idea: Usenet as an ongoing certification program, or people's tribunal (``You don't even know the basics!'', shouts the Red Guard to the Mandarin). It is tempting to reply, as Mitterrand to Giscard d'Estaing during the 1981 presidential debate, ``I am not your student, and you are not my professor'', but let me not be stuffy and indeed answer. The author of Eiffel did write more than a few Lisp and Simula programs, thank you. One of my first programming courses was a Lisp course taught by Prof. John McCarthy; I remember him as reasonably competent on the subject. On Simula, please see ``Quelques concepts importants des langages de programmation modernes, et leur expression en Simula 67'', by the undersigned, GROPLAN 9, AFCET, 1979. (English version presented at the Tenth Conference of the Association of Simula Users, Oslo, in, I believe, 1980 or 1981.) As to rplaca and rplacd, the definition I am tempted to give is ``If you like the idea of functional programming, the main arguments for using Miranda rather than Lisp''. -- Bertrand Meyer bertrand@eiffel.com