RosettaCodeData/Task/Man-or-boy-test/Icon/man-or-boy-test-2.icon
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

10 lines
574 B
Text

record defercall(proc,arglist) # light weight alternative to co-expr for MoB
procedure eval(ref) # evaluator to distinguish between a simple value and a code reference
return if type(ref) == "defercall" then ref.proc!ref.arglist else ref
end
procedure B(k,x1,x2,x3,x4,x5) # Knuth's B
k.value -:= 1 # diddle A's copy of k
return A(k.value, defercall(B,[k,x1,x2,x3,x4,x5]),x1,x2,x3,x4)# call A with a new k and 5 x's
end