Re: Curious about method handling

Artem Gr <[email protected]> Sat, 06 Aug 2005 16:45:45 +0400
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
> Suggested Nice syntax:
> 
> a  => a
> a()  => the return value of a
> b.c  => c curried with b
> b.c()  => the return value of c curried with b

In fact, i think, the statement "b.c == b.c()" will remain in the 
language as a part of "accessor method" syntax. I think it is currently 
underdeveloped (no clear way of substituting accessor methods; presence 
of different get* set* accessor methods; unclear interference with 
on-the-way visibility system) or just isn't documented well. Replacing 
it with a closure (anonymous method) syntactic sugar doesn't seem an 
obvious decision to me. It might be possible, though, to implement such 
behaviour when a method is expected, and "b.c" doesn't return one; that 
is, when we expect a value, "b.c" is used as an accessor to a "virtual" 
field "c", and we expect a method, "b.c" is used as a closure. 
Nevertheless, i don't see much benefit in this, since "()=>b.c" syntax 
is sufficiently convenient and is much clearer about what it does.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf