<div dir="ltr">Hi Bil and the rest of you,<div><br></div><div>I&#39;ve added s7 as an extension language [1] to the 3.0 branch [2]</div><div>of the Radium music editor [3].</div><div><br></div><div>Some details about it: A small web server running inside Radium</div><div>is communicating with an external python script. This python script</div><div>functions as a repl for S7 [5]. This method works excellently, since the</div><div>repl doesn&#39;t have to be restarted if radium crashes, and you don&#39;t</div><div>have to run radium (which is quite bloated) from inside</div><div>emacs (which I&#39;m using as lisp code editor). Right now I&#39;m working</div><div>on rewriting all the mouse handling in s7, since the current</div><div>code (written in c) needs to be rewritten anyway, and this is simpler</div><div>to implement in scheme than in c.</div><div><div><br></div></div><div>S7 has so far been an excellent scheme implementation for me.</div><div>It&#39;s impressively fast (even mysteriously impressively fast, at</div><div>least for calculating the fibbonacci numbers), the api is dead simple,</div><div>and it&#39;s simple to embed into other programs. It&#39;s a quite perfect</div><div>extension language I would say.</div><div><br></div><div><br></div><div><br></div><div>But I wonder if it&#39;s possible to get a more detailed</div><div>backtrace if something goes wrong?</div><div><br></div><div>For instance, if I run the following code:<br></div><div>&quot;</div><div><div>(define (d)</div><div>  (e))</div><div>(define (c)</div><div>  (d))</div><div>(define (b)</div><div>  (c))</div><div>(define (a)</div><div>  (b))</div></div><div>(a)</div><div>&quot;</div><div><br></div><div>I get this response:</div><div><br></div><div>&quot;</div><div><div> syntax-error</div><div>error message: [</div><div>;e: unbound variable</div><div>;  /home/kjetil/radium3.0/bin/scheme/mouse/bug.scm[9]</div><div>;    &quot;/home/kjetil/radium3.0/bin/scheme/mouse/bug.scm&quot;, line 2</div><div>;</div><div>; d: (e)                                      </div><div>; (load &quot;/home/kjetil/radium3.0/bin/scheme/...</div><div>&quot;</div></div><div><br></div><div>Which is good, but sometimes not good enough, since I tend</div><div>to write a lot of spaghetti-like code.</div><div><br></div><div>Ideally, something like this would be nice:</div><div><br></div><div>&quot;</div><div>;5. e: unbound variable, bug.scm[2]</div><div>;4. (d), bug.scm[4]</div><div>;3. (c), bug.scm[6]</div><div>;2. (b), bug.scm[8]</div><div>;1. (a), bug.scm[9]</div><div>&quot;</div><div><br></div><div>I&#39;ve looked over the documentation, experimented with code</div><div>that catches exceptions and inspecting data that calls &quot;owlet&quot;,</div><div>but haven&#39;t found a way to get the kind of backtrace I want.<br></div><div><br></div><div>Is it possible to get this type of backtrace at all? Or perhaps</div><div>there is a different and perhaps better way to debug an s7 program?</div><div>I can live without this kind of backtrace though, so it&#39;s not</div><div>a big problem, and certainly not a show stopper.</div><div><br></div><div><br></div><div><br></div><div>I also have a feature request, which might be a lot of work</div><div>to implement, but would also be very nice to have. The feature is to give</div><div>warnings for undefined variables and functions.</div><div><br></div><div>For instance, if you try to evaluate</div><div><br></div><div>(define (hello)</div><div>   (let ((hello2 9))</div><div>     (+ hello2 hello3))<br></div><div><br></div><div>s7 would give a warning if hello3 isn&#39;t defined.</div><div><div>Guile has recently gotten this feature, and when</div><div>I developed a small software package for guile earlier this year,</div><div>it probably saved me a lot of time, since discovering undefined<br></div></div><div>variables and functions in code during runtime is harder and more</div><div>random than getting a message about it during compile time.</div><div>I think the lisp language &quot;Shen&quot; also has this feature, and that</div><div>in Shen you can turn off the warning by using a special macro,</div><div>I think the name might be &quot;extern&quot; or something like that.</div><div>(I.e. &quot;(extern hello3)&quot;).</div><div><br></div><div>Thanks for reading,</div><div>-Kjetil<br></div><div><br></div><div><br></div><div>[1] <a href="https://github.com/kmatheussen/radium/blob/3.0/api/protos.conf">https://github.com/kmatheussen/radium/blob/3.0/api/protos.conf</a></div><div>[2] <a href="https://github.com/kmatheussen/radium/tree/3.0">https://github.com/kmatheussen/radium/tree/3.0</a><br></div><div><div></div></div><div>[3] <a href="http://users.notam02.no/~kjetism/radium/">http://users.notam02.no/~kjetism/radium/</a><br></div><div></div><div>[4] <a href="https://github.com/kmatheussen/radium/blob/3.0/embedded_scheme/scheme.cpp">https://github.com/kmatheussen/radium/blob/3.0/embedded_scheme/scheme.cpp</a></div><div>[5] <a href="https://github.com/kmatheussen/radium/blob/3.0/bin/scheme/repl.py">https://github.com/kmatheussen/radium/blob/3.0/bin/scheme/repl.py</a><br></div><div><br></div></div>