Look and think good things about D

Jacob Carlborg doob at me.com
Fri Nov 15 05:13:37 PST 2013


On 2013-11-15 14:07, Chris wrote:

> Slightly OT: Why do languages like Ruby (and now Crystal) have to state
> the obvious in an awkward way?
>
> (2...max).each do

You can do this as well in Ruby:

for e in 2 ... max
end

But Ruby follows the philosophy that everything is an object. So you 
invoke the "each" method on the range object.

> Of course you _do_ _each one_ from 2 to max. Is it to make it more
> "human"? If anything, human languages and thinking get rid of the
> superfluous (i.e. the obvious). Just like
>
> x = x + 1 (Pythronizing)
> x++; (obvious, concise, all you need).

This middle ground is possible in Ruby:

x += 1

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list