From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amirouche Newsgroups: gmane.lisp.guile.user Subject: Re: Stack traces Date: Sat, 18 Feb 2017 16:50:03 +0100 Message-ID: <641f554a-3672-d71a-78cd-f32f5287f98d@hypermove.net> References: <87h93wto3y.fsf_-_@gnu.org> <87mvdn4gam.fsf@dustycloud.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1487433059 6579 195.159.176.226 (18 Feb 2017 15:50:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2017 15:50:59 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Feb 18 16:50:55 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf7Hi-0000xk-Ls for guile-user@m.gmane.org; Sat, 18 Feb 2017 16:50:54 +0100 Original-Received: from localhost ([::1]:58938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cf7Hj-0004yG-Iu for guile-user@m.gmane.org; Sat, 18 Feb 2017 10:50:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cf7HJ-0004y9-HA for guile-user@gnu.org; Sat, 18 Feb 2017 10:50:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cf7HI-0005eg-T5 for guile-user@gnu.org; Sat, 18 Feb 2017 10:50:29 -0500 Original-Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:52997) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cf7HI-0005eO-Ml for guile-user@gnu.org; Sat, 18 Feb 2017 10:50:28 -0500 Original-Received: from [IPv6:2a01:e35:2ef3:d930:b81a:1aa8:923d:8c5b] (unknown [IPv6:2a01:e35:2ef3:d930:b81a:1aa8:923d:8c5b]) (Authenticated sender: amirouche@hypermove.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 4DB38172098 for ; Sat, 18 Feb 2017 16:50:25 +0100 (CET) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4b98:c:538::196 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.user:13288 Archived-At: Le 18/02/2017 à 01:13, Matt Wette a écrit : > (use-modules (system repl repl)) > (use-modules (system repl debug)) > > (define-syntax-rule (trap-here) > (start-repl > #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t))) > > (define (foo) > (let iter ((sum 0) (vals '(1 2 3 5 8 2))) > (trap-here) > (if (null? vals) sum > (iter (+ sum (car vals)) (cdr vals))))) > > (foo) It looks like that. Except `iter` should be defined in the namespace of the REPL.