lua-users home
lua-l archive

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


Title: RE: Implementing read only tables using C API

Um.  Yeah, I suppose I could actually.  But (and I'm only making excuses here), it would be another file to add to the distribution (which at the moment is just an exe).  But that is a bit lame :)

 
> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br
> [mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of David Haley
> Sent: 16 June 2006 17:15
> To: Lua list
> Subject: Re: Implementing read only tables using C API
>
>
>
> Hi Tom,
>
> On this day of 6-16-2006 8:49 AM, Tom Miles saw fit to scribe:
> >
> > The reason I am doing this is to create a Lua script
> environment for
> > some end users.  The point of the exercise is to create a
> simplistic
> > environment in which they can write small lua script functions to
> > perform operations on C objects.  I could just cut and
> paste some Lua
> > code to do the job, but then every script that gets written
> (and there
> > are going to be lots) would need to import a library
> script.  I'm not
> > keen on that approach if it can be avoided.
> >
>
> Could you not load the script yourself (via a loadstring or
> dobuffer or
> similar) when you create the Lua_State from the C API? That
> way, it is
> imported, but the end-users don't have to worry about it. I
> don't know
> if it's the most elegant solution or the "Lua Way" of doing
> things, but
> I had a similar problem as you and this is how I solved it.
>
> Best,
> - David
>
> --
> ~David-Haley
> http://david.the-haleys.org
>
>
>