anything like C++ references?

Duncan Booth duncan at NOSPAMrcp.co.uk
Wed Jul 16 16:59:44 CEST 2003


Adam Ruth <owski at hotmail.com> wrote in news:20030716081550053-
0600 at news.xmission.com:

>> Initialisation uses '=', assignment uses ':='. Note that the constant 
>> is  defined as a real and initialised with one, but the variable is a 
>> reference  to a real and initialised with a storage location. The last 
>> example is not  initialising x with the value, it is implicitly 
>> initialising x with a  location then assigning the value into that 
>> location.
>>
> 
> That's interesting.  What does it use for an equality operator?
> 
Tricky question that. It uses the equals symbol which might, or might not 
be spelled '=' or 'EQ'.

Sorry, my pedantry is trying to get the better of me. Algol68 defines its 
syntax in terms of the tokens that it accepts, it doesn't really force you 
to spell its tokens any particular way. The language definition uses bold 
face for symbols such as 'real', and the implementation might choose to 
recognise REAL, .real., 'real, or some special [real] symbol in your 
character set. Case stropping, which I think was commonest, uses upper 
case. The language is quite clear on this giving as an example that various 
typefaces of begin could be used to represent the begin symbol including a 
combination of hole on a punch card.

In particular, although the symbol used for equality testing in the 
language definition looks like =, the other operators look more like the 
appropriate mathematical symbols than, say, <=, and the implementation may 
decide how the symbols are to be represented. 

See http://www.fh-jena.de/~kleine/history/languages/Algol68-
RevisedReport.pdf

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?




More information about the Python-list mailing list