On Sat, Jan 26, 2008 at 12:16:18AM -0800, [EMAIL PROTECTED] wrote:
I remember reading somewhere but I can't find it now that
the return value of a Scheme define expression like (define pi 3.14)
is undefined.

mit-scheme seems to return the symbol which seems perfectly reasonable.

If it is undefined why is that so?  Wouldn't specifying it remove ambiguity and
avoid problems?

Sort of.  Scheme is defined in such a way that it is never permissible to
use the return result of a define construct.  MIT scheme shows a result,
Guile doesn't show anything.  You can't write an expression that would use
the value for anything else, e.g.

  (define x (define y 3))

is illegal.

The result of (set! ...) _is_ undefined.

Guile's implementation returns a special object #<unspecified> that causes
an error if you try to use it.

David

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to