lua-users home
lua-l archive

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

----- Original Message ----- 
From: Erik Hougaard <>
To: Multiple recipients of list <>
Sent: Monday, September 11, 2000 5:37 PM
Subject: Re: Locals in global namespace

> ----- Original Message -----
> > I'm just implementing some logic around local variables in jlua, and
> > discovered
> > that local variables can be declared in the global namescape in lua. Is
> this
> > by design or by coincidence?
> Yes you can define a global variable inside a function. Variables without
> 'local' are automatic global :-)

Of course... I'm afraid you missed my point entirely. What I refer to is
using local declarations in the global namespace, i.e. a program
only consisting of "local x" (no functions, no nothing).

> /Erik


  Magnus Lie Hetland      (magnus at hetland dot org)

 "Reality is what refuses to disappear when you stop
  believing in it"                 -- Philip K. Dick