[plt-scheme] Classes, super and apply
You want
(super . other)
instead of
(apply super other)
Robby
At Thu, 7 Dec 2006 17:30:51 +0000, Dave Gurnell wrote:
> Dear All,
>
> Is there any way to use "apply" on the "super" and "this" forms in a
> class? I'm thinking of something like the following:
>
> (require (lib "class.ss")
> (lib "kw.ss"))
>
> (define a%
> (class* object% ()
> (public my-method)
>
> (define my-method
> (lambda/kw (#:key [a #f] [b #f])
> (list a b)))
>
> ))
>
> (define b%
> (class* a% ()
> (override my-method)
>
> (define my-method
> (lambda/kw (#:key [c #f] [d #f] #:other-keys+body other)
> (append (apply super other) (list c d))))
>
> ))
>
> (send (make-object b%) my-method #:a 1 #:b 2 #:c 3 #:d 4)
>
> you can't do this, of course, because "super" is syntax.
>
> Cheers,
>
> -- Dave
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme