OSDN Git Service

Uncomment ifte built-in.
authorSimon Forman <sforman@hushmail.com>
Fri, 24 Dec 2021 03:12:54 +0000 (19:12 -0800)
committerSimon Forman <sforman@hushmail.com>
Fri, 24 Dec 2021 03:12:54 +0000 (19:12 -0800)
joy/library.py

index 93455ab..61e1e45 100644 (file)
@@ -1007,32 +1007,32 @@ def branch(stack, expression, dictionary):
     return stack, concat(then if flag else else_, expression), dictionary
 
 
-##@inscribe
-##@FunctionWrapper
-##def ifte(stack, expression, dictionary):
-##  '''
-##  If-Then-Else Combinator
-##  ::
-##
-##                  ... [if] [then] [else] ifte
-##       ---------------------------------------------------
-##          ... [[else] [then]] [...] [if] infra select i
-##
-##
-##
-##
-##                ... [if] [then] [else] ifte
-##       -------------------------------------------------------
-##          ... [else] [then] [...] [if] infra first choice i
-##
-##
-##  Has the effect of grabbing a copy of the stack on which to run the
-##  if-part using infra.
-##  '''
-##  (else_, (then, (if_, stack))) = stack
-##  expression = (S_infra, (S_first, (S_choice, (S_i, expression))))
-##  stack = (if_, (stack, (then, (else_, stack))))
-##  return stack, expression, dictionary
+@inscribe
+@FunctionWrapper
+def ifte(stack, expression, dictionary):
+  '''
+  If-Then-Else Combinator
+  ::
+
+                  ... [if] [then] [else] ifte
+       ---------------------------------------------------
+          ... [[else] [then]] [...] [if] infra select i
+
+
+
+
+                ... [if] [then] [else] ifte
+       -------------------------------------------------------
+          ... [else] [then] [...] [if] infra first choice i
+
+
+  Has the effect of grabbing a copy of the stack on which to run the
+  if-part using infra.
+  '''
+  (else_, (then, (if_, stack))) = stack
+  expression = (S_infra, (S_first, (S_choice, (S_i, expression))))
+  stack = (if_, (stack, (then, (else_, stack))))
+  return stack, expression, dictionary
 
 
 @inscribe