/* test2.bob */ let var x := 10 var y := 0 var u := "I love compilers" var v := "I hate compilers" function g(x:int):int = ( f(); if (x=0) then print("I got a zero!"); x+2 ) function f() = print("I got called from g!") function h(x:int) = (x := x + 1) in ( while (x>1) do (x := x-1; print("while loops are fun! ")); y := g(y); x: = x + (let var x:=2 in x + (let var x:=3 in x + (let var x := 4 in ( print("I'm really nested!"); x ) end) end) end); if (x=10) then print(u) else print(v); if (y=2) then print(u) else print(v); h(y); if (y=2) then print(u) else print(v); refassign(ref(y),10); if (y=10) then print(u) else print(v); if (1 | (4/0)) then print("my booleans are lazy"); if (refassign(8231,y); 1) then print("Wow! That didn't cause a segmentation fault!") ) end