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

simplified callback syntax #11

Closed rzimmerman closed 11 years ago

rzimmerman commented 11 years ago

Something like:

name = "Steve"
db.findByName name yields user
console.log user.id

Instead of:

name = "Steve"
db.findByName name, (err, user) ->
  return err if err
  console.log user.id
rzimmerman commented 11 years ago

The yield branch is tracking this feature.

rzimmerman commented 11 years ago

Merged in yield branch at 00c490fb1b2ca3d7437ef982b56ad33d79486d0f

This supports (possibly buggy) the following syntax:

wait for x from slowIoFunction()

for:

But not loops yet

rzimmerman commented 11 years ago

Merged in all changes, passing tests. Any further fixes should be logged as new issues (bugs): 1db530a6ecb83e17ccac88b33ea535f1d9c95174