Class: Skeem::SkmVariableReference

Inherits:
SkmUnaryExpression show all
Defined in:
lib/skeem/skm_unary_expression.rb

Overview

class

Instance Attribute Summary

Attributes inherited from SkmUnaryExpression

#child

Attributes inherited from SkmElement

#position

Instance Method Summary collapse

Methods inherited from SkmUnaryExpression

#accept, #initialize

Methods inherited from SkmElement

#accept, #boolean?, #bound!, #callable?, #done!, #initialize, #inspect, #integer?, #list?, #null?, #number?, #pair?, #procedure?, #quoted!, #real?, #skm_equal?, #string?, #symbol?, #unquoted!, #vector?, #verbatim?

Constructor Details

This class inherits a constructor from Skeem::SkmUnaryExpression

Instance Method Details

#eqv?(other) ⇒ Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/skeem/skm_unary_expression.rb', line 93

def eqv?(other)
  child == other.child
end

#evaluate(aRuntime) ⇒ Object



97
98
99
100
101
# File 'lib/skeem/skm_unary_expression.rb', line 97

def evaluate(aRuntime)
  var_key = variable.evaluate(aRuntime)
  # $stderr.puts "Variable #{variable.inspect}"
  aRuntime.evaluate(var_key)
end

#quasiquote(aRuntime) ⇒ Object



103
104
105
# File 'lib/skeem/skm_unary_expression.rb', line 103

def quasiquote(aRuntime)
  self
end

#valueObject

Confusing! Value, here, means the value of the identifier (the variable's name).



109
110
111
# File 'lib/skeem/skm_unary_expression.rb', line 109

def value()
  variable.value
end