Jon Rowe write
> The gist is as follows. Move the stack into a list "thestack". Then one by one
> put things from this list back on to the stack. At each stage, try running p.
> If it throws a STACK EMPTY mishap, then you need to try more arguments. If
> not, then you've done it.
But what if the procedure p uses stacklength to detemine what to do?
I had thought of copying the stack runing p and then looking at what had changed
to find out what the results of p are. This works but is inefficent because who
knows how big the stack is and p might be something like
define silly();
lvars len;
stacklength() -> len;
unless len=0 then
not(subscr_stack(len)) -> subscr_stack(len);
endunless;
enddefine;
Anthony.Worrall@Reading.ac.uk
|