lua-users home
lua-l archive

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


I have always suspected that there was a mechanism for doing this that I was
missing. How does it work?

> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br
> [mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Luiz Henrique de
> Figueiredo
> Sent: Wednesday, May 23, 2001 11:47 AM
> To: Multiple recipients of list
> Subject: Re: Making vars local by default (completely off topic)
>
>
> >Right, I'm doing something similar to build "components". I can get
> >around it with
> >an explicit return:
> >
> >  return {
> >   "key1" = 25,
> >   "key2" = function (a,b) ... end
> >  }
> >
> >...but that return is a sticking point with the script coders, as it's
> >easy to
> >forget and doesn't make sense in a config file.
>
> How about writing something like
>
>   DATA {
>    "key1" = 25,
>    "key2" = function (a,b) ... end
>   }
>
> where DATA should be a word that is meaningful to your script coders?
>
> Of course, you'll have to code a function named DATA or whatever to do the
> processing, but that's easy...
> --lhf