Re: Was there a particular reason for "begin"?
- From: Nils M Holm <before-2007-07-01@xxxxxxxxx>
- Date: Thu, 5 Apr 2007 11:11:14 +0000 (UTC)
dillogimp@xxxxxxxxx wrote:
On Apr 5, 4:24 pm, Nils M Holm <before-2007-07...@xxxxxxxxx> wrote:
(define (d x) (display x) x)
(define (b . x) (car (reverse x)))
Both B and BEGIN evaluate all of their arguments and both return the
normal form of their last argument.
But:
(b (d 1) (d 2) (d 3))
may display any permutation of {1,2,3} as its side effect while
(begin (d 1) (d 2) (d 3))
will always display 123.
Wow, does that I mean I don't need a special syntax case for
begin...cool.
Actually, you do have to implement BEGIN as syntax, because
B is /not/ equal to BEGIN.
(begin x y z)
is in fact equal to
((lambda (ignore) z) ((lambda (ignore) y) x))
--
Nils M Holm <n m h @ t 3 x . o r g> -- http://t3x.org/nmh/
.
- References:
- Was there a particular reason for "begin"?
- From: dillogimp
- Re: Was there a particular reason for "begin"?
- From: Nils M Holm
- Re: Was there a particular reason for "begin"?
- From: dillogimp
- Was there a particular reason for "begin"?
- Prev by Date: Re: Newbie - I'm soooo stuck - trying to remove an item from a list
- Next by Date: Re: Newbie - I'm soooo stuck - trying to remove an item from a list
- Previous by thread: Re: Was there a particular reason for "begin"?
- Next by thread: Re: Was there a particular reason for "begin"?
- Index(es):
Relevant Pages
|
Loading