From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48573) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1IiD-0005DV-PD for gwl-devel@gnu.org; Mon, 10 Feb 2020 18:43:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1Ii8-0007nG-Sd for gwl-devel@gnu.org; Mon, 10 Feb 2020 18:43:32 -0500 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:45477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1Ii7-0007iH-3R for gwl-devel@gnu.org; Mon, 10 Feb 2020 18:43:28 -0500 Received: by mail-qk1-x733.google.com with SMTP id a2so7924626qko.12 for ; Mon, 10 Feb 2020 15:43:26 -0800 (PST) MIME-Version: 1.0 References: <87h801p818.fsf@elephly.net> <87h800u84z.fsf@kyleam.com> <87a75spx3i.fsf@elephly.net> <877e0vq5iy.fsf@elephly.net> <875zgfosvi.fsf@elephly.net> <87zhdqnndg.fsf@elephly.net> In-Reply-To: <87zhdqnndg.fsf@elephly.net> From: zimoun Date: Tue, 11 Feb 2020 00:43:12 +0100 Message-ID: Subject: Re: Preparing for a new release Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+kyle=kyleam.com@gnu.org Sender: "gwl-devel" To: Ricardo Wurmus Cc: gwl-devel@gnu.org Hi, On Mon, 10 Feb 2020 at 22:28, Ricardo Wurmus wrote: > > Right? > > That=E2=80=99s correct, but to directly access values in the =E2=80=9Cinp= uts=E2=80=9D field, > though, you=E2=80=99d 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=E2=80=99s really inconvenient to use let bindings = inside > of fields, so I changed the =E2=80=9Cmake-process=E2=80=9D 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=E2=80=A6 It might be possible with some tinkering. Hum? I trust you. > (Note that you do need the =E2=80=9Cprocedure=E2=80=9D field name here; i= t 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