Maurice Lombardi a ecrit :
Indeed, it was already in Algol60, the first ancestor of Pascal. The syntax was as above
x := if cond then 42 else 17
and I had some trouble in beginning with Pascal to give away this very natural syntax !
No dangling else, use of () to be sure in case of doubt about precedences would be the simplest (but I have an historical bias !)
Hope this helps
Maurice
As a native Algol60 speaker, I agree - this was one of the features I too missed when Algol60 faded away. Syntax is close to natural language (easy to teach, easy to learn, and a clean syntax - that is the fundamental principle of Pascal). The rules of precedence for Algol60 are basically evaluate from left to right unless specific rules apply - isn't that already the case for Pascal? I don't think we need anything else. The endif (or end) construction is un-Pascalish - use parentheses if required, in the same way as begin/end is used when needed for conditional statements.
Clive Rodgers
----------------------------------------------------------------------------- Atmospheric, Oceanic and Planetary Physics +44-1865-272905 (desk) Clarendon Laboratory +44-1865-272923 (fax) Parks Road Oxford OX1 3PU c.rodgers@physics.ox.ac.uk U.K. http://www.atm.ox.ac.uk/user/rodgers/
MIME, NeXTMail and SunMail attachments welcomed. HTML attachments tolerated Proprietary document formats (especially WORD) objected to. Use rtf instead -----------------------------------------------------------------------------