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

  1. Path: sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!spool.mu.edu!olivea!mintaka.lcs.mit.edu!zurich.ai.mit.edu!jaffer
  2. From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Unspecified values in R4RS
  5. Message-ID: <JAFFER.93Jan24154351@montreux.ai.mit.edu>
  6. Date: 24 Jan 93 20:43:51 GMT
  7. References: <1993Jan21.195822.23639@sqwest.wimsey.bc.ca> <1jn7ou$m5n@agate.berkeley.edu>
  8.     <1jukvoINNgis@columbia.cs.ubc.ca>
  9. Sender: news@mintaka.lcs.mit.edu
  10. Organization: M.I.T. Artificial Intelligence Lab.
  11. Lines: 33
  12. In-Reply-To: manis@cs.ubc.ca's message of 24 Jan 1993 09:51:52 -0800
  13.  
  14. In article <1jukvoINNgis@columbia.cs.ubc.ca> manis@cs.ubc.ca (Vincent Manis) writes:
  15.  
  16.    Yes!!! This has a number of pedagogical advantages, not least of which
  17.    is that it makes clear the difference between an expression (evaluated
  18.    primarily for value) and a command (evaluated only for effect). For
  19.    proficient programmers, this isn't a big deal, but for beginners it's
  20.    essential. 
  21.  
  22.    I like the Chez Scheme approach. There's a void type, with only a single
  23.    value. The procedure (void) yields this value, and (void? x) is a
  24.    type-checking predicate. This is a simple, clean, approach, and is quite
  25.    compatible with existing Schemes. (If your Scheme doesn't have an
  26.    #unspecified, you can always use a gensym.) Apart from this, the only
  27.    other change which has to be made is to have the top level print nothing
  28.    when the result is void.
  29.  
  30. Multiple values are looking like they will be included in R5RS.
  31. Unfortunately, the following langage appears in the proposal:
  32.  
  33.   Except for continuations created by the CALL-WITH-VALUES procedure,
  34.   all continuations take exactly one value, as now; the effect of
  35.   passing no value or more than one value to continautions that were
  36.   not created by the CALL-WITH-VALUES procedure is unspecified (as
  37.   indeed it is unspecified now).
  38.  
  39. If this language were weakened to allow those continuations which
  40. ignore the returned value to receive either 0 or 1 values, then (VOID)
  41. could be replaced by (VALUES).  The read-eval-print loop could then
  42. print all the values it receives (sometimes none).
  43.  
  44. I think it might also be worthwhile that an implementation make all
  45. the procedures which currently return unspecified values return 0
  46. values and check for using missing values.
  47.