<div dir="ltr">Here's a snippet of what I'm trying, corrections or confirmation welcome:<div><br></div><div>// error and abort if not an int vector and table name<br> if( !s7_is_vector(s7_source_vector) || !s7_is_int_vector(s7_source_vector) ){<br> // error posts to the max console<br> char *error_msg = "vector->table: arg 1 must be an integer vector";<br> error(error_msg);<br> return s7_error(s7, s7_make_symbol(s7, "io-error"), s7_make_string(s7, error_msg) );<br> }else{<br> // do other stuff, let's say it's all good<br> return s7_nil(s7);<br> }<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 17, 2020 at 12:11 PM Iain Duncan <<a href="mailto:iainduncanlists@gmail.com">iainduncanlists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi folks, I'm hoping an experienced schemer can help me. I have a collection of FFI functions that are called for their side effects (ie writing to a table or buffer in Max). They can error out if, for example, they are called with a non-existent table name. I know what they should do in Max (post to the error log), but am not sure what the right thing is for them to do in a Scheme API. Right now I have my pure side-effect functions return Scheme nil when they are done. In Python, I would throw an exception. If anyone can point me at how to implement this so that experienced schemer's doing thing the API is garbage, that would be lovely.<div><br></div><div>thanks!</div><div>iain</div></div>
</blockquote></div>