class Pione::Lang::Variable
Variable
is a model for variable name objects that have name string and package id. We use this for getting its value from variable table in the environment.
@note Be careful variable are not treated as a sequence, because sequence
is a concept of elements joined by sequencial operators and the receivers should be evaluated.
Public Instance Methods
<=>(other)
click to toggle source
Compare with other variable.
# File lib/pione/lang/variable.rb, line 40 def <=>(other) raise ArgumentError.new(other) unless other.kind_of?(self.class) name <=> other.name end
element_type(env)
click to toggle source
# File lib/pione/lang/variable.rb, line 22 def element_type(env) env.variable_get(self).element_type(env) end
eval(env)
click to toggle source
Get the value from variable table in the environment.
# File lib/pione/lang/variable.rb, line 27 def eval(env) env.variable_get(self) end
eval!(env)
click to toggle source
# File lib/pione/lang/variable.rb, line 31 def eval!(env) eval(env).eval!(env) end
index_type(env)
click to toggle source
# File lib/pione/lang/variable.rb, line 18 def index_type(env) env.variable_get(self).index_type(env) end
pione_type(env)
click to toggle source
# File lib/pione/lang/variable.rb, line 14 def pione_type(env) env.variable_get(self).pione_type(env) end
textize()
click to toggle source
# File lib/pione/lang/variable.rb, line 35 def textize ("$%s" % name) + (package_id ? "@%s" % package_id : "") end