Python syntax in Lisp and Scheme
Marco Antoniotti
marcoxa at cs.nyu.edu
Wed Oct 8 17:37:24 EDT 2003
On Wednesday, Oct 8, 2003, at 17:17 America/New_York, David Mertz,
Ph.D. wrote:
>
> |realized by CLOS and Dylan), and you also do not have the opportunity
> |to CALL-NEXT-METHOD within a method definition
>
> You mean something like
>
> Listing 8. Programming with manual propagation
> -----------------------------------------------------------------
> def do_between(x, dispatch):
> print "do some initial stuff"
> val = dispatch.next_method() # return simple value of up-call
> print "do some followup stuff"
> return "My return value"
> foo = Foo()
> import multimethods
> multi = multimethods.Dispatch()
> multi.add_dispatchable((Foo,), do_between)
> multi.with_dispatch(foo)
> # Or: multi(foo, multi)
>
> (from the article)?
Yes. I was just about to write back to you to to admit to that. Yet
again, you do have to pass around the 'dispatch' object explicitly.
Cheers
--
Marco Antoniotti
--
Marco Antoniotti
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
715 Broadway 10th FL fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.
More information about the Python-list
mailing list