Hi,

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.

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:

Gambit_r1 = (Gambit_bb1_pair_3f_);
                 ^
ReferenceError: Gambit_bb1_pair_3f_ is not defined


 ???

Thank you,
Francois

On 2013-11-14, at 13:02, Marc Feeley <feeley@iro.umontreal.ca> wrote:


On Nov 13, 2013, at 11:08 PM, Francois Magnan <magnan@categoricaldesign.com> wrote:

Hi Marc,

Yes it works much better. Now I just need to implement some library functions in javascript.
For example I get:

TypeError: ‘undefined’ is not a function (evaluating 'Gambit_glo['with-output-to-string']()')

I will tweak my Scheme code to avoid those abstractions for the moment.

Thank you,
Francois

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.

Marc

<obj2str.scm>