rzimmerman / kal

A powerful, easy-to-use, and easy-to-read programming language for the future.
http://rzimmerman.github.io/kal
MIT License
394 stars 18 forks source link

add an alias for setTimeout and setInterval #84

Open rzimmerman opened 11 years ago

rzimmerman commented 11 years ago

It would be cool if setInterval worked kind of like a while loop with a conditional.

setTimeout could be something like delay for

cmwelsh commented 11 years ago

I've heard people recommend against setInterval (see the section about stacking calls at JavaScript Garden. Perhaps you could emulate it with setTimeout.

rzimmerman commented 11 years ago

Thanks for the link on setInterval. That makes a lot of sense - we wouldn't want calls to the timer function to queue up while blocked. Something more like NSTimer where more than one call gets dropped would be better. Or just do what the article says and keep calling setTimeout in some intelligent way.