Deirdre Saoirse Moen

Sounds Like Weird


17 June 2005

Proving that the Pascal part of my soul is not dead (merely resting), I was quite heartened to see that Ruby permitted the following syntax:

for i in 0..255

I miss Pascal’s syntax. I rather liked that you could start at any arbitrary number and end at any arbitrary number, inclusive — especially handy for arrays of things.

Ruby also adds the three dots syntax to exclude the last number: 0..255 = 0…256.

Related Posts