- average =
- # sum_ =
- # product =
- # min_ = max_ = [(((Ns[1], s1), s0), (n0, s0))]
- # flatten = [(((Ss[1], s1), s0), (s2, s0))]
-
- return {
- name.rstrip('_'): stack_effect
- for name, stack_effect in locals().iteritems()
- }
-
-
-FUNCTIONS.update({
- name: SymbolJoyType(name, stack_effect, i)
- for i, (name, stack_effect) in enumerate(defs().iteritems())
- })
-FUNCTIONS.update({
- combo.__name__: CombinatorJoyType(combo.__name__, [combo], i)
- for i, combo in enumerate((
- joy.library.concat_,
- joy.library._dictionary['disenstacken'],
- joy.library.x,
- ))
- })
-
-
-def branch_true(stack, expression, dictionary):
- (then, (else_, (flag, stack))) = stack
- return stack, CONCAT(then, expression), dictionary
-
-def branch_false(stack, expression, dictionary):
- (then, (else_, (flag, stack))) = stack
- return stack, CONCAT(else_, expression), dictionary
-
-FUNCTIONS['branch'] = CombinatorJoyType('branch', [branch_true, branch_false], 100)