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



109
110
111
112
113
114
115
116
117
118
# File 'lib/rubylisp/ext.rb', line 109

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

Instance Method Details

#carObject



49
50
51
# File 'lib/rubylisp/ext.rb', line 49

def car
  nil
end

#cdrObject



53
54
55
# File 'lib/rubylisp/ext.rb', line 53

def cdr
  nil
end

#empty?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/rubylisp/ext.rb', line 69

def empty?
  true
end

#environment?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/rubylisp/ext.rb', line 105

def environment?
  false
end

#eq?(other) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rubylisp/ext.rb', line 25

def eq?(other)
  other.nil? || (other.pair? && other.empty?)
end

#equal?(other) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rubylisp/ext.rb', line 29

def equal?(other)
  other.nil? || (other.pair? && other.empty?)
end

#eqv?(other) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rubylisp/ext.rb', line 21

def eqv?(other)
  other.nil? || (other.pair? && other.empty?)
end

#evaluate(env) ⇒ Object



41
42
43
# File 'lib/rubylisp/ext.rb', line 41

def evaluate(env)
  nil
end

#evaluate_each(env) ⇒ Object



45
46
47
# File 'lib/rubylisp/ext.rb', line 45

def evaluate_each(env)
  nil
end

#false?Boolean

Returns:

  • (Boolean)


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

def false?
  false
end

#flattenObject



140
141
142
# File 'lib/rubylisp/ext.rb', line 140

def flatten
  nil
end

#function?Boolean

Returns:

  • (Boolean)


124
125
126
# File 'lib/rubylisp/ext.rb', line 124

def function?
  false
end

#lengthObject



73
74
75
# File 'lib/rubylisp/ext.rb', line 73

def length
  0
end

#lisp_object?Boolean

Returns:

  • (Boolean)


136
137
138
# File 'lib/rubylisp/ext.rb', line 136

def lisp_object?
  true
end

#list?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/rubylisp/ext.rb', line 97

def list?
  true
end

#number?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/rubylisp/ext.rb', line 85

def number?
  false
end

#object?Boolean

Returns:

  • (Boolean)


128
129
130
# File 'lib/rubylisp/ext.rb', line 128

def object?
  false
end

#pair?Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/rubylisp/ext.rb', line 93

def pair?
  false
end

#primitive?Boolean

Returns:

  • (Boolean)


120
121
122
# File 'lib/rubylisp/ext.rb', line 120

def primitive?
  false
end


33
34
35
# File 'lib/rubylisp/ext.rb', line 33

def print_string
  self.to_s
end


37
38
39
# File 'lib/rubylisp/ext.rb', line 37

def print_string_helper
  ""
end

#quotedObject



65
66
67
# File 'lib/rubylisp/ext.rb', line 65

def quoted
  nil
end

#set_car!(s) ⇒ Object



57
58
59
# File 'lib/rubylisp/ext.rb', line 57

def set_car!(s)
  nil
end

#set_cdr!(s) ⇒ Object



61
62
63
# File 'lib/rubylisp/ext.rb', line 61

def set_cdr!(s)
  nil
end

#string?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/rubylisp/ext.rb', line 81

def string?
  false
end

#symbol?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/rubylisp/ext.rb', line 89

def symbol?
  false
end

#to_aryObject



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

def to_ary
  []
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



132
133
134
# File 'lib/rubylisp/ext.rb', line 132

def type
  :nil
end

#valueObject



77
78
79
# File 'lib/rubylisp/ext.rb', line 77

def value
  nil
end

#vector?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/rubylisp/ext.rb', line 101

def vector?
  false
end