Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!cc-server4.massey.ac.nz!massey!E.Ireland From: E.Ireland@@massey.ac.nz (Evan Ireland) Newsgroups: comp.lang.scheme Subject: Re: evaluating () should be an error Message-ID: <515sis-d@@massey.ac.nz> Date: 24 Mar 91 22:14:02 GMT References: <1991Mar24.064144.4256@daffy.cs.wisc.edu> Reply-To: E.Ireland@@massey.ac.nz Organization: Information Sciences, Massey University, New Zealand Lines: 33 >Scheme allows lots of sloppy and incompatible coding practices. For >instance, using the values of define, set!, set-car!, string-set!, >etc. These functions represent far worse compatablility problems than >'(). Some implementations return the new value and some the old value >of the object changed. The implementation I mentioned in my last message kept to the word of the language report (3rd version) and returned a special Unspecified value in these cases. The print routine would print nothing for an Unspecified value. => (+ 3 4) 7 => (set! x (+ 3 4)) => x 7 The only way to check for an Unspecified value would be to do a trick => (set! *unspecified* (set! x 1)) And then you could check (using equal?) if a value was Unspecified. Of course I never did this! Clearly this discourages the use of procedures such as "set!" in a non-portable manner, since there is only one Unspecified value, and "equal?" will always return #t. Anyway, this seemed a reasonable idea at the time, though perhaps taking the word of the report too literally! I wonder if anyone else has implemented something similar. _______________________________________________________________________________ E.Ireland@massey.ac.nz Evan Ireland, School of Information Sciences, +64 63 69099 x8541 Massey University, Palmerston North, New Zealand.