Class: Clojure::Namespace

Inherits:
Hash
  • Object
show all
Defined in:
lib/clojure/namespace.rb

Constant Summary collapse

SPECIAL =

calls with postponed evaluation of expression

%w[ns fn defn def quote let for].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runtime) ⇒ Namespace

rubocop:disable Lint/MissingSuper



8
9
10
# File 'lib/clojure/namespace.rb', line 8

def initialize(runtime)
  @runtime = runtime
end

Instance Attribute Details

#runtimeObject (readonly)

rubocop:enable Lint/MissingSuper



13
14
15
# File 'lib/clojure/namespace.rb', line 13

def runtime
  @runtime
end

Instance Method Details

#evaluate(form) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/clojure/namespace.rb', line 18

def evaluate(form)
  case form
  when Array
    form_eval form
  when String
    resolve form
  else
    form
  end
end