I am sorry if this Question is Off-Topic in any way, I am just starting this book and it's already showing unfamiliar code I've never seen, and I'm a bit curious about it, the book explains the basic, advancements, and advantages of Lua 5.2, but, again, it is showing pieces of code I am not familiar with, and never seen before, for example, in the book for the first code example, it says io.read reads a number;
function fact(n)
if n == 0 then
return 1
else
return n = fact(n-1)
end
end
print("enter a number!")
a = io.read("*n") -- reads a number
print(fact(a))
It also shows a dofile method, and it explains;
Another way to run chunks is with the 'dofile' function, which immediately executes a file. For instance, suppose you have a file 'lib1.lua' with the following code:
function norm(x,y)
return (x^2 + y^2)^0.5
end
function twice(x)
return 2*x
end
Then, in interactive mode, you can type
dofile("lib1.lua") -- load your library
n = norm(3.4,1.0)
print(twice(n)) -- 7.088018058667
But, non of this code is used in the ROBLOX Lua coding, so I am really puzzled because I've never seen it used before, and it confuses me with the 'lib.lua' file library.

2 comments
So, all these work, but they can only be used in the Official Lua?
Yes, more or less. They are real functions that act more or less how you'd expect. But Roblox removes them because they are unnecessary and open potential security holes.