This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: GOOPS: New syntax for `define-method'?
Michael Livshin <mlivshin@bigfoot.com> writes:
> 1. this is not standard. AFAIK only SCM and Guile can do this.
Michael Livshin <mlivshin@bigfoot.com> writes:
> Ole Myren Rohne <ole.rohne@cern.ch> writes:
> > guile> (define ((test x) y) (* x y))
> > guile> ((test 3) 4)
> > 12
> > But why would anyone want to do that?
>
> 1. this is not standard. AFAIK only SCM and Guile can do this.
Just for the record:
mit-scheme yes
rscheme no
stk no
> 2. it can be handy:
>
> (define ((curry+ a) b) (+ a b))
> (define 2+ (curry+ 2))
> (2+ 3)
> ==> 5
Well, (define (curry+ a) (lambda (b) (+ a b))) is 9 full characters
longer:-)
> 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...
And would it be worthwile anyway? This funny syntax started as an
unintentional side-effect of the define implementation, and should
probably be left as that.
Regards,
Ole