Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

1 based indices are fine most of the time, they are mostly like 0 based yet start at 1 :) When it does become a problem is when you are reading and using binary formats and offsets, where I seem to always get off by one errors. A ternary function, iff, is soo simple to implement Lua. Scoping is just something you have to understand as with tables there is no problem with them besides a beginners understanding of them.

What you consider a minor gripe, compound assignment operator, I personally think is a flaw in the language same goes for bitwise functions instead of operators. Here is an example I posted earlier on twitter.

object = object + other

"object" and "other" here are full userdata and the code is going to malloc a new userdata and also create a new object in C/C++; which is straight away going to over write the original instance. Huh? why? += makes so much sense.

Each to there own, I can fix my issues using patches but it would be nice if I did not have to.



Might I ask, how would you implement a ternary function that should retain the lazy evaluation quality of the syntactic ternary operator?


I have started just using iterators for stuff that starts at 0.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: