+: expand-if ( exp -- res )
+ if-symbol 2swap
+
+ 2dup if-predicate expand
+ 2swap 2dup if-consequent expand
+ 2swap if-alternative none? if
+ 2drop nil
+ else
+ nil cons
+ then
+
+ cons cons cons ;
+
+: expand-begin ( exp -- res )
+ begin-symbol 2swap
+ begin-actions expand-list
+
+ cons ;
+
+: expand-application ( exp -- res )
+ 2dup operator
+ 2swap operands expand-list
+
+ cons ;
+