Path: utzoo!attcan!uunet!mcsun!ukc!mucs!jk From: jk@cs.man.ac.uk (John Kewley ICL) Newsgroups: comp.lang.c Subject: Re: Assignment in test: OK? Message-ID: <1698@m1.cs.man.ac.uk> Date: 13 Sep 90 17:28:00 GMT References: <1990Sep12.194753.9808@laguna.ccsf.caltech.edu> <3749@goanna.cs.rmit.oz.au> Sender: news@cs.man.ac.uk Reply-To: jk@cs.man.ac.uk (John Kewley ICL) Organization: Department of Computer Science, University of Manchester UK Lines: 43 In article <1990Sep12.194753.9808@laguna.ccsf.caltech.edu>, bruce@seismo.gps.caltech.edu (Bruce Worden) writes: > are legal, I don't see how `:=' is any better than just `='. People who > are used to thinking of `:=' as `equal' will type it as freely as we > type `='. > > Only something like Fortran's .EQ. is different enough to > draw attention to the two different meanings of `is equal to'. > > I am not objecting to constructs like: > if((fd=open(path,flags,mode)) != NULL) My first real language I learnt was a language called S-Algol developed at St. Andrews University. It had several neat features that were helpful to novice programmers, the relevent one in this case being: let x = 3 ! x is a constant of value 3 let y := 4 ! y is a variable of value 4 y := 5 ! assign 5 to variable y if y = 5 then write "y = 5'n" else write "y ~= 5'n" for i = 1 to y do write "i = ", i, "'n" Types were inferred from expressions provided. Note that equality and initialisation of constants both use "=" and that assignment and initialisation of variables use ":=" What to some might be counter-intuitive is that instead of a looping variable, S-Algol has a looping constant which cannot be altered during the loop (since it is constant). S-Algol had many other "nice" features and proved excellent for programming-in-the-small. -- J.K. John M. Kewley, ICL, Wenlock Way, West Gorton, Manchester. M12 5DR Tel: (+44) 61 223 1301 X2138 Email: jk@r6.cs.man.ac.uk / jk@nw.stl.stc.co.uk