Subject: bug#58040: closed (Re: bug#58040: "guix style" puts closing parentheses on the wrong line)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 02 Oct 2022 22:13:02 +0000

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 [email-masked].

-- 
58040: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58040
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#58040: "guix style" puts closing parentheses on the wrong line
From: Ludovic Courtès <[email-masked]>
To: Maxime Devos <[email-masked]>
Cc: [email-masked]
Date: Mon, 03 Oct 2022 00:12:40 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Maxime Devos <[email-masked]> 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’.

Subject: "guix style" puts closing parentheses on the wrong line
From: Maxime Devos <[email-masked]>
To: bug-guix <[email-masked]>
Date: Sat, 24 Sep 2022 12:18:32 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.