Class: Heist::Scheme::QuotedCell

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/heist/parser/nodes.rb

Overview

QuotedCell are generated using the quoting shorthands.

Instance Method Summary collapse

Instance Method Details

#evalObject

Evaluating a QuotedCell produces a Cons that expresses a function call to the appropriate quoting function, with the cell as the argument.



73
74
75
76
77
# File 'lib/heist/parser/nodes.rb', line 73

def eval
  quote = elements[1].text_value
  cell  = elements[2].eval
  Runtime::Cons.construct([Runtime::Identifier.new(SHORTHANDS[quote]), cell])
end