[CM] Backtrace in s7

Kjetil Matheussen k.s.matheussen at gmail.com
Mon Oct 6 00:57:46 PDT 2014


On Mon, Oct 6, 2014 at 1:40 AM, Bill Schottstaedt <bil at ccrma.stanford.edu>
wrote:

> Thanks very much for the praise!
>
> > Is it possible to get this type of backtrace at all?
>
> Not without slightly rewriting the scheme code -- those are all
> tail-calls, so there is nothing in the s7 stack that represents the
> call sequence.


Ah, I didn't think of that.



> Wrap everything in dynamic-winds or the equivalent
> to get a C-like stacktrace.
>
>
Thanks! I don't know what you mean, but I'll experiment with dynamic-winds.



> > The feature is to give
> > warnings for undefined variables and functions.
>
> Ok -- I'll add a switch for this -- did Guile (Andy Wingo?)
> say why they chose to handle these with warnings?
>
>
I don't quite follow. Do you mean why they started to give
these warnings in the first place? (I'm 99% sure it's possible
to turn off though, but I haven't been reading the mailing
list closely for many years). Or why they don't give errors instead?

In the latter, errors would be incorrect. For this code:

(define (a)
   (b))
(define (b)
  50)

guile gives the following output:
"
scheme@(guile-user)> (define (a) (b))
;;; <stdin>:2:0: warning: possibly unbound variable `b'
scheme@(guile-user)> (define (b) 50)
scheme@(guile-user)>
"

But of course, there is actually nothing wrong with the code,
so an error would not be appropriate. But maybe Guile
has an option to give error instead, I don't know.

(of course, guile doesn't give warnings if the functions
are defined in the other order:
"
scheme@(guile-user)> (define (b) 50)
scheme@(guile-user)> (define (a) (b))
scheme@(guile-user)>
")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20141006/25222ca9/attachment.html 


More information about the Cmdist mailing list