unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58040: "guix style" puts closing parentheses on the wrong line
@ 2022-09-24 10:18 Maxime Devos
  2022-10-02 22:12 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Devos @ 2022-09-24 10:18 UTC (permalink / raw)
  To: 58040


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#58040: "guix style" puts closing parentheses on the wrong line
  2022-09-24 10:18 bug#58040: "guix style" puts closing parentheses on the wrong line Maxime Devos
@ 2022-10-02 22:12 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2022-10-02 22:12 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 58040-done

Hi,

Maxime Devos <maximedevos@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’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-02 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24 10:18 bug#58040: "guix style" puts closing parentheses on the wrong line Maxime Devos
2022-10-02 22:12 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

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