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

Classes need to have tasks also #98

Closed dijs closed 11 years ago

dijs commented 11 years ago

Is this easy to implement?

rzimmerman commented 11 years ago

For some reason I thought this worked already. I'll put it on the list to make sure it does.

rzimmerman commented 11 years ago

I checked - it looks like these are not compiling as expected:

class ABC
  task d()
    return 1

Compiles to

function ABC() {
}

ABC.d = function (k$next) {
  var k$rv;
  try {
    return k$rv = [null, 1], k$next.apply(this, k$rv);
  } catch (k$err) {if (k$next) {return k$next.apply(this,[k$err]);} else {throw k$err;}}
  return k$next ? k$next() : void 0;
}

It should be assigning to ABC.prototype.d.

dijs commented 11 years ago

Yep, thats what I got too.

Should be an easy fix though. :)