implement chapter 13 in rust!
This commit is contained in:
parent
621c97102a
commit
32e5e8a41a
23 changed files with 318 additions and 19 deletions
14
lox/super_call.lox
Normal file
14
lox/super_call.lox
Normal file
|
@ -0,0 +1,14 @@
|
|||
class Doughnut {
|
||||
cook() {
|
||||
print "Fry until golden brown.";
|
||||
}
|
||||
}
|
||||
|
||||
class BostonCream < Doughnut {
|
||||
cook() {
|
||||
super.cook();
|
||||
print "Pipe full of custard and coat with chocolate.";
|
||||
}
|
||||
}
|
||||
|
||||
BostonCream().cook();
|
Loading…
Add table
Add a link
Reference in a new issue