[CM] (*s7* 'stack)

Woody Douglass wdouglass at carnegierobotics.com
Tue Jun 7 11:15:24 PDT 2022


Very cool, thanks. I'll do some experimentation with this as well

-Woody

On Tue, 2022-06-07 at 11:07 -0700, bil at ccrma.Stanford.EDU wrote:
> In normal use, the s7 evaluator pops off irrelevant entries as it
> calls functions and whatnot, but here everything is happening in C,
> so, as you suggested, I think s7_call_with_catch does need to pop
> the stack if it hasn't already been popped; something like:
> 
> s7.c ca line 50611
> 
>        else
> 	{
> 	  /* we've replaced our jump point, fix it in this catch too */
> 	  catch_cstack(p) = &new_goto_start;
> 	  push_stack(sc, OP_CATCH, error_handler, p);
> 	  result = s7_call(sc, body, sc->nil);
> 	  if (((opcode_t)sc->stack_end[-1]) == OP_CATCH)
> 	    unstack_with(sc, OP_CATCH);
> 	}
>        restore_jump_info(sc);
>      }
>    else
>      {
>        push_stack(sc, OP_CATCH, error_handler, p);
>        result = s7_call(sc, body, sc->nil);
>        if (((opcode_t)sc->stack_end[-1]) == OP_CATCH)
> 	    unstack_with(sc, OP_CATCH);
>      }
> 
> I haven't tested this very much...
> 



More information about the Cmdist mailing list