Diff
Not logged in

Differences From Artifact [157799e01f30b7fa]:

To Artifact [a9061a338889d74c]:


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