From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/111120 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio" Newsgroups: gmane.comp.tex.context Subject: \processassignmentlist inside a \setup... or related Date: Mon, 19 Apr 2021 21:23:19 -0500 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4659805587027117791==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26542"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 20 04:24:13 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYg3h-0006o1-0K for gctc-ntg-context-518@m.gmane-mx.org; Tue, 20 Apr 2021 04:24:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B574B281430; Tue, 20 Apr 2021 04:23:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sgHHKDROH8xh; Tue, 20 Apr 2021 04:23:37 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AE8152829F1; Tue, 20 Apr 2021 04:23:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 43F872829ED for ; Tue, 20 Apr 2021 04:23:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f49WdbQvLt_z for ; Tue, 20 Apr 2021 04:23:31 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.42; helo=mail-wm1-f42.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 803FF281430 for ; Tue, 20 Apr 2021 04:23:31 +0200 (CEST) Original-Received: by mail-wm1-f42.google.com with SMTP id y124-20020a1c32820000b029010c93864955so21635995wmy.5 for ; Mon, 19 Apr 2021 19:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=TJjgc0hd3E0US8ZBkc9j1tsaMYyQnBCCgcA7r3ZARG8=; b=bcgE2txORlzysm8Gn1ICSrRaF4rqQlq9tmiRFO+3nVuSmHljLxC7aPTFzA7I/OdG/P 6gaWJ9yCjHtDVFFsFkLwkVCNry0GUMjYPOnBHUURUHrVsdG8+9+LuzJMh1broyF/Dp/k uHdI7k6L8QACLzdi5gRVfM6cSp57rLxqA61+6wUHcht2QCLRwCkjA1gesZ+7Ma17od1X NxgNtcS0IHy2N7ChWhBIaFcPKAHK6FukhlN86RH35fxPEuhUYLOPRXC2OS8cYhFPtEH+ CJ941lX8vQPSP+5B4xoj2bZ0CG7dfggzlZ7FtggvyqxR4Mx8FqyO+jw98mHu/dUoerzY xWGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=TJjgc0hd3E0US8ZBkc9j1tsaMYyQnBCCgcA7r3ZARG8=; b=OI6eNNT6FLKdaDkMzSiYbKxTAuDCdYChvQm7OIOMofwcD8uGN2tVMQzo4wStvMEcUD J1iKA5XG48bInpzO+6ATa3mJ82t6s2hHIUl7h6qoVB2ETMSTZnoILkUs6fbkO4RUwMja PEZNpE2QmrjYo9R4CR6BuHmpXHrwh+n6Or3qUhR5oFHdQWrFIvzsnPsKeVAJKjmFiv3z HCRsoBRyC5c8H05yBsMozSgCYvf+KRJvpYggi2OwCWj/oHCCngC2LgqXUyTSOkbT1mgq QeeM4s8nCK73rC5WG3jcGpxKbhwxcN545ZNWqrHfB8kFmC4coGOC9fth6iShDG0sHX6b uCKw== X-Gm-Message-State: AOAM53153Ju2YxUwd7pzia+jbXqA0YdaCU4CBUS8gfyM4BPv0ri+ZWfR Y4d3/6BhCZ7ftVMgXO3al3V8ry1vYBSCw67S+PyBSocTNDE= X-Google-Smtp-Source: ABdhPJyppuGau86UNKPEK+g/+PqWHlUT5hfRz3ffojdStgov3cOgVUEcxhJGhF3lEhisBtITuNbfCvvXRFga/vdc1xU= X-Received: by 2002:a05:600c:649:: with SMTP id p9mr1947637wmm.47.1618885410898; Mon, 19 Apr 2021 19:23:30 -0700 (PDT) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:111120 Archived-At: --===============4659805587027117791== Content-Type: multipart/alternative; boundary="000000000000d946f105c05e2174" --000000000000d946f105c05e2174 Content-Type: text/plain; charset="UTF-8" Hi, list! I hope my example shows clearly enough what I intend to do: \startluacode userdata = userdata or {} userdata.mydata = {} local function registermydata(data,...) table.insert(userdata.mydata, data) end interfaces.implement{ name = "registermydata", arguments = "2 strings", actions = registermydata } \stopluacode \unprotect \def\mysetups[#1]% {\getdummyparameters[#1]% \processassignmentlist[#1]\clf_registermydata} \protect \starttext \mysetups[love=nice,hate=awful]% \dummyparameter{love} \cldcontext{userdata.mydata[2]} \stoptext What I want to know is if there's a less hackish way to pass keys (yep, only keys, not values) to Lua using \getdummyparameters (actually I'm using an user-defined \setupsomething, but it's more or less the same) and \processassignmentlist. Is it possible, for instance, to automatically pass a key to Lua when it's set in \setupsomething? Thanks in advance. Jairo PS: Sorry if I missed something in the test suite again --000000000000d946f105c05e2174 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, list! I hope my example shows clearly enough what I in= tend to do:

\startluacode<= /p>

userdata =3D u= serdata or {}

userdata.mydat= a =3D {}


local function= registermydata(data,...)

table.insert(= userdata.mydata, data)

end


interfaces.imp= lement{

name =3D &quo= t;registermydata",

arguments =3D= "2 strings",

actions =3D r= egistermydata

}

\stopluacode


\unprotect

\def\mysetups[= #1]%

{\getdummypar= ameters[#1]%

\processassi= gnmentlist[#1]\clf_registermydata}

\protect

\starttext

\mysetups[love= =3Dnice,hate=3Dawful]%


\dummyparamete= r{love}


\cldcontext{us= erdata.mydata[2]}

\stoptext
<= br>

What I = want to know is if there's a less hackish way to pass keys (yep, only k= eys, not values) to Lua using \getdummyparameters (actually I'm using a= n user-defined \setupsomething, but it's more or less the same) and \pr= ocessassignmentlist. Is it possible, for instance, to automatically pass a = key to Lua when it's set in \setupsomething? Thanks in advance.

=

Jairo
<= br>

PS: Sor= ry if I missed something in the test suite again

--000000000000d946f105c05e2174-- --===============4659805587027117791== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============4659805587027117791==--