heptagon/test/async/rapide_lent_a.ept
Léonard Gérard b913edcd5e Decade alpha1
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])
2011-03-21 22:24:36 +01:00

25 lines
438 B
Plaintext

node lent(coeff:int) returns (y:int)
let
y = do_stuff(coeff);
tel
node rapide<<size:int>>() returns (z:int)
var y : int; cpt : int; big_step : bool;
let
big_step = cpt = 0;
cpt = size fby (if big_step then size else cpt - 1);
y = merge big_step
(true -> 0 -> !(pre (async lent(size))))
(false -> 0 fby y when false(big_step));
z = do_stuff(1) - y;
tel
node main() returns(r: int)
let
r = rapide<<1000>>();
tel