From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:45946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW0J3-00030T-Tj for gwl-devel@gnu.org; Wed, 29 May 2019 11:15:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hW0Iz-0006X8-Lq for gwl-devel@gnu.org; Wed, 29 May 2019 11:15:57 -0400 Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21386) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hW0Iw-0006Ck-4Z for gwl-devel@gnu.org; Wed, 29 May 2019 11:15:51 -0400 References: <87lg2atsxx.fsf@elephly.net> <87mumj0xzq.fsf@elephly.net> <87pnrez7zg.fsf@elephly.net> From: Ricardo Wurmus In-reply-to: Date: Wed, 29 May 2019 15:27:17 +0200 Message-ID: <87blzll7be.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: variable interpolation in code snippets 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: zimoun Cc: gwl-devel@gnu.org zimoun writes: > On Tue, 26 Feb 2019 at 20:05, Ricardo Wurmus wrote: >> >> Yes, I think this is pretty nice. I=E2=80=99ll aim for something like t= his: >> >> --8<---------------cut here---------------start------------->8--- >> process: foo >> data-inputs >> named-list >> foo =3D 1 >> bar =3D hello >> baz =3D world >> procedure # bash { cat {{data-inputs.foo}} {{data-inputs.bar}} } >> --8<---------------cut here---------------end--------------->8--- >> >> Haven=E2=80=99t thought much about it, but =E2=80=9Cnamed-list=E2=80=9D = (or whatever the final >> name) would introduce a let binding or something. > > Yes! > The "named-list" would be the name of the reader macro, right? > (joke: "named-list" is a better name than "xyz-list" ;-) I took a simpler route using keywords to tag or name items in a list. This works now: --8<---------------cut here---------------start------------->8--- process: foo data-inputs list #:foo 1 #:bar hello #:baz world procedure # bash { cat {{data-inputs:foo}} {{data-inputs:bar}} } --8<---------------cut here---------------end--------------->8--- You can choose to only tag one item if you want; it works just the same: --8<---------------cut here---------------start------------->8--- process: foo data-inputs list 1 #:bar hello world procedure # bash { echo {{data-inputs:bar}} } --8<---------------cut here---------------end--------------->8--- -- Ricardo