<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi,</div><div><br></div><div>When I compile your program ‘gsc -c -target js …’, I get a working program when I try it in node javascript i.e. “node obj2str.js”, Safari an Chrome. Note that I had to define the print function to make it work. I also took the latest gambit from the git repo. Thank you for the code.</div><div><br></div><div>What I don’t understand now is that you seem to use the pair? function and it works fine. When I compile my program the javascript interpreter complains:</div><div><br></div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">Gambit_r1 = (Gambit_bb1_pair_3f_);</div><div style="margin: 0px; font-size: 10px; font-family: Monaco;">                 ^</div><div><span style="font-family: Monaco; font-size: 10px;">ReferenceError: Gambit_bb1_pair_3f_ is not defined</span></div><div><br></div><div><br></div><div> ???</div><div><br></div><div>Thank you,</div><div>Francois</div><div><br></div><div><div><div>On 2013-11-14, at 13:02, Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>On Nov 13, 2013, at 11:08 PM, Francois Magnan <<a href="mailto:magnan@categoricaldesign.com">magnan@categoricaldesign.com</a>> wrote:<br><br><blockquote type="cite">Hi Marc,<br><br>Yes it works much better. Now I just need to implement some library functions in javascript.<br>For example I get:<br><br>TypeError: ‘undefined’ is not a function (evaluating 'Gambit_glo['with-output-to-string']()')<br><br>I will tweak my Scheme code to avoid those abstractions for the moment.<br><br>Thank you,<br>Francois<br></blockquote><br>Very well.  By the way, I have made a few changes this morning that may make things easier for handling strings, characters and symbols.  If all you need is something to convert Scheme data to a string in order to display it, then use the object->string function defined in the attached file.  It also includes a pretty-printer.<br><br>Marc<br><br><span><obj2str.scm></span></blockquote></div><br></div></body></html>