Exception: Fusion::Interpreter::Env::DuplicateBinding

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/fusion/interpreter/env.rb', line 14

def name
  @name
end