module examples.fibonacci2; behavior Fibonacci { int add(int x, int y) { return x + y; } int compute(int n) { if (n == 0) return 0; else if (n <= 2) return 1; else { Fibonacci fib = new Fibonacci(); token x = fib <- compute(new Integer(n-1)); compute(new Integer(n-2)) @ add(x,token) @ currentContinuation; } } void act(String args[]) { int n = Integer.parseInt(args[0]); compute(new Integer(n)) @ standardOutput<-println(token); } }