This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GOOPS: New syntax for `define-method'?


Miroslav Silovic <silovic@zesoi.fer.hr> writes:

> I like the new syntax, too, but there is a caveat: in
> 
> (define (name arg arg...)),
> 
> name is same as the arguments in that it does not have to be a symbol
> (i.e. is evaluated and the result of the evaluation is called). 

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?

	Regards,        
        Ole





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]