David L Reece <ug29dlr@cs.bham.ac.uk> writes:
> Date: Mon, 27 Mar 2000 13:40:48 +0100
> I have written a procedure that generates successor states of the
> 8-puzzle. It works fine, but when there are more than 2 successor
> states, pop-11 prints the result in the output.p window (which I didn't
> want) and places the result in a vector (also what I didn't want). Below
> is a typical example (Note: the numbers here are not important):
>
> ** {[[[1 0 3 4 2 5 6 7 8]
> [1 2 3 0 4 5 6 7 8]
> [1 2 3 4 5 0 6 7 8]
> [1 2 3 4 7 5 6 0 8]]]}
Assuming that you were running your program in Ved/Xved this sort of
thing is usually a sign that one of your procedures is sometimes
leaving something on the stack.
That could be because a procedure returns a result and the
calling procedure fails to use it.
It could be because some lvars or vars delcaration has a semi-colon
instead of a colon, and you did not get a DECLARING VARIABLE warning
message because you already had a global variable of the same name.
It could be because you somewhere accidentally gave a procedure more
arguments than it actually uses.
There are many other possible causes: one of the dangers of the
"open stack" (See TEACH STACK, or chapter 3 of the Primer.)
You can use "trace" to find out what your procedures are leaving on
the stack. See TEACH TRACE, HELP TRACE
Aaron
[Posting from sussex as a test.]
>
> How can I stop this? I didn't want to waste space and time posting the
> whole procedure (about 80 lines), but why does it do this?
>
> Any help will be gratefully recieved.
>
> Yours,
>
> Dave Reece (1st year, CS&AI)
|