I want to do this but I can't:
fun f (i:int) =>
let fun g (x:int) => i + x in
g (i+2)
;
I have to go to statement form:
fun f (i:int) =
{
fun g(x:int) => i + x;
return g(i+2);
}
That's a pain. Ocaml can do this because let introduces a function:
let x = 1 in
let f y = y + 1 in
...
In Felix you can do this:
fun f(i:int) =>
let ?g = fun (x:int) => i + x in
g (i+2)
;
but this is not the same: it makes g a closure. Closure can only
be inlined away with data flow analysis, it may happen in this case
but I wouldn't bet on it :)
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language