Why print(print()) not work like print(type(2)) in Lua?

Viewed 186

I have been messing with Lua for a couple of days and I have figured out some things that made me think twice. I have not yet read the reference manual Lua 5.3 because it seems to complicated , I will soon check on it.

Ok in lua 5.3 , we know print() returns back nil and prints a space.

>print(print(print()))

                        --this prints three spaces 
                        --but print() returns nil so print(nil) should
                        --print nil. But instead it is printing 3 spaces


>print(type(2))  
number                  --this prints a number since type(2) returns a 
                        --number , but this doesn't work with print(print()) 
                        --why?
1 Answers
Related