home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / scheme / 2956 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  1.9 KB

  1. Path: sparky!uunet!think.com!mintaka.lcs.mit.edu!ai-lab!zurich.ai.mit.edu!gjr
  2. From: gjr@zurich.ai.mit.edu (Guillermo J. Rozas)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Unspecified values in R4RS
  5. Date: 22 Jan 93 13:12:25
  6. Organization: M.I.T. Artificial Intelligence Lab.
  7. Lines: 38
  8. Message-ID: <GJR.93Jan22131225@chamarti.ai.mit.edu>
  9. References: <1993Jan21.195822.23639@sqwest.wimsey.bc.ca> <1jn7ou$m5n@agate.berkeley.edu>
  10.     <BRENT.93Jan22085102@rcx1.ssd.csd.harris.com>
  11.     <1jp5n7$nm@agate.berkeley.edu> <OZ.93Jan22114638@ursa.sis.yorku.ca>
  12. Reply-To: gjr@zurich.ai.mit.edu
  13. NNTP-Posting-Host: chamartin.ai.mit.edu
  14. In-reply-to: oz@ursa.sis.yorku.ca's message of Fri, 22 Jan 1993 16:46:38 GMT
  15.  
  16. In article <OZ.93Jan22114638@ursa.sis.yorku.ca> oz@ursa.sis.yorku.ca (Ozan Yigit) writes:
  17.  
  18. |   Brian Harvey writes:
  19. |
  20. |      Leaving something unspecified in the standard invites some implementor to
  21. |      give it a "useful" value; and that encourages users of that implementation
  22. |      to use it; and that makes programs non-portable.
  23. |
  24. |   Are there such implementations? Isn't there some that return
  25. |   #<unspecified>, which is not a "useful" value? Can we point to real
  26. |   implementations, instead of talking about a hypothetical one?
  27.  
  28. Yes, except that practice precedes freedom.  The reason for the
  29. unspecified (particularly in the case of SET!) was lack of agreement
  30. among the original authors.
  31.  
  32. Some implementations (Scheme 311, if I remember correcly), following
  33. Lisp tradition, returned the stored value.  Thus, in these
  34. implementations
  35.  
  36.      (let ((x 4))
  37.       (set! x (set! x 3))
  38.       x)
  39.  
  40. returned 3
  41.  
  42. Other implementations (MIT Scheme, in particular) returned the
  43. previously stored value,  Thus
  44.  
  45.     (let ((x 4))
  46.       (set! x (set! x 3))
  47.       x)
  48.  
  49. returned 4
  50.  
  51. Because we could not agree what was better (or whether a third
  52. alternative was) we left the returned value unspecified so that no
  53. program abiding by the report could depend on it.
  54.