13 pop = FUNCTIONS['pop']
15 def loop_true(stack, expression, dictionary):
16 quote, (flag, stack) = stack
17 return stack, CONCAT(quote, (pop, expression)), dictionary
19 def loop_two_true(stack, expression, dictionary):
20 quote, (flag, stack) = stack
21 return stack, CONCAT(quote, (pop, CONCAT(quote, (pop, expression)))), dictionary
23 def loop_false(stack, expression, dictionary):
24 quote, (flag, stack) = stack
25 return stack, expression, dictionary
27 FUNCTIONS['loop'] = CombinatorJoyType('loop', [loop_two_true, loop_true, loop_false], 101)
40 # joy.library.add_aliases(FUNCTIONS, joy.library.ALIASES)
43 # def set_expectations_of_definition(cjt):
44 # if len(cjt.stack_effects) != 1:
46 # defi = cjt.stack_effects[0]
47 # if not isinstance(defi, joy.library.DefinitionWrapper):
49 # F = infer_expression(defi.body)
50 # assert len(F) == 1, repr(F)
58 loop.expect = s6, (b1, s5)
59 disenstacken.expect = (As[1], s1), s0
60 joy.library._dictionary['disenstacken'],
63 # scope = globals().copy()
64 # scope.update(FUNCTIONS)
65 # eval(set_expectations.func_code, scope)