unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: guile-user@gnu.org
Subject: How to gradually write a procedure using Guile?
Date: Fri, 3 May 2024 02:24:24 +0200	[thread overview]
Message-ID: <ZjQuuOexsqSYSI77@ws> (raw)

[-- Attachment #1: Type: text/plain, Size: 1571 bytes --]

Hello,

I am looking for a workflow advice.  I am using Emacs with Geiser.

I am trying to write couple of procedures that are very imperative and I am not
sure how to do that nicely in REPL.  For example, let us assume I have a
procedure of following character:

    (define (foo)
      (let* ((x (bar-x))
             (y (bar-y x)))
        (step1 x)
        (step2 y)
        (step3 x y)
        ...))

Now, each step can be a procedure call, of just few expressions.  Now I would
like to write the additional steps while utilizing REPL somehow, but I am not
sure what is an efficient way.

Can I somehow run just to the `...' and get a REPL there so that I could C-x C-e
the steps within the let* (for x and y)?  Should I just (temporarily)

    (define x (bar-x))
    (define y (bar-y x))

in the REPL so that I can use C-x C-e on the steps?  I expect that to get messy
once the lets start nesting for example.

How do you do it?  Are there any resources (blog posts, toots, videos, ...)
regarding guile developer's workflow?  I did read few, and I (think I) know the
fundamentals of Geiser and the REPL, but I am straggling a bit in this case not
to fall back to the "normal" way of "write a function, run it whole against a
test".  Since this is Scheme, and I *can* evaluate single expressions in the
procedure body, I would like to use that to my advantage.  Somehow.

I realize this is a very open-ended question/email.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2024-05-03  0:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  0:24 Tomas Volf [this message]
2024-05-03  8:45 ` How to gradually write a procedure using Guile? Jérémy Korwin-Zmijowski
2024-05-03 11:49   ` Dr. Arne Babenhauserheide
2024-05-16 18:25     ` Tomas Volf

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=ZjQuuOexsqSYSI77@ws \
    --to=~@wolfsden.cz \
    --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).