[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is too an application



I am getting an internal error with this GUI example from htdp... Would
someone be willing to examine it and tell me what we are doing wrong?  I am
assuming that our callback functions are written improperly.

Thank you for your time...

Dan


> [Original Message]
> From: Matthew Flatt <mflatt@cs.utah.edu>
> To: Greg Pettyjohn <pgreg14@qwest.net>
> Cc: <plt-scheme@fast.cs.utah.edu>
 > Date: 10/21/01 12:28:56 PM
> Subject: Re: is too an application
>
> Quoting "Greg Pettyjohn":
> > OK, that helps, but suppose I want to do something like this:
> > 
> > 
> > (define t%
> >   (class object%
> >     (public t1 t2)
> >     (define t1
> >       (lambda x
> >         (printf "t1 called with args: ~a~n" x)))
> >     
> >     (define t2
> >       (lambda x
> >         (printf "t2 called with args: ~a~n" x)
> >         (let ([y (cons 'foo x)])
> >           (send this t1 . y))))
> >     (super-instantiate ())))
> > 
> > (define t (instantiate t% ()))
> > (send t t2 'a 'b 'c 'd)
> > 
> > How can I rewrite t2 without using the embedded let?
> 
> When designing the `.'-based send form, it seemed like a bad idea, but
> I couldn't pin down why. Now I see clearly.
> 
> The problem is that
>   (send this t1 . (cons 'foo x))
> and
>   (send this t1 'foo x)
> are equivalent at the reader level.
> 
> Requiring the expression after `.' not to have parentheses is weird.
> Looks like we need an `apply-send' form, instead.
> 
> Matthew



--- Dan Anderson
--- dan1625@earthlink.net
--- EarthLink: The #1 provider of the Real Internet.

Xaddress book.scm