4 ms·
That is cool, but it's pretty similar in Ruby. def repl loop { puts( eval gets ) } end I guess I just prefer Ruby for general legibility. The sa
by 3pt14159 8y ago
That is cool, but it's pretty similar in Ruby.
def repl
loop { puts( eval gets ) }
end
I guess I just prefer Ruby for general legibility. The same type of bracket everywhere makes pairing them mentally an error-prone chore. At least for yours truly.
- reikonomusha 8y agoThis is actually a very different piece of code. puts and gets are string functions. read and print are code deserializers and serializers. eval is a function that takes a data structure representing code (as deserialized by read) and computes its value as a data structure, and serializes it. While you might get the same effect as a user, the mechanics and metacircularity are lost.
- deleted 8y ago[deleted]