A toy dynamic programming language written in Ruby
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

hash.rb 274B

12345678910111213141516171819
  1. class AST::Hash
  2. attr_reader :data
  3. def initialize(data)
  4. @data = data
  5. end
  6. def ==(other)
  7. other.is_a?(AST::Hash) && other.data == @data
  8. end
  9. def execute(env)
  10. result = Hash.new
  11. @data.each { |k, v| result[k] = v.execute(env) }
  12. result
  13. end
  14. end