Exception: Fusion::Interpreter::Env::DuplicateBinding
- Inherits:
-
StandardError
- Object
- StandardError
- Fusion::Interpreter::Env::DuplicateBinding
- Defined in:
- lib/fusion/interpreter/env.rb
Overview
Raised by #bind when a name is already bound in this env’s own scope —i.e. a duplicate pattern binder like ‘[a, a]`. Interpreter#apply catches it and reports a binding_error (see docs/user/reference.md §6.5).
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ DuplicateBinding
constructor
A new instance of DuplicateBinding.
Constructor Details
#initialize(name) ⇒ DuplicateBinding
Returns a new instance of DuplicateBinding.
16 17 18 19 |
# File 'lib/fusion/interpreter/env.rb', line 16 def initialize(name) @name = name super("identifier already bound: #{name}") end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/fusion/interpreter/env.rb', line 14 def name @name end |