Diff
Not logged in

Differences From Artifact [99466484fdc29835]:

To Artifact [fe180b545227dcde]:


19 if x<y then y else x 19 if x<y then y else x 20 }; 20 }; 21 @macro maxGreat(x,y){@value( 21 @macro maxGreat(x,y){@value( 22 var nx = gensym(); # generate fresh symbol 22 var nx = gensym(); # generate fresh symbol 23 var ny = gensym(); 23 var ny = gensym(); 24 @macro _x = @macro(nx) {name: nx}; # cheating to create {is:"Var" .. } 24 @macro _x = @macro(nx) {name: nx}; # cheating to create {is:"Var" .. } 25 @macro _y = @macro(ny) {name: ny}; # at macro layer 25 @macro _y = @macro(ny) {name: ny}; # at macro layer 26 {is: "Let", name: nx, layer: "", init: @macro(x), expr: | 26 {is: "Let", name: nx, layer: "", vdef: @macro(x), expr: 27 {is: "Let", name: ny, layer: "", init: @macro(y), expr: | 27 {is: "Let", name: ny, layer: "", vdef: @macro(y), expr: 28 @macro(if _x < _y then _y else _x)}} # the expression 28 @macro(if _x < _y then _y else _x)}} # the expression 29 )}; 29 )}; 30 30 31 print( maxGood(print(1), print(2)) ); # 1 2 2 31 print( maxGood(print(1), print(2)) ); # 1 2 2 32 print( maxBad(print(1), print(2)) ); # 1 2 2 2 32 print( maxBad(print(1), print(2)) ); # 1 2 2 2 33 print( maxFun(print(1), print(2)) ); # 1 2 2 33 print( maxFun(print(1), print(2)) ); # 1 2 2 34 print( maxGreat(print(1), print(2)) ); # 1 2 2 34 print( maxGreat(print(1), print(2)) ); # 1 2 2