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

New "for loop" features #119

Closed dijs closed 11 years ago

dijs commented 11 years ago

I kept hating the fact that I had to define an old school while loop:

i = 0
while i <= 3
   log i
   i += 1

So, instead I created another statement which helps with this:

for i in 0 to 3
   log i

I know it doesn't save a lot of code or anything, but it just seemed more readable and easier to write.

Also, I was having a hard time understanding the grammar and generator (since I am new to these kind of projects) so my code might not be totally correct. Definitely might need some refactoring...