[plt-scheme] Understanding begin

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Thu Jun 19 05:03:46 EDT 2008

No. See http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_idx_418

" The <begin> keyword has two different roles, depending on its context:"

What you are taking about only models the second form/role of begin.

Chongkai

Grant Rettke wrote:
> While studying Scheme, I had wondered how 'begin' might reduce to
> something simpler.
>
> While reading "Lambda: The Ultimate Imperative", I see that  in
> Scheme, because of eager evaluation (aka call-by-value aka applicative
> order), lambda can be used to model imperative statements. So, these
> expressions are equivalent (each prints 'abc'):
>
> (begin
>   (display 'a)
>   (display 'b)
>   (display 'c))
>
> ((lambda (x) ((lambda (x) (display 'c)) (display 'b))) (display 'a))
>
> Is this the right way to understand begin? To implement it?
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>   


Posted on the users mailing list.