unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Philip McGrath <philip@philipmcgrath.com>, 67019@debbugs.gnu.org
Subject: [bug#67019] [PATCH 03/16] gnu: Add lessc.
Date: Thu, 16 Nov 2023 02:17:38 +0100	[thread overview]
Message-ID: <4d72986a039c897ba8a91c34fc1d9b7ef16d49dc.camel@gmail.com> (raw)
In-Reply-To: <13a1da53-4273-4ebf-aa58-4c23d1f5a641@philipmcgrath.com>

Hi,

Am Mittwoch, dem 15.11.2023 um 19:03 -0500 schrieb Philip McGrath:
> Hi,
> 
> On 11/15/23 15:23, Liliana Marie Prikler wrote:
> > Am Mittwoch, dem 15.11.2023 um 14:35 -0500 schrieb Philip McGrath:
> > > [...]
> > > 
> > > To clarify, do you mean vertical or horizontal?
> > I do mean horizontal.
> > 
> > [...]
>  >
> > > 
> > > I could also imagine breaking these lines:
> > > 
> > >   >> +                           (("scripts" @ . alist)
> > >   >> +                            `("scripts" @ ,@(map (match-
> > > lambda
> > > 
> > > instead as:
> > > 
> > >   >> +                           (("scripts"
> > >   >> +                             @ . alist)
> > >   >> +                            `("scripts"
> > >   >> +                              @ ,@(map (match-lambda
> > > 
> > > but that doesn't seem like much of an improvement to me.
> > But what about breaking lines before (match-lambda?  That ought to
> > at least give us enough to get (_ #f) onto a single line, no?
> > 
> 
> Maybe I'm confused: there isn't (_ #f) anywhere.
There was a (_ #t) in the filter, though :)
In any case, such trivial matches should fit onto one line imho.

> There is currently enough space to put (other other) on a single
> line, but I thought it was better style to put a newline between the
> match pattern and the expression, especially when the pattern is not
> _.
IMHO, this only makes sense for non-trivial replacements.  If you keep
some piece of data as-is, you more often than not don't want to draw
attention to this implementation detail by blowing up its size.

> Breaking before match-lambda gets enough space to put (cons "build" 
> new-build-script) on a single line, but I don't think it looks better
> overall:
> 
> >           (add-after 'do-not-target-es5 'patch-build-script
> >             (lambda args
> >               (define new-build-script
> >                 (string-join
> >                  `("esbuild"
> >                    "--platform=node"
> >                    "--format=cjs"
> >                    "--outdir=lib"
> >                    ,@(find-files "src/less" "\\.js$")
> >                    ,@(find-files "src/less-node" "\\.js$"))))
> >               (with-atomic-json-file-replacement "package.json"
> >                 (match-lambda
> >                   (('@ . alist)
> >                    (cons '@
> >                     (map
> >                      (match-lambda
> >                        (("scripts" @ . alist)
> >                         `("scripts" @ ,@(map
> >                                          (match-lambda
> >                                            (("build" . _)
> >                                             (cons "build" new-
> > build-script))
> >                                            (other
> >                                             other))
> >                                          alist)))
> >                        (other
> >                         other))
> >                      alist)))))))
> 
> Using delete in do-not-target-es5 does seem like a minor improvement:
> 
> >           (add-after 'avoid-parse-node-version 'do-not-target-es5
> >             (lambda args
> >               ;; esbuild can't compile all features to ES5
> >               (with-atomic-json-file-replacement "tsconfig.json"
> >                 (match-lambda
> >                   (('@ . alist)
> >                    (cons '@
> >                     (map (match-lambda
> >                            (("compilerOptions" '@ . alist)
> >                             `("scripts" @ ,@(delete '("target"
> > "ES5")
> >                                                     alist)))
> >                            (other
> >                             other))
> >                          alist)))))))
Fun fact, you could inline this delete into the "compilerOptions" line
– or sexp at least, by using (= (cute delete '("target" "ES5") <>)
options).  That being said, it's not necessary to do so; the delete you
currently have works fine.

Anyhow, since this isn't a clean alist, I'd use a different variable
name, perhaps "options"?

Cheers

  reply	other threads:[~2023-11-16  1:18 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 16:06 [bug#67019] [PATCH 00/16] gnu: Add KaTeX, lessc, and flow-remove-types Philip McGrath
2023-11-09 16:12 ` [bug#67019] [PATCH 01/16] gnu: Add node-is-what Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 02/16] gnu: Add node-copy-anything Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 03/16] gnu: Add lessc Philip McGrath
2023-11-11  0:56   ` Liliana Marie Prikler
2023-11-15 19:35     ` Philip McGrath
2023-11-15 20:23       ` Liliana Marie Prikler
2023-11-16  0:03         ` Philip McGrath
2023-11-16  1:17           ` Liliana Marie Prikler [this message]
2023-11-16  1:51             ` Philip McGrath
2023-11-16  7:18               ` Liliana Marie Prikler
2023-11-16 19:15               ` [bug#67019] [PATCH v2 00/16] gnu: Add KaTeX, lessc, and flow-remove-types Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 01/16] gnu: Add node-is-what Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 02/16] gnu: Add node-copy-anything Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 03/16] gnu: Add lessc Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 04/16] gnu: Add ocaml-wtf8 Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 05/16] gnu: Add ocaml-visitors Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 06/16] gnu: Add ocaml-ppx-gen-rec Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 07/16] gnu: Add ocaml-dtoa Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 08/16] gnu: Add node-vlq Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 09/16] gnu: Add ocaml-flow-parser Philip McGrath
2023-11-16 20:29                   ` Liliana Marie Prikler
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 10/16] gnu: Add node-flow-parser Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 11/16] gnu: Add flow-remove-types Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 12/16] gnu: js-commander: Update to 11.1.0 Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 13/16] gnu: js-commander: Install as a node module Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 14/16] gnu: Add mftrace Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 15/16] gnu: Add font-katex Philip McGrath
2023-11-16 19:15                 ` [bug#67019] [PATCH v2 16/16] gnu: Add katex Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 04/16] gnu: Add ocaml-wtf8 Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 05/16] gnu: Add ocaml-visitors Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 06/16] gnu: Add ocaml-ppx-gen-rec Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 07/16] gnu: Add ocaml-dtoa Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 08/16] gnu: Add node-vlq Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 09/16] gnu: Add ocaml-flow-parser Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 10/16] gnu: Add node-flow-parser Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 11/16] gnu: Add flow-remove-types Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 12/16] gnu: js-commander: Update to 11.1.0 Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 13/16] gnu: js-commander: Install as a node module Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 14/16] gnu: Add mftrace Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 15/16] gnu: Add font-katex Philip McGrath
2023-11-09 16:26 ` [bug#67019] [PATCH 16/16] gnu: Add katex Philip McGrath

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=4d72986a039c897ba8a91c34fc1d9b7ef16d49dc.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=67019@debbugs.gnu.org \
    --cc=philip@philipmcgrath.com \
    /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 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).