Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: X10 2.2
-
Fix Version/s: X10 1000
-
Component/s: Language Design
-
Labels:None
-
Number of attachments :
Description
When writing code for application frameworks such as map-reduce, the programmer ends up writing code such as:
val mapper =
(key: Long, value: Text, sink:(Text,Int)=> Void) =>
value.stringTokenizer().map((in:String) => sink(word,1));
It would be nice if this could be simplified to:
val mapper(key: Long, value: Text, sink:(Text,Int)=> Void) = value.stringTokenizer().map((in:String) => sink(word,1));
So the construct is
var/val <id> <param list> = FunctionBody;
It should probably be the case that the variable being defined is not permitted to occur in the initializer. Thus, use def for recursive functions.
This syntax conflicts with exploded formal parameter syntax