From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:34059) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j13jS-0003wN-A4 for gwl-devel@gnu.org; Mon, 10 Feb 2020 02:43:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j13jQ-0006rS-UU for gwl-devel@gnu.org; Mon, 10 Feb 2020 02:43:50 -0500 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]:45014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j13jQ-0006qG-Q3 for gwl-devel@gnu.org; Mon, 10 Feb 2020 02:43:48 -0500 Received: by mail-qt1-x82c.google.com with SMTP id w8so4422368qts.11 for ; Sun, 09 Feb 2020 23:43:48 -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> In-Reply-To: <875zgfosvi.fsf@elephly.net> From: zimoun Date: Mon, 10 Feb 2020 08:43:36 +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 On Mon, 10 Feb 2020 at 07:31, Ricardo Wurmus wrote: > zimoun writes: > >> * It=E2=80=99s not possible to select more than one tagged item > >> > >> In my test workflow I=E2=80=99m generating a bunch of inputs by mapp= ing over > >> an argument list. Now the problem is that I can=E2=80=99t select al= l of these > >> inputs easily in a code snippet. With the syntax we have I can only > >> select the first item following a tag. > >> > >> To address this I=E2=80=99ve extended the accessor syntax, so this w= orks now: > >> > >> --8<---------------cut here---------------start------------->8--- > >> process frobnicate > >> packages "frobnicator" > >> inputs > >> . genome: "hg19.fa" > >> . samples: "a" "b" "c" > >> outputs > >> . "result" > >> # { > >> frobnicate -g {{inputs:genome}} --files {{inputs::samples}} > {{ou= tputs}} > >> } > >> --8<---------------cut here---------------end--------------->8--- > >> > >> Note how {{inputs::samples}} is substituted with =E2=80=9Ca b c=E2= =80=9D. With just a > >> single colon it would be just =E2=80=9Ca=E2=80=9D. Single colon =3D= single item; double > >> colon =3D more than one item. > > > > I am confused by the syntax. > > Well how to select the second element "b"? > > > > Naively, I would tempt to write {{inputs:samples:2}} or {{inputs::sampl= es:2}}. > > There=E2=80=99s no syntax for that because you can use good ol=E2=80=99 l= ist processing > (let=E2=80=99s call it =E2=80=9CListp=E2=80=9D, or perhaps =E2=80=9CLisp= =E2=80=9D=E2=80=A6) to work on this outside of > the code snippet. If I understand correctly, for such cases, 3 solutions: 1. manually split inputs . sample-1: "a" . sample-2: "b" . sample-3: "c" or 2. split elsewhere 'samples' using piece of Lisp or 3. use Lisp features inputs . sample-1: `(list-ref ,samples 1) . sample-2: `(list-ref ,samples 2) . sample-3: `(list-ref ,samples 3) Right? > My hope is that in-list access is much less common and could either be > rewritten to place the item of interest in the first place, or could be > solved with a let binding. It makes sense to me. All the best, simon