[plt-scheme] order of instantiation
Try an eta-expansion of the function. That's a well-known letrec
problem.
At Indiana, it was known as the coroutines with mutual recursion
problem.
-- Matthias
At Tue, 17 Sep 2002 15:46:48 -0400, "Mike T. Machenry" wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> I am attempting to write a function that adds panel to a frame. This panel
> must contain a message% and a button%. The button% callback must refer to
> the message%. When I wrote the function initilally I had:
>
> (deine (func frame)
> (let ([panel (instantiate ... (parent frame) ...)]
> [message (instantiate ... (parent panel) ...)])
> (instantiate button% ...)))
>
> I then realize that it is much better to have the button be to the left
> of the message. This seems to be alot more difficult as I need to instantiate
> the button first inorder to do this. However when I do this I cannot reference
> the (then undefined) message%. I wrote a version using letrec but it is not
> working as the callback (defined after the button in the letrec) is
> undefined. Anyone know how I can get around this?
>
> -mike