lua-users home
lua-l archive

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


Sebby  <beast@interlinx.qc.ca> wrote:
> 
> Well, that's the main problem. Lua runs it's VM in a recusrive way. 
> Basicly, if you call a Lua, from within a Lua function, the VM will 
> simply call itself recursivly. Now, one solution is to basicly back 
> up the section of the system stack that was used in the task (along 
> with the IP and some other info) and to restore it once the thread is 
> brought back. This is an icky solution since you hav eto go backing 
> up some registers and the system stack of the computer.

Could this be done using `setjmp'?  Some Lisp implementations use it
to follow objects pointed to by the registers for garbage collection
purposes.  Backing up the system stack is also surprisingly simple,
if not "clean".  It might be a workable alternative to making the VM
run iteratively.

-- 
tjaden@psynet.net - http://www.psynet.net/tjaden/
BANDILE (BAN dyl), n.  The thin red strip one pulls to release a Band-Aid.
	-- Rich Hall, "Sniglets"