We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add class as example
Add
change
class Add def reduce(environment) if left.reducible? Add.new(left.reduce(environment), right) elsif right.reducible? Add.new(left, right.reduce(environment)) else Number.new(left.value + right.value) end end end
to
class Add < Struct.new(:left, :right) def reduce(environment) if left.reducible? left_reduce, environment = left.reduce(environment) [Add.new(left_reduce, right), environment] elsif right.reducible? right_reduce, environment = right.reduce(environment) [Add.new(left, right_reduce), environment] else [Number.new(left.value + right.value), environment] end end end
The text was updated successfully, but these errors were encountered:
here is my small-step code
https://github.com/aQuaYi/computation/tree/master/small_step
Sorry, something went wrong.
No branches or pull requests
Add
class as examplechange
to
The text was updated successfully, but these errors were encountered: