Module: Rus3::EmptyList
- Included in:
- Error, Rus3::Evaluator::Environment, Pair, Procedure::Control, Procedure::List, Procedure::Predicate, Procedure::Vector, Procedure::Write
- Defined in:
- lib/rus3.rb
Overview
An empty list is a special object in Scheme language. The role roughly corresponds to the one of ‘nil’ in Ruby.
Constant Summary collapse
- EMPTY_LIST =
Represents an empty list.
[]
Instance Method Summary collapse
-
#null?(obj) ⇒ Boolean
Returns true if the argument is an empty list.
Instance Method Details
#null?(obj) ⇒ Boolean
Returns true if the argument is an empty list. RuS^3 treats nil (an instance of NilClass) as an empty list.
19 20 21 |
# File 'lib/rus3.rb', line 19 def null?(obj) obj.instance_of?(Array) and obj.empty? end |