Well, if you think about it, this is what Gambit does internally - in a sexp  the symbol abcde is wrapped internally to (string->symbol "abcde").<div><br></div><div>In the C world, you could make a string->symbol wrapper so you'd get</div>

<div><br></div><div>___SCMOBJ alex_sy1 = string_to_symbol("alex_sy1");</div><div><br></div><div>etc.</div><div><br></div><div>With some C macro magic, perhaps that could even be written as</div><div><br></div><div>

define_scheme_sy(alex_sy1)</div><div><br></div><div>or something.</div><div><br></div><div>(Also, have a look at string->symbol's definition, imaginably a lot of it is written in C in such a way that you could just call it directly from C, well, that might more probably not be an option too.)<br>

<br><div class="gmail_quote">2013/2/19 Alex Young <span dir="ltr"><<a href="mailto:alex@blackkettle.org" target="_blank">alex@blackkettle.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">> 2) you're returning symbols so I think you want your C function to</div><div class="im">
> return to Scheme. Have your C function return a result code and wrap it<br>
> in a Scheme procedure that maps the result code onto a symbol. You can<br>
> look at Gamsock on the dumping ground for examples of how to wrap a<br>
> low-level C function in a Scheme procedure that handles the Scheme objects.<br>
><br>
<br>
</div>Yeah, I was trying to avoid having to do this.  I'd be defining the<br>
return codes twice - once as ints (or whatever) and once as symbols.  I<br>
guess that's all macroable away, but still... not particularly elegant.<br>
<br>
Thanks for the suggestions :-)<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Alex<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br></div>