[plt-scheme] mreverse!

From: praimon (praimon at gmail.com)
Date: Sat Jan 24 16:40:30 EST 2009

Wow, that sure is simple. I know nothing of boxes.
regards,
praimon

On Sat, Jan 24, 2009 at 4:33 PM, Eli Barzilay <eli at barzilay.org> wrote:
> On Jan 24, praimon wrote:
>> Thank you, Eli and David, for those pointers.
>> But if one DID write a destructive reverse in MY strange sense of
>> it, what would it look like? Like I said, my version is nutty
>> looking, and I'd like to see a good, simple coding.
>
> IIRC, your version was something along this line:
>
>  (define blist (box (list 1 2 3 4)))
>  (define (breverse! blist) (set-box! blist (reverse (unbox blist))))
>
> --
>          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                  http://www.barzilay.org/                 Maze is Life!
>


Posted on the users mailing list.