



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




local X in local Y in X = 3 {MyProc X Y} Z = Y end end
Mult = proc {$ N1 N2 Res} case N1 of succ(num: Pre) then local Val in {Mult Pre N2 Val} {Plus N2 Val Res} end else local Assg in Assg = proc {$ A B R} R = A end {Assg zero Pre Res} end end end
local F in local ToInt in ToInt = proc {$ N ?R} case N of %% Parts (c) and (e) ask about the call below succ(num: Pre) then R = 1 + {ToInt Pre} else R = 0 end end F = ToInt end local Temp in %% Parts (b), (d), and (e) ask about the call below {F succ(num: succ(num: succ(num: succ(num: zero)))) Temp} {Browse Temp} end end
fun {SumTo N} {SumIter N 0} end Result = {SumTo 7}
local SetQ Q in Q = 4020 SetQ = proc {$ V} Q = V end {SetQ 99} {Browse ’Q is ’#Q} end