"guix style" puts closing parentheses on the wrong line

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Maxime Devos
Owner
unassigned
Submitted by
Maxime Devos
Severity
normal
M
M
Maxime Devos wrote on 24 Sep 2022 12:18
(name . bug-guix)(address . bug-guix@gnu.org)
71826703-ee1d-b353-7b3f-f5a5d37c3125@telenet.be
Hi,
Putting the following definition into a file a.scm (from
(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: OpenPGP_signature
L
L
Ludovic Courtès wrote on 3 Oct 2022 00:12
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 58040-done@debbugs.gnu.org)
871qrpan8n.fsf@gnu.org
Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (17 lines)
> 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’.
Closed
?