declare fun {Inc N} N+1 end {Browse {Inc 3} } declare fun {Fib N} if N < 2 then N else {Fib (N-1)} + {Fib N-2} end end {Browse {Fib 3}} {Browse {Fib 4}} % See Fib.oz for lazy version {Browse &c} declare ListLength fun {ListLength L} case L of _|T then 1 + {ListLength T} else 0 end end % Some tests of ListLength {Browse {ListLength [a b c]}} declare L L = [a b c d e f] {Browse {ListLength L}} % Threads declare proc {GeneKelly} thread {Dance} end thread {Sing} end end proc {Dance} {Browse im_dancing} {Delay 3} {Browse im_dancing} end proc {Sing} {Browse and_singing} {Delay 3} {Browse in_the_rain} end {GeneKelly} % dataflow execution declare A B C C = A+B {Browse C} % then later feeding... A=10 B=20 % The following suspends declare L1 {Browse {ListLength L1}} L1 = [a b] % But with threads this works... declare L2 thread {Browse {ListLength L2}} end L2 = [a b c d e] % What's going on here? declare L3 thread {Browse {ListLength L3}} end thread L3 = a|b|c|L4 end L4 = d|nil