• R/O
  • HTTP
  • SSH
  • HTTPS

Thun: Commit

Interpreter and library.


Commit MetaInfo

Révision0a76eea3e27ce5ce458670bd3467f5db55822271 (tree)
l'heure2021-12-24 12:12:54
AuteurSimon Forman <sforman@hush...>
CommiterSimon Forman

Message de Log

Uncomment ifte built-in.

Change Summary

Modification

--- a/joy/library.py
+++ b/joy/library.py
@@ -1007,32 +1007,32 @@ def branch(stack, expression, dictionary):
10071007 return stack, concat(then if flag else else_, expression), dictionary
10081008
10091009
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
10361036
10371037
10381038 @inscribe
Afficher sur ancien navigateur de dépôt.