Module: Klam::Primitives::Lists
- Defined in:
- lib/klam/primitives/lists.rb
Constant Summary collapse
- EMPTY_LIST =
nil
Instance Method Summary collapse
Instance Method Details
#cons(head, tail) ⇒ Object
6 7 8 |
# File 'lib/klam/primitives/lists.rb', line 6 def cons(head, tail) ::Klam::Cons.new(head, tail) end |
#cons?(l) ⇒ Boolean
18 19 20 |
# File 'lib/klam/primitives/lists.rb', line 18 def cons?(l) l.instance_of?(::Klam::Cons) end |
#hd(l) ⇒ Object
10 11 12 |
# File 'lib/klam/primitives/lists.rb', line 10 def hd(l) l.hd end |
#tl(l) ⇒ Object
14 15 16 |
# File 'lib/klam/primitives/lists.rb', line 14 def tl(l) l.tl end |