Module: Rus3::EmptyList

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

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.

Returns:

  • (Boolean)


19
20
21
# File 'lib/rus3.rb', line 19

def null?(obj)
  obj.instance_of?(Array) and obj.empty?
end