Diff
Not logged in

Differences From Artifact [157799e01f30b7fa]:

To Artifact [a9061a338889d74c]:


1 def reverse(lst, acc) 1 def reverse(lst, acc) 2 { 2 { 3 case(lst) 3 case(lst) 4 when( {car:a, cdr: d} ) { reverse(d, {car:a, cdr:acc}) } | 4 when {car:a, cdr: d}: reverse(d, {car:a, cdr:acc}) 5 when( {} ) { acc } | 5 when {}: acc 6 }; 6 }; 7 7 8 @macro reverseArgs(e) {@value( 8 @macro reverseArgs(e) {@value( 9 var ev = @macro(e); 9 var ev = @macro(e); 10 case(ev) 10 case(ev) 11 when( {is:"App", fun:f, args:a} ) | 11 when {is:"App", fun:f, args:a}: 12 { < > 12 ( 13 ev {args: reverse(a, {})} 13 ev {args: reverse(a, {})} 14 } < > 14 ) 15 when( _ ) | 15 when _ : 16 { < > 16 ( 17 ev 17 ev 18 } < > 18 ) 19 )}; 19 )}; 20 20 21 def main() 21 def main() 22 { 22 { 23 print( reverseArgs(1 + 2) ); 23 print( reverseArgs(1 + 2) ); 24 print( reverseArgs(1 - 2) ); 24 print( reverseArgs(1 - 2) ); 25 }; 25 }; 26 26 27 main() 27 main()