Re: Discussion: Closures

Mark Swanson <mark-e2GstmqqWGa5mcYau+xr2AC/[email protected]> Thu, 3 Feb 2005 12:02:52 -0500
Newsgroups gmane.comp.java.beanshell.devel
Organization Web Service Solutions, Inc.
Message-ID <[email protected]>
On February 3, 2005 11:31 am, Patrick Niemeyer wrote:
>
> One possibility would be to use another eval-like method.  For example,
> it could be named callable().  It could return a closure with a call()

or perhaps closure()?

> block-like syntax that we've discussed before.  My only fear there is
> that it could become ambiguous with Java syntax.
>
> For example:
>
> c={ someMethod(); }
>
> Is that a closure or is it just a loose form of:
>
> Object [] c = { someMethod() };

Urg... I would find the overloading confusing. I imagine it would lead to code 
that would be hard to read.

After reading about Apache functors and the recent article on Java.net about 
using java 5 language features to simulate closures (predicate article) and 
reading the glowing comments about closures from the Ruby folks I feel the 
ability is much more important than the syntactic sugar surrounding it.

I oppose the block-like syntax because it does not add functionality and it 
overloads the Java syntax in a confusing manner.

-- 
Free SyncML-capable J2ME & J2SE replacement for Exchange and Outlook
http://www.ScheduleWorld.com/
WAP: http://www.ScheduleWorld.com/sw/WAPToday?id=4000&tz=EST
WebDAV: http://www.ScheduleWorld.com/sw/webDAVDir/4000.ics
VFREEBUSY: http://www.ScheduleWorld.com/sw/freebusy/4000.ifb


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl