chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Question about set-car! and set-cdr!


From: John Cowan
Subject: Re: [Chicken-users] Question about set-car! and set-cdr!
Date: Thu, 6 Mar 2014 14:04:23 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

Ivan Shmakov scripsit:

>  >> Maybe this could be addressed by splitting the "scheme" module of
>  >> chicken into a "scheme-pure" for the sake of safety,
>  >> "scheme-mutations" having the rest and make "scheme" importing and
>  >> reexporting both sets of bindings.
> 
>       That’s what the Racket folks did: they have their own Scheme
>       dialect without mutable pairs, and they have the “standard”
>       Scheme(s) available as an option.

R6RS does what Daniel suggests, splitting at the module level only:
set-car! and set-cdr! are in a separate module, and if it's not imported
anywhere you know all pairs are functional, but there is only one
species of pairs.  Racket makes normal pairs functional, and provides a
separate data structure, not interoperable with pairs, which is mutable.
That means if you are going to mutate anything, you have to potentially
change all your code to use mpairs instead of pairs, and duplicate it
for parts that should work on pairs.  IMHO not a win.

Then again, though Racket supports R5RS and R6RS for backward
compatibility, the Racketfolk consider their language a descendant of
(or successor to) Scheme rather than a variety of Scheme.  Forward
compatibility doesn't interest them.

-- 
He made the Legislature meet at one-horse       John Cowan
tank-towns out in the alfalfa belt, so that     address@hidden
hardly nobody could get there and most of       http://www.ccil.org/~cowan
the leaders would stay home and let him go      --H.L. Mencken's
to work and do things as he pleased.              Declaration of Independence



reply via email to

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