mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 10:01:38 +00:00
lua: typo
`LoudDog.__index` is `Dog`, not `LoudDog`.
This commit is contained in:
parent
a44935283a
commit
f70b1edcfb
@ -321,7 +321,7 @@ seymour:makeSound() -- 'woof woof woof' -- 4.
|
|||||||
-- Dog.new(LoudDog) as LoudDog has no 'new' key,
|
-- Dog.new(LoudDog) as LoudDog has no 'new' key,
|
||||||
-- but does have __index = Dog on its metatable.
|
-- but does have __index = Dog on its metatable.
|
||||||
-- Result: seymour's metatable is LoudDog, and
|
-- Result: seymour's metatable is LoudDog, and
|
||||||
-- LoudDog.__index = LoudDog. So seymour.key will
|
-- LoudDog.__index = Dog. So seymour.key will
|
||||||
-- = seymour.key, LoudDog.key, Dog.key, whichever
|
-- = seymour.key, LoudDog.key, Dog.key, whichever
|
||||||
-- table is the first with the given key.
|
-- table is the first with the given key.
|
||||||
-- 4. The 'makeSound' key is found in LoudDog; this
|
-- 4. The 'makeSound' key is found in LoudDog; this
|
||||||
|
Loading…
Reference in New Issue
Block a user