From: Ian Price <ianprice90@googlemail.com>
To: Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: Where is the backtrace?
Date: Fri, 03 Jan 2014 10:28:41 +0000 [thread overview]
Message-ID: <87d2k9e4va.fsf@Kagami.home> (raw)
In-Reply-To: <CAMFYt2ZgjqsBz03oNiEFjqy_yoJMNNo0o58iUBdmYiiVGSVARA@mail.gmail.com> (Panicz Maciej Godek's message of "Fri, 3 Jan 2014 03:30:04 +0100")
Panicz Maciej Godek <godek.maciek@gmail.com> 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"
next prev parent reply other threads:[~2014-01-03 10:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-03 2:30 Where is the backtrace? Panicz Maciej Godek
2014-01-03 10:28 ` Ian Price [this message]
2014-01-03 13:57 ` Panicz Maciej Godek
2014-01-03 16:15 ` Ian Price
2014-01-03 18:03 ` Mark H Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d2k9e4va.fsf@Kagami.home \
--to=ianprice90@googlemail.com \
--cc=godek.maciek@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).