Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lua/en] Various minor fixes #4992

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions lua.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ eatenBy = myFavs.animal -- works! thanks, metatable
-- An __index value can also be a function(tbl, key)
-- for more customized lookups.

-- Values of __index,add, .. are called metamethods.
-- Full list. Here a is a table with the metamethod.
-- The values of __index, __add, etc are called
-- metamethods. Here's their full list:

-- __add(a, b) for a + b
-- __sub(a, b) for a - b
Expand All @@ -258,7 +258,7 @@ eatenBy = myFavs.animal -- works! thanks, metatable
-- Classes aren't built in; there are different ways
-- to make them using tables and metatables.

-- Explanation for this example is below it.
-- The explanation for this example follows it.

Dog = {} -- 1.

Expand Down Expand Up @@ -332,9 +332,6 @@ end

--[[ I'm commenting out this section so the rest of
-- this script remains runnable.
```

```lua
-- Suppose the file mod.lua looks like this:
local M = {}

Expand Down Expand Up @@ -369,7 +366,13 @@ mod.sayMyName() -- error
-- require's return values are cached so a file is
-- run at most once, even when require'd many times.

-- Suppose mod2.lua contains "print('Hi!')".
-- Suppose another file, mod2.lua, containing this:
print('Hi!')
return function ()
return 'foo'
end

--
local a = require('mod2') -- Prints Hi!
local b = require('mod2') -- Doesn't print; a=b.

Expand Down