GNU bug report logs - #58040
"guix style" puts closing parentheses on the wrong line

Previous Next

Package: guix;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Sat, 24 Sep 2022 10:19:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxime Devos <maximedevos <at> telenet.be>
Subject: bug#58040: closed (Re: bug#58040: "guix style" puts closing
 parentheses on the wrong line)
Date: Sun, 02 Oct 2022 22:13:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#58040: "guix style" puts closing parentheses on the wrong line

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 58040 <at> debbugs.gnu.org.

-- 
58040: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58040
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 58040-done <at> debbugs.gnu.org
Subject: Re: bug#58040: "guix style" puts closing parentheses on the wrong line
Date: Mon, 03 Oct 2022 00:12:40 +0200
Hi,

Maxime Devos <maximedevos <at> telenet.be> skribis:

> 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'.

Fixed in 4bd75d79e5ad8bb0f6cdcc0d15b9afb25f54afbd: ‘match-lambda*’ had
an incorrect special form declaration.

Thanks,
Ludo’.

[Message part 3 (message/rfc822, inline)]
From: Maxime Devos <maximedevos <at> telenet.be>
To: bug-guix <bug-guix <at> gnu.org>
Subject: "guix style" puts closing parentheses on the wrong line
Date: Sat, 24 Sep 2022 12:18:32 +0200
[Message part 4 (text/plain, inline)]
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.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

This bug report was last modified 2 years and 232 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.