lua-users home
lua-l archive

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



<RLake@oxfam.org.pe> wrote in message
OF80F87D2E.07BB552A-ON05256D4F.005F9EBF@oxfam.org.uk">news:OF80F87D2E.07BB552A-ON05256D4F.005F9EBF@oxfam.org.uk...
> > Unfortunately though, I need to create access to all libraries again in
> that
> > global space don't I?  or at least the libraries I want the user to be
> able
> > to access.
>
> Yep, but I think that is a strength.

Come to think of it, I think that's good too - I can prevent people having
access to those nasty looking "raw" functions too. ;-)


> > What's the overhead for that kind of "setting up" of a variable list?
> (if
> > the objects already exist elsewhere in the system I presume its not that
> > costly)
>
> Depends how you do it. My fave is memoising lazy copy, but it may be
> overkill.
>

Ok, it took me a few seconds to work out what that inject_math = inject
"math" stuff was doing but I've got it now, the stack gets inject, "math",
sandbox then the inject( "math" ) resolves to the function that takes
sandbox as its argument.

A Lua question, why isn't the syntax inject( "math" )( sandbox )... why is
it inject "math"( sandbox )?