[plt-scheme] Side effect requiring rnrs/base-6?
Hi Jens,
Thanks for the explanation. But the same code is behaving differently
in linux and mac. Refer the screenshots below. I suspect something
fishy here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mac.jpg
Type: image/jpg
Size: 36193 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20090917/222c611d/attachment.jpg>
-------------- next part --------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux1.jpg
Type: image/jpg
Size: 42428 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20090917/222c611d/attachment-0001.jpg>
-------------- next part --------------
And why does it work when I comment the letrec block?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux2.jpg
Type: image/jpg
Size: 40800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20090917/222c611d/attachment-0002.jpg>
-------------- next part --------------
Cheers,
GG
On 16-Sep-2009, at 11:29 PM, Jens Axel S?gaard wrote:
> 2009/9/16 Jens Axel S?gaard <jensaxel at soegaard.net>:
>> [sent privately too by accident]
>>
>> 2009/9/16 Ganesh Gunasegaran <ganesh.gunas at gmail.com>:
>>> Hi All,
>>>
>>> I am very new to Scheme
>>>
>>> What is wrong with the following code?
>>>
>>> --------------------------------------------------------------------------------------------------------------------------------
>>> #lang scheme
>>> (require rnrs/base-6)
>
> One more thing:
>
> Since the entire rnrs/base-6 is required some functions from "scheme"
> such as car, cdr, cons are shadowed by their bindings in rnrs/base-6.
> In particular in rnrs the identifier car is bound to the same value
> as the identifier mcar is bound to in "scheme'. That is, after the
> require line, when you write "car" you are actually calling "mcar".
>
> This might we somewhat confusing, for new Scheme users, so
> here is a practical advise:
>
> Stick either to the "scheme" language, and if you need a particular
> function from rnrs use the documentation to figure out, what
> is called in PLT Scheme (in 99% of the cases the names
> are the same).
>
> --
> Jens Axel S?gaard