<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Is there a sample OS X application that is linked to mzscheme? I built the latest CVS and release builds but I am getting crashes just creating a scheme env. Maybe there is a build setting I am missing, I tried both gcc3.3 and gcc4 which made no diff. I really don't want to debug the build or mzscheme I just want use it.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Mike</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>// main.cpp.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>#include "scheme.h"<BR><BR><BR>int main(int argc, char *argv[])<BR>{<BR> Scheme_Env *e = scheme_basic_env(); <-------------------crashes in here<BR> Scheme_Config *scheme_config = scheme_current_config();<BR> Scheme_Object *curout = scheme_get_param(scheme_config, MZCONFIG_OUTPUT_PORT);<BR> int i;<BR> <BR> for (i = 1; i < argc; i++)<BR> {<BR> if (scheme_setjmp(scheme_error_buf))<BR> {<BR> return -1; /* There was an error */<BR> }<BR> else<BR> {<BR> Scheme_Object *v = scheme_eval_string(argv[i], e);<BR> scheme_display(v, curout);<BR> scheme_display(scheme_make_character('\n'), curout);<BR> }<BR> }<BR> return 0;<BR>}<BR><BR></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>in symbol.c <DIV> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" color="#236e25" style="font: normal normal normal 10px/normal Monaco; color: rgb(35, 110, 37); ">/* Special hashing for symbols: */</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">static</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> Scheme_Object *symbol_bucket(Scheme_Hash_Table *table,</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "><SPAN class="Apple-converted-tab"> </SPAN> GC_CAN_IGNORE </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">const</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">char</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> *key, </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">unsigned</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">int</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> length,</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "><SPAN class="Apple-converted-tab"> </SPAN> Scheme_Object *naya)</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; ">{</FONT></P><P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "><BR class="khtml-block-placeholder"></SPAN></P><P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">.......</SPAN></P><P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "><BR class="khtml-block-placeholder"></SPAN></P><P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "><BR class="khtml-block-placeholder"></SPAN></P><P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "><BR class="khtml-block-placeholder"></SPAN></P> <FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> }</FONT></DIV></DIV><DIV> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "></FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">if</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> (!h2)</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> h2 = </FONT><FONT face="Monaco" size="2" color="#0000ff" style="font: normal normal normal 10px/normal Monaco; color: rgb(0, 0, 255); ">2</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; ">;</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">else</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">if</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> (h2 & </FONT><FONT face="Monaco" size="2" color="#0000ff" style="font: normal normal normal 10px/normal Monaco; color: rgb(0, 0, 255); ">0x1</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; ">)</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> h2++; </FONT><FONT face="Monaco" size="2" color="#236e25" style="font: normal normal normal 10px/normal Monaco; color: rgb(35, 110, 37); ">/* note: table size is never even, so no % needed */</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "></FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">while</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> ((bucket = table->keys[WEAK_ARRAY_HEADSIZE + h])) { <-------- table == NULL</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">if</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> (SAME_OBJ(bucket, SYMTAB_LOST_CELL)) {</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">if</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> (naya) {</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "><SPAN class="Apple-converted-tab"> </SPAN></FONT><FONT face="Monaco" size="2" color="#236e25" style="font: normal normal normal 10px/normal Monaco; color: rgb(35, 110, 37); ">/* We're re-using, so decrement count and it will be</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" color="#236e25" style="font: normal normal normal 10px/normal Monaco; color: rgb(35, 110, 37); "><SPAN class="Apple-converted-tab"> </SPAN> re-incremented. */</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "><SPAN class="Apple-converted-tab"> </SPAN>--table->count;</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "><SPAN class="Apple-converted-tab"> </SPAN></FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">break</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; ">;</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> }</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> } </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">else</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> </FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">if</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "> (((</FONT><FONT face="Monaco" size="2" color="#760f50" style="font: normal normal normal 10px/normal Monaco; color: rgb(118, 15, 80); ">int</FONT><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; ">)length == SCHEME_SYM_LEN(bucket))</FONT></P> <P style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Monaco" size="2" style="font: normal normal normal 10px/normal Monaco; "><SPAN class="Apple-converted-tab"> </SPAN> && !memcmp(key, SCHEME_SYM_VAL(bucket), length))</FONT></P> </DIV></BODY></HTML>