[plt-scheme] scheme/mlist missing?

From: Gregory Woodhouse (gregory.woodhouse at sbcglobal.net)
Date: Tue Jul 29 03:02:15 EDT 2008

On Jul 28, 2008, at 11:42 PM, Eli Barzilay wrote:

> On Jul 28, Gregory Woodhouse wrote:
>> The Reference discusses mutable pairs and mutable lists. I came
>> across this looking for set-car! and set-cdr! Apparently, they are
>> not there, but there is a set-mcar! and set-mcdr! for mutable lists -
>> or so I thought
>
> They are part of `scheme/base'.
>

You mean mutable pairs, right? I don't think set-car! and set-cdr!  
are there.

>
>>> (require scheme/mlist)
>
> This doesn't exist -- but there is a `scheme/mpair' module with some
> utilities.


Yes, that's what I was looking for. It allows me to do what I might  
have done in R5RS

 > (require scheme/mpair)
 > (define a (list->mlist '(1)))
 > a
{1}
 > (set-mcdr! a a)
 > (mlist-ref a 7)
1
 >

Of course, this is likely "academic" as shared bindings seem a lot  
nicer.

>
> -- 
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli  
> Barzilay:
>                   http://www.barzilay.org/                 Maze is  
> Life!

"It is never too late to become reasonable
and wise; but if the insight comes too late,
there is always more difficulty in starting
the change." -- Immanuel Kant

http://www.gwoodhouse.com
http://GregWoodhouse.ImageKind.com




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080729/97449ea6/attachment.html>

Posted on the users mailing list.