[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: "Stringizing" a variable name
- From: "simonhaines" <simonhaines@...>
- Date: Fri, 12 Apr 2002 03:34:25 -0000
Thanks for that, I should have remembered that from perl's hash
syntax, which is exactly the decoupling I was after.
Thanks again.
Simon.
--- In lua-l@y..., Tom <tom7ca@y...> wrote:
> You want
>
> for k,v in globals() do
> print(k .. "= " .. type(v))
> end
>
> Note that once the value of the variable has been bound to "i",
> its original name is lost. That's the way almost all programming
> languages work these days (including C++).
>
> --- simonhaines <simonhaines@y...> wrote:
> > I'm trying to find the Lua counterpart for the C++ '#' directive (turn
> > a variable name into a string). Is there one? Such that:
> > g = globals()
> > foreach(g, function(i, v) print( *stringize(i)* .."= "..type(v)))
> >
> > Thanks,
> > Simon
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/