[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Creating global variables using reserved words
- From: erik@... (Erik Hougaard)
- Date: Tue, 12 Mar 2002 23:23:57 +0100
----- 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