August 2008
1 post
Simple Ruby
Let’s take a look at this trivial Ruby example:
[1, 2, 3, 4].each { |i| puts i }
The first thing we notice is that the commas shouldn’t be necessary:
[1 2 3 4].each { |i| puts i }
We can also go Smalltalk style and remove the dot. Many languages do that,
including the minimalist Io, so here we go:
[1 2 3 4] each { |i| puts i }
It’s shorter already, but now let’s...