Class: Campa::Lisp::Label
- Inherits:
-
Object
- Object
- Campa::Lisp::Label
- Defined in:
- lib/campa/lisp/label.rb
Instance Method Summary collapse
- #call(label, expression, env:) ⇒ Object
-
#initialize ⇒ Label
constructor
A new instance of Label.
- #macro? ⇒ Boolean
Constructor Details
Instance Method Details
#call(label, expression, env:) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/campa/lisp/label.rb', line 13 def call(label, expression, env:) result = evaler.call(expression, env) raise Error::Reserved, printer.call(label) if reserved?(label, result) env[label] = result end |
#macro? ⇒ Boolean
9 10 11 |
# File 'lib/campa/lisp/label.rb', line 9 def macro? true end |