[racket] shared and immutable structures

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Tue Feb 1 10:48:37 EST 2011

On 2/1/11 10:39 AM, Stephen Chang wrote:
> So why wouldnt using a mutable struct work?
>
>> (struct kons (first rest) #:transparent #:mutable)
>> (shared ([a (kons 1 a)]) a)
> #0=(kons 1 #0#)

Yes, but that's what I was trying to avoid.  My structure represents 
immutable cyclic data, so it's weird to make it mutable.  Pairs are 
immutable and work with shared after all.

Anyway, it's no big deal.  I'll just make the structure mutable and move on.

Thanks,
David


Posted on the users mailing list.