You can now do this:
fun add : int -> int -> int = "$1+$2";
println$ add 1 2;
fun add3 : int -> int -> int -> int = "$1+$2+$3";
println$ add3 1 2 3;
i.e. you can make a primitive accept a sequence of arguments
instead of a tuple. There are many caveats:
It only work for 2 or 3 arguments.
It does not work for procedures.
You can NOT form a closure. for example
var g = add;
var f = add 1;
will BOTH fail. Felix doesn't generate closures for C bindings except
for the whole function. If you want a closure you have to use
manual eta-expansion:
fun eta (x:int) (y:int) => add x y;
and now eta is a normal felix function. The compiler gets confused
making a closure of add, whether or not an argument is given.
Of course, this can all be fixed (but I won't bother unless the feature
proves useful). [I did this thing just to relieve the boredom of writing docs :]
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language