lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


----- Original Message -----
> > print = 3
> > print(3)
> error: attempt to call global `print' (a number value)
> stack traceback:
>    1:  main of string "print(3)" at line 1
> >
>
>     What do you say about that? ;-)

Working as designed :-)

"print" is a (c)function. Function as also values in Lua. So you can
redefine function names and remove functions (as you did, since now there
are no references to "print").

This is also valid code:

>DoNotPrint=print
>print=nil
>DoNotPrint(3)
3

/Erik