I want to make sure I got his right before implementing it.
It is my understanding that we would like to support something like:
inc: Int => Int -> Int; inc x y = x + y;
five = inc (y := 2) (x := 3); % <=> (inc 3 2)
Now , as you see `x` is an implicit argument. The user can provide a value that will populate that argument with a default value if not provided.
default = new-attribute (Int); attribute Int default 1;
four = inc 3; % <=> inc 1 3 inc2 = inc (x := 2); % partial application five = inc2 3; % <=> inc 2 3
% ---------- Now why would we not allow something like this: (case over a string for simplicity, although it is not supported)
fun: Int => Int => Int -> Int; fun x y z = x + y + z;
default = new-attribute (String -> Int); attribute fun default (lambda var-name -> case var-name | "x" -> 1 | "y" -> 0);
three = fun 2;% <=> (fun 1 0 2);
if a `default` is not provided for the function the compiler will fall back to the previous example.