Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/fr/thunk.rb,
lib/fr/object.rb
List Constructors collapse
-
#cons(tail = []) ⇒ Array
Prepend the item to the front of a new list.
-
#snoc(init = []) ⇒ Array
Append the item to rear of a new list.
Combinators collapse
-
#bind {|_self| ... } ⇒ Object
Yields ‘self` to a block argument.
Instance Method Summary collapse
Instance Method Details
#bind {|_self| ... } ⇒ Object
Yields ‘self` to a block argument
39 40 41 |
# File 'lib/fr/object.rb', line 39 def bind yield self end |
#cons(tail = []) ⇒ Array
Prepend the item to the front of a new list
14 15 16 |
# File 'lib/fr/object.rb', line 14 def cons(tail = []) [self] + tail end |
#snoc(init = []) ⇒ Array
Append the item to rear of a new list
26 27 28 |
# File 'lib/fr/object.rb', line 26 def snoc(init = []) init + [self] end |
#thunk? ⇒ Boolean
70 71 72 |
# File 'lib/fr/thunk.rb', line 70 def thunk? false end |