Re: Discussion: Closures

Bob Lee <[email protected]> Thu, 3 Feb 2005 11:00:04 -0800
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <[email protected]>
Getting closer. How about this?

foo = closure(bar) { print(bar); };
foo(5);

I'd still prefer something like this:

foo = (bar) { print(bar); };
foo(5);

Or even the ruby/groovy approach:

foo = { bar | print(bar); };
foo(5);

Bob

On Thu, 3 Feb 2005 09:53:37 -0800, Shankar Unni <[email protected]> wrote:
> The only minor quibble I might have is for the parameter declaration syntax.
> Does this not look more natural?:
> 
>   x = callable() {
>      foo = someMethod();
>      bar++;
>   };
> 
>   z = callable(foo, bar) {
>      print(foo);
>      someMethod(bar);
>   };
> 
>   x.call();
>   z.call(foo,bar);
> 
> -------------------------------------------------------
> 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
> _______________________________________________
> Beanshell-developers mailing list
> Beanshell-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/beanshell-developers
> 
>


-------------------------------------------------------
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