From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.lisp.guile.devel Subject: Re: A Guile debugger workgroup? Date: Fri, 03 Mar 2023 11:30:51 +0100 Organization: AvatarAcademy.nl Message-ID: <87sfem1604.fsf@gnu.org> References: <87edtlptgv.fsf@laura> <878rgf4qx4.fsf@gnu.org> <87fsana8m9.fsf@web.de> <87wn3y1644.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10898"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: Olivier Dion , guile-devel@gnu.org To: "Dr. Arne Babenhauserheide" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Fri Mar 03 11:31:05 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY2gq-0002dT-Vp for guile-devel@m.gmane-mx.org; Fri, 03 Mar 2023 11:31:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pY2gi-00024k-Gn; Fri, 03 Mar 2023 05:30:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pY2gh-00024a-88 for guile-devel@gnu.org; Fri, 03 Mar 2023 05:30:55 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pY2gg-0005Y7-VU; Fri, 03 Mar 2023 05:30:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Yk39XD+iqjNrvtJjl8jRobsNqnaAWMesk43gVwQrXFc=; b=IMGDhWwm9/UY8CaLAJJ8 ulGKj98L2oNhauhgmh0Z7NOGv7q/mcZRlUv0N3vRaWD2ZPJebnliHa6qRTZ+m1MOOkFd1aRTtaOkL FZxGit2zTY1HZyHV1e/OpRY7zth1bk61nuH7KPjH0pqwSYmJE0hF2R62XsqVIJyoWwE9Cqd6Tspez aLjSxJYxCunxYkeejYR92P5B6litforCNNNIaMraCIcLn/OKGX3/Uwy1+MXBWb3BcXY3t4bImgdoZ uxOq3Y3CIYM1THnuWaTLqFvcr2jwc6jjxQV5k0zKN7nOIKwmb3tOyqnZjWCcclPj82Kl6NmS86EgN sI+OfZod1EK56Q==; Original-Received: from 2a02-a462-da03-1-2701-7f81-a736-4607.fixed6.kpn.net ([2a02:a462:da03:1:2701:7f81:a736:4607] helo=drakenpad.janneke.lilypond.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pY2gg-0002Lk-CM; Fri, 03 Mar 2023 05:30:54 -0500 X-Url: http://AvatarAcademy.nl In-Reply-To: <87wn3y1644.fsf@gnu.org> (Janneke Nieuwenhuizen's message of "Fri, 03 Mar 2023 11:28:27 +0100") X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21768 Archived-At: --=-=-= Content-Type: text/plain Janneke Nieuwenhuizen writes: Fixing typos in peek-error. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-peek-error-pke.patch >From bf0f03090d73ea87f1be772010d6209b4372e78b Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Fri, 3 Mar 2023 11:26:34 +0100 Subject: [PATCH] Add peek-error, pke. Debuging using `pk' is popular in Guile, but not really usable if your program is as (pseudo-)filter, i.e., writing its output to stdout. * module/ice-9/boot-9.scm (peek-error, pke): New procedures. --- module/ice-9/boot-9.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index dc3537063..4868f6f3c 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -183,6 +183,16 @@ This is handy for tracing function calls, e.g.: (define pk peek) +(define (peek-error . stuff) + "Like PEEK (PK), writing to (CURRENT-ERROR-PORT)." + (newline (current-error-port)) + (display ";;; " (current-error-port)) + (write stuff (current-error-port)) + (newline (current-error-port)) + (car (last-pair stuff))) + +(define pke peek-error) + (define (warn . stuff) (newline (current-warning-port)) (display ";;; WARNING " (current-warning-port)) -- 2.39.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com --=-=-=--