Interpreter and library.
Révision | 0a76eea3e27ce5ce458670bd3467f5db55822271 (tree) |
---|---|
l'heure | 2021-12-24 12:12:54 |
Auteur | ![]() |
Commiter | Simon Forman |
Uncomment ifte built-in.
@@ -1007,32 +1007,32 @@ def branch(stack, expression, dictionary): | ||
1007 | 1007 | return stack, concat(then if flag else else_, expression), dictionary |
1008 | 1008 | |
1009 | 1009 | |
1010 | -##@inscribe | |
1011 | -##@FunctionWrapper | |
1012 | -##def ifte(stack, expression, dictionary): | |
1013 | -## ''' | |
1014 | -## If-Then-Else Combinator | |
1015 | -## :: | |
1016 | -## | |
1017 | -## ... [if] [then] [else] ifte | |
1018 | -## --------------------------------------------------- | |
1019 | -## ... [[else] [then]] [...] [if] infra select i | |
1020 | -## | |
1021 | -## | |
1022 | -## | |
1023 | -## | |
1024 | -## ... [if] [then] [else] ifte | |
1025 | -## ------------------------------------------------------- | |
1026 | -## ... [else] [then] [...] [if] infra first choice i | |
1027 | -## | |
1028 | -## | |
1029 | -## Has the effect of grabbing a copy of the stack on which to run the | |
1030 | -## if-part using infra. | |
1031 | -## ''' | |
1032 | -## (else_, (then, (if_, stack))) = stack | |
1033 | -## expression = (S_infra, (S_first, (S_choice, (S_i, expression)))) | |
1034 | -## stack = (if_, (stack, (then, (else_, stack)))) | |
1035 | -## return stack, expression, dictionary | |
1010 | +@inscribe | |
1011 | +@FunctionWrapper | |
1012 | +def ifte(stack, expression, dictionary): | |
1013 | + ''' | |
1014 | + If-Then-Else Combinator | |
1015 | + :: | |
1016 | + | |
1017 | + ... [if] [then] [else] ifte | |
1018 | + --------------------------------------------------- | |
1019 | + ... [[else] [then]] [...] [if] infra select i | |
1020 | + | |
1021 | + | |
1022 | + | |
1023 | + | |
1024 | + ... [if] [then] [else] ifte | |
1025 | + ------------------------------------------------------- | |
1026 | + ... [else] [then] [...] [if] infra first choice i | |
1027 | + | |
1028 | + | |
1029 | + Has the effect of grabbing a copy of the stack on which to run the | |
1030 | + if-part using infra. | |
1031 | + ''' | |
1032 | + (else_, (then, (if_, stack))) = stack | |
1033 | + expression = (S_infra, (S_first, (S_choice, (S_i, expression)))) | |
1034 | + stack = (if_, (stack, (then, (else_, stack)))) | |
1035 | + return stack, expression, dictionary | |
1036 | 1036 | |
1037 | 1037 | |
1038 | 1038 | @inscribe |