[plt-scheme] Macros which expand to uses of (call-next-method)
Eli (and others),
I can't seem to reproduce the original behavior, even with the
original example. I don't know what the deal was---maybe some bad
interaction between the context I originally used it in, and the one
I'm testing it in now? Anyway, sorry for wasting your time on a
non-problem.
Thanks for the reply.
Will
On 6/26/06, Eli Barzilay <eli at barzilay.org> wrote:
> On Jun 23, Will Farr wrote:
> > [...]
> > If I don't introduce call-next-method with datum->syntax-object, I
> > get errors about call-next-method being undefined. Is there *any*
> > context I can use to introduce call-next-method so that this works,
> > or am I just hosed?
>
> I don't know why you'd get that -- it would be helpful if you can
> synthesize a minimal example. I tried the following which worked
> fine:
>
> => (defclass <a> ())
> => (defmethod (foo (x <a>)) (printf "a\n"))
> => (define-syntax deffoo
> (syntax-rules ()
> [(_ <c>) (defmethod (foo (x <c>)) (printf ">>> ~s\n" '<c>) (call-next-method))]))
> => (defclass <b> (<a>))
> => (deffoo <b>)
> => (foo (make <b>))
> >>> <b>
> a
> => (defclass <c> (<b>))
> => (deffoo <c>)
> => (foo (make <c>))
> >>> <c>
> >>> <b>
> a
>
> --
> ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
> http://www.barzilay.org/ Maze is Life!
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>