[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: when and unless

From: Chris K. Jester-Young
Subject: Re: when and unless
Date: Wed, 7 Dec 2011 11:10:20 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Dec 06, 2011 at 12:17:06PM +0100, David Kastrup wrote:
> I've actually wondered if it would not make sense to return
> *unspecified* in the case of the plain else-less if even if the
> condition is true, namely when you write (if #t #t).

This cannot be done without breaking the tail position guarantee that
"if" has. i.e., Scheme specifies that for expressions of the form

    (if TEST THEN)

that THEN and ELSE are both in tail position. Tail position means that
the evaluation of THEN or ELSE returns to the caller directly, and
there is no chance for the system to intervene, such as by replacing
the return value with unspecified.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]