[plt-scheme] Bug in interaction between shared and class system?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Dec 29 09:15:01 EST 2009

No, that doesn't work. The docs for scheme/shared give a precise spec
of what will work.

Robby

On Tue, Dec 29, 2009 at 7:47 AM, Todd O'Bryan <toddobryan at gmail.com> wrote:
> #lang scheme
>
> (define Node%
>  (class object%
>    (init-field value
>                next)
>
>    (super-new)))
>
> (define cycle
>  (shared ([the-node (new Node% [value "abc"] [next the-node])])
>    the-node))
> ------------------------
> If I'm using shared correctly, that should create a Node% that refers
> back to itself.
>
> cycle really is a Node%:
>
>> cycle
> #(struct:object:Node% ...)
>
> but its next didn't get set correctly.
>
>> (get-field next cycle)
> #<undefined>
>
> Is this a bug, or am I not allowed to do this?
> Todd
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.