unofficial mirror of gwl-devel@gnu.org
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: gwl-devel@gnu.org
Subject: Re: Preparing for a new release
Date: Tue, 11 Feb 2020 00:43:12 +0100	[thread overview]
Message-ID: <CAJ3okZ38QaLowjrKB1zg0ONNOPALB1njEwWXbG7RFJK_Gj1hxA@mail.gmail.com> (raw)
In-Reply-To: <87zhdqnndg.fsf@elephly.net>

Hi,

On Mon, 10 Feb 2020 at 22:28, Ricardo Wurmus <rekado@elephly.net> wrote:

> > Right?
>
> That’s correct, but to directly access values in the “inputs” field,
> though, you’d have to use a let binding around the definition of the
> code snippet, which would be uglier.
>
> So ugly in fact that I decided to write this little procedure:

Wow! :-)


> --8<---------------cut here---------------start------------->8---
> ;; Simplify access to tagged items in lists.
> (define pick

[...]

>         ;; SRFI-1 accessors like "first"
>         ((procedure? n)
>          (n sub))

Cool!

>         (else (error "pick: Selector not supported.")))))))
> --8<---------------cut here---------------end--------------->8---
>
> Then I noticed that it’s really inconvenient to use let bindings inside
> of fields, so I changed the “make-process” macro to allow for
> definitions inside of the fields of a process.

Ok. Even I am a bit lost with all the changes.


> So you can do this now:
>
> --8<---------------cut here---------------start------------->8---
> process foo
>   inputs
>     . "something"
>     . samples: "a" "b" "c"
>   procedure
>     define second-sample
>       pick second samples: inputs
>     . # { echo {{second-sample}} }
> --8<---------------cut here---------------end--------------->8---
>
> Unfortunately, the leading dot sticks out like a wart here.  We could
> only drop it if I manage to rewrite the code-snippet value so that it
> really is a procedure that will return itself when applied to zero
> arguments…  It might be possible with some tinkering.

Hum? I trust you.

> (Note that you do need the “procedure” field name here; it can be left
> off only when the last value is a code-snippet.)

Ok. It makes sense.

Does this work?

 --8<---------------cut here---------------start------------->8---
 process foo
   inputs
     . "something"
     . samples: "a" "b" "c"
     # { echo {{(pick second inputs:samples)}} }
 --8<---------------cut here---------------end--------------->8---

or   # { echo {{(pick second samples: inputs)}} }

Because it is enough to usual needs, I guess.


Cheers,
simon

  reply	other threads:[~2020-02-10 23:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08 12:39 Preparing for a new release Ricardo Wurmus
2020-02-08 20:38 ` Kyle Meyer
2020-02-08 21:50   ` Ricardo Wurmus
2020-02-09 13:00     ` Ricardo Wurmus
2020-02-09 23:33       ` zimoun
2020-02-10  1:25         ` Kyle Meyer
2020-02-10  7:34           ` zimoun
2020-02-10  6:31         ` Ricardo Wurmus
2020-02-10  7:43           ` zimoun
2020-02-10 21:28             ` Ricardo Wurmus
2020-02-10 23:43               ` zimoun [this message]
2020-02-11  9:39                 ` Ricardo Wurmus
2020-02-11  9:34               ` Ricardo Wurmus
2020-02-11 15:37                 ` zimoun

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=CAJ3okZ38QaLowjrKB1zg0ONNOPALB1njEwWXbG7RFJK_Gj1hxA@mail.gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=gwl-devel@gnu.org \
    --cc=rekado@elephly.net \
    /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).