Chervil is a toy Lisp interpreter written in Ruby
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

quotation.rb 301B

123456789101112131415161718192021
  1. module Chervil::AST
  2. class Quotation
  3. attr_reader :value
  4. def initialize(value)
  5. @value = value
  6. end
  7. def evaluate(env)
  8. if @value.is_a?(List)
  9. @value.elements
  10. else
  11. @value
  12. end
  13. end
  14. def ==(other)
  15. @value == other.value
  16. end
  17. end
  18. end