b913edcd5e
On the road to beta is the new Minils AST, for now : * Heptagon and Obc AST changes, * Java code generation, * Recursives Qualnames, * Various bug fixes, * Added partial application for iterators, For instance: ... = map<<n>> (f<<se>>)((t1, t1'))(t2, t3) is translated to: for(int i =...) ... = f(t1, t1', t2[i], t3[i])
25 lines
384 B
Text
25 lines
384 B
Text
|
|
fun sum (x,m: int) returns (s: int)
|
|
let
|
|
s = x + m
|
|
tel
|
|
|
|
fun substr (x,m: int) returns (d: int; m2:int)
|
|
let
|
|
d = x - m;
|
|
m2 = m;
|
|
tel
|
|
|
|
fun mean<<n: int>> (i: int^n) returns (m: int)
|
|
let
|
|
m = (fold (+) <<n>> (i,0)) /n
|
|
tel
|
|
|
|
|
|
node normalized_movie<<n: int>> (i: int^n) returns (im: int^n)
|
|
var m: int; trash: int;
|
|
let
|
|
m = mean<<n>>(i);
|
|
(im,trash) = mapfold substr <<n>> (i,m)
|
|
tel
|
|
|