From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.user Subject: Re: How do people debug their guile code? Date: Tue, 8 Sep 2020 14:52:07 -0700 Message-ID: References: <877dt4kvw2.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35799"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Fredrik Salomonsson Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Sep 08 23:52:35 2020 Return-path: Envelope-to: guile-user@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 1kFlXW-0009CA-87 for guile-user@m.gmane-mx.org; Tue, 08 Sep 2020 23:52:34 +0200 Original-Received: from localhost ([::1]:59412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFlXV-0003od-6F for guile-user@m.gmane-mx.org; Tue, 08 Sep 2020 17:52:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFlXJ-0003lS-QJ for guile-user@gnu.org; Tue, 08 Sep 2020 17:52:21 -0400 Original-Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:46289) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFlXI-0001By-3b for guile-user@gnu.org; Tue, 08 Sep 2020 17:52:21 -0400 Original-Received: by mail-lj1-x22e.google.com with SMTP id a22so803002ljp.13 for ; Tue, 08 Sep 2020 14:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZBRnfYjsd5Sk0M/Mq2yolEEGeoWSkEwL3MyFCg5+ft4=; b=rLstdhTYOOaWHkbPOCkytu1uiQW2/EBJ352RiZXQqeF4g8jMhI/6PnWqRMtQYK+zDb bUGgma278BktsDoKEik7V4FRwtz/30rOsdQ8DIhO+AU1rIGxL7sOns/JGJCpOZg9nLIy t/7RWAUk/Dy1CronknAIjZcD3GIn7Mdt2l8oFFH/Ha36+tdzTT3b8lFfe3GuO3rkCEV+ 8cnFDF6fytrjrv7G8RUGKUI8RJNM8/POlPeVK+oNWo1RPF89qS8i7pU0/T8z3mbH+Gxm etNuambPk7NtgF9u2Ex+IsVVFt0J2eJoiox16TWZHNkfgvkzV5ewcFvvQwwuxDPHC+7a 2DyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZBRnfYjsd5Sk0M/Mq2yolEEGeoWSkEwL3MyFCg5+ft4=; b=QFYICTJypv/FC/y61XPFv72R3UVLk+eDmzb/VwIcctCWQ44nO4RwzVeYBWOpJtlsub 1Dej3a7uaXQdRmTLk8jlZAtZ2oJj4FVjMupoPvo2aX2mVG+TBFVLqtGsunhkOduoLcAs BcQTp7MLiDClRFD1wt6kg1iDRJdBBIb1PGu/W2ZKyJNWIVaQkIweOBjKrDPOfMjVwnGy WSM/ZePnEZNcq0GQP1iIvHbodSEmEpC1v2VdO641UNnY3jew4TSGaq86V36ISrd62CW7 KgF6CIoGU5udaawDANmpoLj9fDvLSehA97CL2GKt6putreCGDY4gwD9V5AbZ9iU2fsW4 4ZJw== X-Gm-Message-State: AOAM531IZc/pQi/mDOstd+dkKsjQ+fE0yqQwzL7+qsKFB1KY+AK+7XQm 9erN2+AnXQTxo6B+W7aRVcZQqFzH8l1pxZEi3GQ= X-Google-Smtp-Source: ABdhPJzi6VxD6sfJAg+ceJOArRtWABrbwO05tB04egm6HVybUM6nzps+3iAfARG0EpJhlSDHk8iiARTd9OcFImj2owQ= X-Received: by 2002:a05:651c:555:: with SMTP id q21mr261303ljp.203.1599601938231; Tue, 08 Sep 2020 14:52:18 -0700 (PDT) In-Reply-To: <877dt4kvw2.fsf@posteo.net> Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=aconchillo@gmail.com; helo=mail-lj1-x22e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16896 Archived-At: Hi, On Tue, Sep 8, 2020 at 10:43 AM Fredrik Salomonsson wrote: > > Hi again, > > I recently asked about something similar but more Emacs specific in the > thread "Debug setup in Emacs". But it seems there are some more work to > be done to get it properly hooked up with Emacs' GUD. I asked a follow > up question how people debug their code and got as suggestion that it > might be better to create a separate thread for it. > > So here it is. > > I'm fairly new with guile (hence why I ask about this). My workflow (in > other languages) is usually to write tests, then when something goes > wrong I hook up a debugger and step through the code. > > For guile I've been just writing tests and when something goes wrong I > sprinkle (format #t ...) and re-run the tests. I haven't dabbled that > much in running the REPL as I haven't figured out a good way of setting > up the same environment as when I run the tests (using guile-hall). > > What I gathered from the "Debug setup in Emacs" thread. Is to sprinkle > print out statements using the "format" or "simple-format" procedure. > > Use the "pk" procedure. > > Use the REPL if the setup is easy enough, combined with the use of > trace. > > And to write tests. > > So I'm curious if there are other workflows/steps people use/take? > > > I usually run Geiser with a REPL running and reevaluate any changes (C-c C-k) and try again in the REPL. At the same time also use (pk) or (display). And hopefully also run tests. Aleix