Class: NilClass

Inherits:
Object show all
Defined in:
lib/rubylisp/ext.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



87
88
89
90
91
92
93
# File 'lib/rubylisp/ext.rb', line 87

def method_missing(name, *args, &block)
  if name[0] == ?c && name[-1] == ?r && (name[1..-2].chars.all? {|e| "ad".include?(e)})
    nil
  else
    super
  end
end

Instance Method Details

#carObject



35
36
37
# File 'lib/rubylisp/ext.rb', line 35

def car
  nil
end

#cdrObject



39
40
41
# File 'lib/rubylisp/ext.rb', line 39

def cdr
  nil
end

#empty?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/rubylisp/ext.rb', line 55

def empty?
  true
end

#eq?(other) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rubylisp/ext.rb', line 15

def eq?(other)
  other.nil?
end

#evaluate(env) ⇒ Object



27
28
29
# File 'lib/rubylisp/ext.rb', line 27

def evaluate(env)
  nil
end

#evaluate_each(env) ⇒ Object



31
32
33
# File 'lib/rubylisp/ext.rb', line 31

def evaluate_each(env)
  nil
end

#false?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/rubylisp/ext.rb', line 7

def false?
  true
end

#function?Boolean

Returns:

  • (Boolean)


99
100
101
# File 'lib/rubylisp/ext.rb', line 99

def function?
  false
end

#lengthObject



59
60
61
# File 'lib/rubylisp/ext.rb', line 59

def length
  0
end

#lisp_object?Boolean

Returns:

  • (Boolean)


111
112
113
# File 'lib/rubylisp/ext.rb', line 111

def lisp_object?
  true
end

#list?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/rubylisp/ext.rb', line 83

def list?
  true
end

#number?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/rubylisp/ext.rb', line 71

def number?
  false
end

#object?Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/rubylisp/ext.rb', line 103

def object?
  false
end

#pair?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/rubylisp/ext.rb', line 79

def pair?
  false
end

#primitive?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/rubylisp/ext.rb', line 95

def primitive?
  false
end


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

def print_string
  self.to_s
end


23
24
25
# File 'lib/rubylisp/ext.rb', line 23

def print_string_helper
  ""
end

#quotedObject



51
52
53
# File 'lib/rubylisp/ext.rb', line 51

def quoted
  nil
end

#set_car!(s) ⇒ Object



43
44
45
# File 'lib/rubylisp/ext.rb', line 43

def set_car!(s)
  nil
end

#set_cdr!(s) ⇒ Object



47
48
49
# File 'lib/rubylisp/ext.rb', line 47

def set_cdr!(s)
  nil
end

#string?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/rubylisp/ext.rb', line 67

def string?
  false
end

#symbol?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/rubylisp/ext.rb', line 75

def symbol?
  false
end

#to_sObject



11
12
13
# File 'lib/rubylisp/ext.rb', line 11

def to_s
  "()"
end

#true?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/rubylisp/ext.rb', line 3

def true?
  false
end

#typeObject



107
108
109
# File 'lib/rubylisp/ext.rb', line 107

def type
  :nil
end

#valueObject



63
64
65
# File 'lib/rubylisp/ext.rb', line 63

def value
  nil
end