Safe, Closure-free, Serializable functions

François REMY francois.remy.dev at outlook.com
Fri Sep 27 13:57:44 PDT 2013


> Tiny bike-shed-ish comment that we need a linking punctuator so that
> arrow function syntax can be extended likewise:
>
> var f = function (x, y) : (z) {...}
>
> Arrow form showing expression body:
>
> var f = (x, y) : (z) => x*y/z;

FWIW, I like the semi colon. However, I prefer 

|    function(x,y):safe(z) { ... }
and
|    (x,y):safe(z) => ...

because it enables further markdown annotation to functions, and I'm pretty sure we will want some more in the future. 

I don't know, crazy things like 
|    function(x,y):tail(...) 
for tail-recursion-desired functions, or 
|    function(x,y):local(...)
for functions that can run on the same callstack because they can only get called during their closure lifetime (they throw otherwise).



----

The brackets syntax looks reasonable, too, with an optional prelude:

|    function(x,y)[z] { ... }
and
|    (x,y)[z] => ...


Extensible to:
|    function(x,y)[tail(...)] 
for tail-recursion-desired functions, or 
|    function(x,y)[local(...)]
for
 functions that can run on the same callstack because they can only get 
called during their closure lifetime (they throw otherwise). 		 	   		  


More information about the es-discuss mailing list