[mercury-users] mercury website (was Suggestion: new operator )
Richard A. O'Keefe
ok at atlas.otago.ac.nz
Thu Oct 26 08:45:43 AEDT 2000
Ralph Becket <rbeck at microsoft.com> wrote:
Pascal, Modula, Modula 2 and Modula 3 (fine language) all used
`^' for field access.
No, they don't. They use "^" for pointer deference.
Why? Because the code point in ASCII-67 that nowadays represents
a circumflex accent (so that you can spell role as r-^-BS-o-l-e)
used in ASCII-63 to represent an up-arrow. (To this day Squeak
Smalltalk displays "^" as an up arrow and "_" as a left arrow for
this reason). Strictly speaking, it's supposed to be ptr↑.
They use "." for field access. When you think about it, that's really
an extremely odd choice. The infix "OF" operator in COBOL and Algol 68
makes a lot of sense, and "OF" was already a reserved word in Pascal.
I suppose Pascal used it because PL/I used it, but does anyone know why
PL/I used it?
Of course, Interlisp programmers have traditionally regarded "." as a
letter, writing NAMES.LIKE.THIS, and NPL (Burroughs' Network Programming
Language, otherwise rather like Algol) programmers agree with COBOL
programmers in regarding "." as obviously meaning statement termination.
(Come to think of it, so does Pascal, with a dot at the end of a program
unit, which makes its use as field accessor _really_ strange.)
Prolog programmers agree that "." is a good terminator too (and so do
Erlang programmers, yay Erlang) which makes it a rather poor choice for
any kind of operator.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list