Chervil is a toy Lisp interpreter written in Ruby
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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