crafting-interpreters/lox/class_this.lox

11 lines
196 B
Text
Raw Permalink Normal View History

2025-05-26 10:19:18 +02:00
class Cake {
taste() {
var adjective = "delicious";
print "The " + this.flavor + " cake is " + adjective + "!";
}
}
var cake = Cake();
cake.flavor = "German chocolate";
cake.taste();