class Dhall::Variable
Public Class Methods
[](name, index=0)
click to toggle source
# File lib/dhall/ast.rb, line 327 def self.[](name, index=0) new(name: name, index: index) end
Public Instance Methods
as_json()
click to toggle source
# File lib/dhall/ast.rb, line 335 def as_json if name == "_" index else [name, index] end end
shift(amount, name, min_index)
click to toggle source
# File lib/dhall/normalize.rb, line 149 def shift(amount, name, min_index) return self if self.name != name || min_index > index raise TypeError, "free variable" if (index + amount).negative? with(index: index + amount) end
substitute(var, with_expr)
click to toggle source
# File lib/dhall/normalize.rb, line 157 def substitute(var, with_expr) self == var ? with_expr : self end
to_s()
click to toggle source
# File lib/dhall/ast.rb, line 331 def to_s "#{name}@#{index}" end