Class: Rucas::Symbolic::ConstExpr

Inherits:
Struct
  • Object
show all
Includes:
Expr
Defined in:
lib/rucas/symbolic.rb,
lib/rucas/rewrite.rb,
lib/rucas/symbolic.rb

Overview

Numeric constant.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Expr

#children, make, #precedence, #rewrite, #simplify, #to_s_paren

Instance Attribute Details

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



46
47
48
# File 'lib/rucas/symbolic.rb', line 46

def value
  @value
end

Instance Method Details

#constant?Boolean

Returns:

  • (Boolean)


51
# File 'lib/rucas/symbolic.rb', line 51

def constant?; true end

#match(expr, bindings = {}) ⇒ Object



90
91
92
93
# File 'lib/rucas/rewrite.rb', line 90

def match expr, bindings = {}
  return bindings if self == expr
  return nil
end

#to_sObject



50
# File 'lib/rucas/symbolic.rb', line 50

def to_s; value.to_s end

#with(bindings) ⇒ Object



95
96
97
# File 'lib/rucas/rewrite.rb', line 95

def with bindings
  self
end