guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where is the backtrace?


From: Ian Price
Subject: Re: Where is the backtrace?
Date: Fri, 03 Jan 2014 10:28:41 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Panicz Maciej Godek <address@hidden> writes:

>> (define (f) (define (g) (define (h) ((lambda x (cdr x)))) (h)) (g))
>> (f)
> <unnamed port>:13:0: In procedure #<procedure 24df3a0 at <current
> input>:13:0 x>:
> <unnamed port>:13:0: In procedure cdr: Wrong type argument in position
> 1 (expecting pair): ()
>
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue
>
>> ,bt
> In current input:
>      13:0  0 (#<procedure 24df3a0 at <current input>:13:0 x>)
>
> Why isn't the information about the subsequent procedures tracked? Do
> they all get inlined?

scheme@(guile-user)> ,optimize (define (f) (define (g) (define (h) ((lambda x 
(cdr x)))) (h)) (g))
$2 = (define (f) (cdr '()))

So, yes.

Though not relevant to this case, there is also another important factor
in your code, which is that all function calls are tail calls. So even
if you turned off optimisation, you would not see a complete backtrace.

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]