Re: [CM] fn defined in C returns to wrong place

2022-08-26 Thread bil
I think where you call s7_read, you want to wrap that in a catch, probably using s7_call_with_catch. There are examples of it in ffitest.c. The only tricky part (I hope) is passing the "port" argument into the thing called by the catch -- the catch "body" function takes no arguments, as in schem

Re: [CM] fn defined in C returns to wrong place

2022-08-26 Thread Gregg Reynolds
On Fri, Aug 26, 2022 at 9:28 AM wrote: > *error-hook* is only called if there is no catch; it resets the s7 stack > when it returns, so you're back at the top level. My first thought is > that you need a catch in convert.scm where you do the s7_call. Maybe > I have the wrong model of what's hap

Re: [CM] fn defined in C returns to wrong place

2022-08-26 Thread Gregg Reynolds
On Fri, Aug 26, 2022 at 9:28 AM wrote: > *error-hook* is only called if there is no catch; it resets the s7 stack > when it returns, so you're back at the top level. My first thought is > that you need a catch in convert.scm where you do the s7_call. Maybe > I have the wrong model of what's hap

Re: [CM] fn defined in C returns to wrong place

2022-08-26 Thread bil
*error-hook* is only called if there is no catch; it resets the s7 stack when it returns, so you're back at the top level. My first thought is that you need a catch in convert.scm where you do the s7_call. Maybe I have the wrong model of what's happening. The s7 stack can be viewed via (*s7* 's

[CM] fn defined in C returns to wrong place

2022-08-26 Thread Gregg Reynolds
I'm using s7 to convert from Dune (the standard OCaml build tool) to Bazel. Dune files use sexp syntax, so in general this works great; almost all of the conversion logic is written in s7 scheme. But I've come across a problem that has me stumped. The one incompatibility I've found in dune syntax