Module: Necromancy::Control::Arrow
Instance Method Summary collapse
-
#&(callable) ⇒ Necromancy
A -> (b, b’).
-
#*(callable) ⇒ Necromancy
(a, a’) -> (b, b’).
Methods included from Necromancy::Control
[], call, extended, hiding, new, using
Methods included from Category
Instance Method Details
#&(callable) ⇒ Necromancy
Note:
- self
-
a -> b
Returns a -> (b, b’).
19 20 21 22 23 |
# File 'lib/necromancy/control/arrow.rb', line 19 def &(callable) str = make_evaluable_string(callable) necromancy = "(#{@necromancy}) + (#{str})" self.class.new(necromancy, @references.dup) end |
#*(callable) ⇒ Necromancy
Note:
- self
-
a -> b
Returns (a, a’) -> (b, b’).
33 34 35 36 37 |
# File 'lib/necromancy/control/arrow.rb', line 33 def *(callable) str = make_evaluable_string(callable) necromancy = "stack << [] << args; args = stack[-1][0..-2]; stack[-2].concat((#{@necromancy})); args = [stack[-1][-1]]; stack[-2].concat((#{str})); args = stack.pop; stack.pop" self.class.new(necromancy, @references.dup) end |