Chervil is a toy Lisp interpreter written in Ruby
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

definition.rb 328B

1234567891011121314151617181920
  1. module Chervil::AST
  2. class Definition
  3. attr_reader :name
  4. attr_reader :value
  5. def initialize(name, value)
  6. @name = name
  7. @value = value
  8. end
  9. def ==(other)
  10. @name == other.name && @value == other.value
  11. end
  12. def evaluate(env)
  13. env.set(@name.name, @value)
  14. nil
  15. end
  16. end
  17. end