<div dir="ltr"><div>Marc, any display-continuation-backtrace on roadmap?<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-21 22:29 GMT+08:00 ben yakawp <span dir="ltr"><<a href="mailto:ben.lists@yakawp.com" target="_blank">ben.lists@yakawp.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">and another thing I'd like to point out with this example: I find really<br>
difficult to debug the produced code. This is probably because GambitJS<br>
doesn't simply transpile the source code but uses the target language as<br>
a host for its virtual machine which has its own semantics.<br>
<br>
I tried to use Marc Feeleys code to mimic OO style in scheme for<br>
prototypes:<br>
<br>
; OO<br>
(define (new constructor . args)<br>
  (let ((obj (create-object constructor args)))<br>
    (lambda (method . args)<br>
      (call-method obj method args))))<br>
<br>
; Prototypes<br>
(define (proto constructor . args)<br>
    (lambda (method . args)<br>
      (call-method constructor method args)))<br>
<br>
(define console (proto 'console))<br>
(console log:)<br>
<br>
Error:<br>
/out.js:935<br>
    g_r1 = g_host2scm(g_r1[g_r2.toString()].call(g_r1));<br>
    TypeError: Cannot call method 'call' of undefined<br>
<br>
Question:<br>
- I would like to find out the value of "console". But what makes more<br>
sense: Debugging the value "console" in the c platform of the js<br>
platform?<br>
- How can you debug the javascript code? Alone the line<br>
          "g_r1 = g_host2scm(g_r1[g_r2.toString()].call(g_r1)); "<br>
is somehow mindblowing to me. You seem to reach out to scheme again from<br>
the generated code. I cannot follow this...<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, Dec 21, 2015, at 01:39 PM, ben yakawp wrote:<br>
> hi<br>
> I have a the following problem: Initially I was looking for a simple way<br>
> to write code on several platforms with scheme as the "reference<br>
> platform". This is more difficult then I thought because most of the<br>
> target languages have libraries that are build with an OO model. That<br>
> leaks into the platform neutral source code, so that you write scheme<br>
> but with OO in mind. Now I see a next problem, that of Javascript making<br>
> extensive use of "prototyping", again a specific model that has to be<br>
> ported to other languages.<br>
><br>
> So my question is, how would you express prototyping in a platform<br>
> neutral way, so that you can (hypothecally) use the source code also for<br>
> target languages that don't support prototyping.<br>
><br>
> Hopefully I don't make this much more complicated than it is.<br>
> Ben<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" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><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" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br></div>