Skip to content
Snippets Groups Projects
Commit 72b3ce3d authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add automatic conversion of tuples to R^d as function arguments

For consistency as tuple can be used to initialize R^d elements such as in
``
R^3 x = (1,2,3);
``
they can be used as function parameters

``
let f: R^3->R, x -> x[0]+x[1]+x[2];

R x = f((1,2,3));
``
Observe mandatory parenthesis surrounding the tuple. Their prevent ambiguous
writing. For instance one can write

``
let f: R*R^3*R^2->R, (t,x,y) -> t*(x[0]+x[1]+x[2])*y[0]+y[1];

R x = f(2,(1,2,3),(2,1.3));
``
Obviously, `f(2,(1,2,3),(2,1.3))` makes complete sense, while without these
parenthesis, `f(2,1,2,3,2,1.3)` would require non-trivial decoding.
parent 48aad214
No related branches found
No related tags found
1 merge request!37Feature/language
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment