From: Ricardo Wurmus <rekado@elephly.net>
To: Olivier Dion <olivier.dion@polymtl.ca>
Cc: gwl-devel@gnu.org
Subject: Re: [PATCH 1/3] gwl/ui: Check for log-events configuration
Date: Sun, 12 Jun 2022 11:08:31 +0200 [thread overview]
Message-ID: <87mtei1c12.fsf@elephly.net> (raw)
In-Reply-To: <20220606194900.27725-1-olivier.dion@polymtl.ca>
Olivier Dion <olivier.dion@polymtl.ca> writes:
> Some GWL sub-commands might not accept the log-events switch.
> This results in returning `#f' from `(%config 'log-events)'
>
> Fix this by checking that 'log-events was configured. Also memoize the result.
[…]
> +(define print?
> + (mlambdaq (type)
> + (let ((log-events (%config 'log-events)))
> + (and log-events
> + (or (member 'all log-events)
> + (member type log-events))
> + #t))))
> +
You don’t need the #t at the end of the “and”; the previous two values
are already “truthy” or “falsy”.
You could also do this:
(and=> (%config 'log-events)
(lambda (log-events)
(or (member 'all log-events)
(member type log-events))))
--
Ricardo
prev parent reply other threads:[~2022-06-12 9:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 18:32 [PATCH] gwl/ui: Check for log-events configuration Olivier Dion
2022-06-04 15:00 ` Ricardo Wurmus
2022-06-04 15:10 ` Olivier Dion via
2022-06-06 10:32 ` Ricardo Wurmus
2022-06-06 13:25 ` Olivier Dion via
2022-06-06 18:51 ` Olivier Dion via
2022-06-06 19:48 ` [PATCH 1/3] " Olivier Dion
2022-06-06 19:48 ` [PATCH 2/3] gwl/config: Share log-event switch with subcommands Olivier Dion
2022-06-12 9:03 ` Ricardo Wurmus
2022-06-06 19:49 ` [PATCH 3/3] graph: Add output switch Olivier Dion
2022-06-12 9:05 ` Ricardo Wurmus
2022-06-12 9:08 ` Ricardo Wurmus [this message]
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://www.guixwl.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mtei1c12.fsf@elephly.net \
--to=rekado@elephly.net \
--cc=gwl-devel@gnu.org \
--cc=olivier.dion@polymtl.ca \
/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.
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).