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