This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: GOOPS: New syntax for `define-method'?
Ole Myren Rohne <ole.rohne@cern.ch> writes:
> Initial idea:
> No way, you cannot use anything but a single symbol for "name"!
>
> Check before screaming:
> guile> (define ((test x) y) (* x y))
> guile> ((test 3) 4)
> 12
>
> This seems to happen by recursive macroexpansion:
>
> (define ((test)) 0)
> -> (define (test) (lambda () 0))
> -> (define test (lambda () (lambda () 0)))
>
> But why would anyone want to do that?
1. this is not standard. AFAIK only SCM and Guile can do this.
2. it can be handy:
(define ((curry+ a) b) (+ a b))
(define 2+ (curry+ 2))
(2+ 3)
==> 5
3. I can't see why the new `define-method' syntax can't be made to
conform to this extension, except for the need to accomodate
defining setter methods. you just can't have everything, I
guess...
--
A CONS is an object which cares.
-- Bernie Greenberg.