Link Details

Link 68605 thumbnail
User 111696 avatar

By bloid
via jroller.com
Published: Feb 29 2008 / 19:03

While there's still no decision made on the integration of closure to the Java language (AFAIK), I think the BGGA proposal is the most promising candidate. I'm quite confident it will eventually be integrated to the language.
  • 12
  • 2
  • 835
  • 193

Comments

Add your comment
User 200729 avatar

axiomshell replied ago:

0 votes Vote down Vote up Reply

Is there any specific reason to have chosen the => on BGGA?

User 111696 avatar

bloid replied ago:

1 votes Vote down Vote up Reply

It seems to have come about in the v0.3 specification:

http://gafter.blogspot.com/2006/10/closures-for-java-v03.html

Why => was chosen over -> ... I have no idea

User 107114 avatar

daniel replied ago:

1 votes Vote down Vote up Reply

=> and -> are two distinct symbols in math. What's interesting is that => is usually associated with implication, while -> is more traditionally used for defining function signatures (f: R -> D | function f maps from reals to integers). => makes sense when defining an actual closure value like so (Scala syntax):

val closure = { s:String =>
s + " appendage"
}

-> would make more sense for defining function types, but it seems that for simplicity's sake, only one of them was chosen. Since -> has totally different semantic implications to those of us used to C++, => was probably chosen to avoid confusion.

User 222498 avatar

M Easter replied ago:

0 votes Vote down Vote up Reply


Interesting discussion in comments on the site...

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.