Class: NameUnbindInstruction
- Inherits:
-
Instruction
- Object
- Instruction
- NameUnbindInstruction
- Defined in:
- lib/instructions/name/name_unbind.rb
Overview
Pops the top :name
item, and if it is bound to a name (a local, not a variable) it removes that binding.
needs: 1 :name
pushes: nothing
Instance Attribute Summary
Attributes inherited from Instruction
Instance Method Summary collapse
Methods inherited from Instruction
all_instructions, #go, inherited, #initialize, #needs, #pushes, to_nudgecode
Constructor Details
This class inherits a constructor from Instruction
Instance Method Details
#cleanup ⇒ Object
21 22 23 |
# File 'lib/instructions/name/name_unbind.rb', line 21 def cleanup @context.unbind_name(@lost_name) end |
#derive ⇒ Object
17 18 19 |
# File 'lib/instructions/name/name_unbind.rb', line 17 def derive @lost_name = @arg1.name end |
#preconditions? ⇒ Boolean
9 10 11 |
# File 'lib/instructions/name/name_unbind.rb', line 9 def preconditions? needs :name,1 end |
#setup ⇒ Object
13 14 15 |
# File 'lib/instructions/name/name_unbind.rb', line 13 def setup @arg1 = @context.pop(:name) end |