Re[2]: executing dostring on 'local' level

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re[2]: executing dostring on 'local' level

Paul Winwood
>dostring runs a chunk. Chunks run in the global level. It'd be hard to have
>them run in a local scope. Why do you want to do this?

One of the reasons that I would like to see dostring execute at the 'local' 
level is during debugging. It would be very useful to able to execute 
some arbitary lua code in a string in the current scope accessing 
and modifying locals. This is the model suggested by the ActiveScript
debugging APIs.

--Paul.


Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: executing dostring on 'local' level

Luiz Henrique de Figueiredo
>One of the reasons that I would like to see dostring execute at the 'local' 
>level is during debugging.

Ah, then it's ok :-)
You could set up get/setglobal tag methods before running the string so that
names are first resolved in the local scope.
ldb probably does something like that.
--lhf