rocks-lang 0.2.2

Rust implementation of Crafting Interpreters' Lox Language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Foo {
  init(arg) {
    print "Foo.init(" + arg + ")";
    this.field = "init";
  }
}

var foo = Foo("one"); // expect: Foo.init(one)
foo.field = "field";

var foo2 = foo.init("two"); // expect: Foo.init(two)
print foo2; // expect: <intance Foo>

// Make sure init() doesn't create a fresh instance.
print foo.field; // expect: init