From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.user Subject: Re: Where is the backtrace? Date: Fri, 03 Jan 2014 10:28:41 +0000 Message-ID: <87d2k9e4va.fsf@Kagami.home> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388744942 11468 80.91.229.3 (3 Jan 2014 10:29:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jan 2014 10:29:02 +0000 (UTC) Cc: "guile-user@gnu.org" To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 03 11:29:06 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vz201-0004Q0-QN for guile-user@m.gmane.org; Fri, 03 Jan 2014 11:29:05 +0100 Original-Received: from localhost ([::1]:49059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz201-0000Wh-D6 for guile-user@m.gmane.org; Fri, 03 Jan 2014 05:29:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz1zo-0000Wc-S7 for guile-user@gnu.org; Fri, 03 Jan 2014 05:28:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz1zk-0000VB-Pt for guile-user@gnu.org; Fri, 03 Jan 2014 05:28:52 -0500 Original-Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:37857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz1zk-0000V5-IN for guile-user@gnu.org; Fri, 03 Jan 2014 05:28:48 -0500 Original-Received: by mail-wg0-f51.google.com with SMTP id b13so13449356wgh.30 for ; Fri, 03 Jan 2014 02:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=V9uWYXhsgZnfMto6/opJ6A/FyygZ3bOOPBhlYnZfmc8=; b=jct/W2J6FKa4msNtjttEZ5QIU+CV0Q5f1RaDNG4JZ9P0E6LHAUf6qIoa3U7MLkqUB8 EKNb4BYxCkGUuvG5lRMOjgZsW3e+kidXfuXYR5F/YcN7j0yoziH9/DZ0ARxEaB/KS6Uu fizwSv5AwTfv2Tvt6gEh0+DPYo0jfaX+iP+9zINHUSFmlSFgppOXZ6lay+CTTw62fCk5 88+7bNk9UL4TM332BTkge59qtiPJRst8NB+XVi46KmwxTpHvfPJZUa0vSIDopEcQD+vr Td4+UlFcwg3K9P+w07MA1FVg+oducrVRkdvBEW30ozog9rdDXLdw/4yIbjVJe5N/LFSD XC/Q== X-Received: by 10.195.13.234 with SMTP id fb10mr34960800wjd.50.1388744926974; Fri, 03 Jan 2014 02:28:46 -0800 (PST) Original-Received: from Kagami.home (host86-184-83-158.range86-184.btcentralplus.com. [86.184.83.158]) by mx.google.com with ESMTPSA id eh7sm1820450wic.2.2014.01.03.02.28.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 03 Jan 2014 02:28:45 -0800 (PST) Mail-Followup-To: Panicz Maciej Godek , "guile-user\@gnu.org" In-Reply-To: (Panicz Maciej Godek's message of "Fri, 3 Jan 2014 03:30:04 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::233 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10958 Archived-At: Panicz Maciej Godek writes: >> (define (f) (define (g) (define (h) ((lambda x (cdr x)))) (h)) (g)) >> (f) > :13:0: In procedure # input>:13:0 x>: > :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 (#: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"