Ahh... that makes sense. I'm a bit like that with C and Python.
BTW, these examples give identical results in Python except for 'a[-99]' which raises an IndexError exception. I can see advantages to both approaches and both are better than a program crash!
Perhaps I am missing something - why does that make you sigh longingly. Is it the banality of the example?
ReplyDeleteNo, that's not the case at all.
ReplyDeleteComing from a C#/Java/C background, I'm trying to highlight features I've discovered in Ruby that make me long for it.
Ahh... that makes sense. I'm a bit like that with C and Python.
ReplyDeleteBTW, these examples give identical results in Python except for 'a[-99]' which raises an IndexError exception. I can see advantages to both approaches and both are better than a program crash!