optimizing invocations
This commit is contained in:
17
samples/ch28_optimized_invocation.lox
Normal file
17
samples/ch28_optimized_invocation.lox
Normal file
@ -0,0 +1,17 @@
|
||||
class Oops {
|
||||
init() {
|
||||
fun f() {
|
||||
print "not a method";
|
||||
return "returned value from f";
|
||||
}
|
||||
this.field = f;
|
||||
}
|
||||
|
||||
blah() {
|
||||
return "returned value from blah";
|
||||
}
|
||||
}
|
||||
|
||||
var oops = Oops();
|
||||
print oops.field();
|
||||
print oops.blah();
|
Reference in New Issue
Block a user