Sha256: 0fb435d158a92c410c0db661ab7389f9540963f72994310ae6d6abf26fc3a65f
Contents?: true
Size: 407 Bytes
Versions: 9
Compression:
Stored size: 407 Bytes
Contents
module Kl module Primitives module Lists def cons(a, b) Kl::Cons.new(a, b) end def hd(a) raise Kl::Error, "#{a} is not a list" unless a.kind_of? Kl::Cons a.hd end def tl(a) raise Kl::Error, "#{a} is not a list" unless a.kind_of? Kl::Cons a.tl end def cons?(a) a.kind_of? Kl::Cons end end end end
Version data entries
9 entries across 9 versions & 1 rubygems