all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 58040@debbugs.gnu.org
Subject: bug#58040: "guix style" puts closing parentheses on the wrong line
Date: Sat, 24 Sep 2022 12:18:32 +0200	[thread overview]
Message-ID: <71826703-ee1d-b353-7b3f-f5a5d37c3125@telenet.be> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 1293 bytes --]

Hi,

Putting the following definition into a file a.scm (from 
https://issues.guix.gnu.org/57460):

(define (find-latest-release releases)
   (fold (match-lambda*
          (((key . value) result)
           (cond ((even-minor-version? key)
                  (match result
			(#f
			 (cons key value))
			((newest . _)
			 (if (version>? key newest)
                              (cons key value)
                              result))))
                 (else
                  result))))
         #f
         releases))

and running "guix style -f a.scm" on it, it becomes

(define (find-latest-release releases)
   (fold (match-lambda* (((key . value) result)
                         (cond
                           ((even-minor-version? key)
                            (match result
                              (#f (cons key value))
                              ((newest . _) (if (version>? key newest)
                                                (cons key value) result))))
                           (else result)))
           ) #f releases)).

In particular, note the ") #f releases" -- IMO ) should be on the 
previous line, after (else result))), to avoid lonely parentheses and to 
align the arguments of 'fold'.

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

             reply	other threads:[~2022-09-24 10:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24 10:18 Maxime Devos [this message]
2022-10-02 22:12 ` bug#58040: "guix style" puts closing parentheses on the wrong line Ludovic Courtès

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71826703-ee1d-b353-7b3f-f5a5d37c3125@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=58040@debbugs.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.