From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19658 invoked from network); 24 Aug 2023 10:52:33 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 24 Aug 2023 10:52:33 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id ED687482CEC for ; Thu, 24 Aug 2023 12:51:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23TJ3aOJbG1u for ; Thu, 24 Aug 2023 12:51:42 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 2F23A482BFC for ; Thu, 24 Aug 2023 12:51:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E1E5348271E for ; Thu, 24 Aug 2023 12:50:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Bbxpj462-3g for ; Thu, 24 Aug 2023 12:50:53 +0200 (CEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 5AAA24824ED for ; Thu, 24 Aug 2023 12:50:53 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-3fea0640d7aso64380935e9.0 for ; Thu, 24 Aug 2023 03:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692874253; x=1693479053; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :from:to:cc:subject:date:message-id:reply-to; bh=n8bVUuGPtze6lrtZR2Isa3F+CwNYqOFPG6pol5cbcks=; b=cRwXgWWXeCLH00UOyus68O2Epe8YrZMrOrNZtfUOqUZc3DQ+XLAhY760CRbDCEIn15 COrR1uPRbfaw0nxq2iafea3CoYZ6lCuue4spp7v9lmTfri/x9Cd92chV3rxy6Tysvdrz 9CIpSy/fAk08G7aNo6uxLkk6eCssR2hkpjc0uoxKSgZGEB39YdZ0XA1euZ9CIEZMV0dl xy7rbNpxwJJy5Zu9epaI93KcgGXqY6XiBX+ochtBTDzuqyYPTyI6qw2G2pCPf5LzmkyX 3MZ6Z/ya/AXlUu0EpuGUuQMzE655DalnYFgBcPH0ymIUdlPN+r6EMfIptIDrHHTlOez6 3eSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692874253; x=1693479053; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=n8bVUuGPtze6lrtZR2Isa3F+CwNYqOFPG6pol5cbcks=; b=DeRQRJc0wSE7SgzkFi7sukRoQpTcmeuu4ggKK3r39mjjCfuwmHqRWOVU9oJF5zFsin iwwsCEkQ8liHOPJojuq5XOb+aldLcRLOJKlyNTCsCz3l1Rx2f6754ONOoZkUrvvHPCgK G5z4HpReqH3cHtpwV7BsRUJSQyLa457yuh5StQDbrvzRTq2c7s232WrjYDsiVQYBcJXX OKueuYgW09dnyTSrE4a3qCs8SQg8q4NOcBsKjuZeE6OJ2/Q2yx4LTEOYDc1pc+edA18s NMHzdZ63o4pVxyOC1aenkzcGt5sYm+c3mJmQCXcPVwt17TPxw8TJC0ghdI6qXQQ3Xv6U Mw1g== X-Gm-Message-State: AOJu0YyXGkHyOssEAiym0AXgwfMNNvaolO+cs/ZQy9MH4fmmG4krDuhP 5IpZriRJXGdhQMx1EvyK0kyORhQKQILveQ== X-Google-Smtp-Source: AGHT+IHGGOsUYvrxyy6IIWJxrWKNqKXT+4EJCFSJ60xwA5kXBP29aOBtxS4Y9+byPS8w8SNvS2+Lyw== X-Received: by 2002:a05:6000:1807:b0:309:1532:8287 with SMTP id m7-20020a056000180700b0030915328287mr11074236wrh.19.1692874252539; Thu, 24 Aug 2023 03:50:52 -0700 (PDT) Received: from smtpclient.apple (2a01cb00879d24000ccc6a72f6dd80f8.ipv6.abo.wanadoo.fr. [2a01:cb00:879d:2400:ccc:6a72:f6dd:80f8]) by smtp.gmail.com with ESMTPSA id s5-20020adff805000000b003143cb109d5sm21869485wrp.14.2023.08.24.03.50.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Aug 2023 03:50:52 -0700 (PDT) From: Otared Kavian Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Date: Thu, 24 Aug 2023 12:50:51 +0200 References: <81c7dc1a-c6e9-3b4e-abba-f9ac574aad2a@gmail.com> To: Wolfgang Schuster , mailing list for ConTeXt users In-Reply-To: <81c7dc1a-c6e9-3b4e-abba-f9ac574aad2a@gmail.com> Message-Id: <0D8E23FE-0CC5-4D07-AD38-566AF5F7326A@gmail.com> X-Mailer: Apple Mail (2.3654.120.0.1.15) Message-ID-Hash: NGHIGWO2C4MKVEPS23TJ7XSR7O2W46LL X-Message-ID-Hash: NGHIGWO2C4MKVEPS23TJ7XSR7O2W46LL X-MailFrom: otared@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Question about building an array of values with Lua List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============3066004019062186038==" --===============3066004019062186038== Content-Type: multipart/alternative; boundary="Apple-Mail=_6A87D685-BB9A-46B3-BD8D-0604EDA31A4C" --Apple-Mail=_6A87D685-BB9A-46B3-BD8D-0604EDA31A4C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 24 Aug 2023, at 06:03, Wolfgang Schuster = wrote: >> [=E2=80=A6] >=20 > I would drop the column check in this case. >=20 > for i =3D 0,9 do > context.startxrow() > context.startxcell() > context(i) > context.stopxcell() > context.startxcell() > context(math.mod(i*i,10)) > context.stopxcell() > context.startxcell() > context(i) > context.stopxcell() > context.startxcell() > context(math.mod(2*i*i,10)) > context.stopxcell() > context.stopxrow() > end >=20 > Wolfgang Indeed this is much more elegant=E2=80=A6 It feels so good to be on this = list and learn from such insights :-) Best regards: Otared= --Apple-Mail=_6A87D685-BB9A-46B3-BD8D-0604EDA31A4C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On = 24 Aug 2023, at 06:03, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
[=E2=80=A6]

I would drop the column check in this case.

    for i =3D 0,9 do
        context.startxrow()
            = context.startxcell()
=             &n= bsp;   context(i)
            = context.stopxcell()
            = context.startxcell()
=             &n= bsp;   context(math.mod(i*i,10))
            = context.stopxcell()
            = context.startxcell()
=             &n= bsp;   context(i)
            = context.stopxcell()
            = context.startxcell()
=             &n= bsp;   context(math.mod(2*i*i,10))
            = context.stopxcell()
        context.stopxrow()
    end

Wolfgang


Indeed this is much more = elegant=E2=80=A6 It feels so good to be on this list and learn from such = insights :-)

Best = regards: Otared
= --Apple-Mail=_6A87D685-BB9A-46B3-BD8D-0604EDA31A4C-- --===============3066004019062186038== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________ --===============3066004019062186038==--