[plt-scheme] Understanding begin

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Jun 19 09:14:38 EDT 2008

+1

On Jun 19, 2008, at 8:59 AM, Shriram Krishnamurthi wrote:

> Despite Chongkai's more detailed message, I would say yes,
> this is a perfectly good way to understand it.
>
> On Thu, Jun 19, 2008 at 4:31 AM, Grant Rettke <grettke at acm.org> 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
>>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.