aboutsummaryrefslogtreecommitdiffstats
path: root/src/coffee.lox
blob: d83e528b39dc6b30db292a9130d20c06e8380ac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class CoffeeMaker {
  init(coffee) {
    this.coffee = coffee;
  }

  brew() {
    print "Enjoy your cup of " + this.coffee;

    // No reusing the grounds!
    this.coffee = nil;
  }
}

var maker = CoffeeMaker("coffee and chicory");
maker.brew();