From: Otared Kavian <otared@gmail.com>
To: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>,
mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Question about building an array of values with Lua
Date: Thu, 24 Aug 2023 12:50:51 +0200 [thread overview]
Message-ID: <0D8E23FE-0CC5-4D07-AD38-566AF5F7326A@gmail.com> (raw)
In-Reply-To: <81c7dc1a-c6e9-3b4e-abba-f9ac574aad2a@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 835 bytes --]
> On 24 Aug 2023, at 06:03, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
>> […]
>
> I would drop the column check in this case.
>
> for i = 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
>
> Wolfgang
Indeed this is much more elegant… It feels so good to be on this list and learn from such insights :-)
Best regards: Otared
[-- Attachment #1.2: Type: text/html, Size: 2688 bytes --]
[-- Attachment #2: Type: text/plain, Size: 495 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2023-08-24 10:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 17:28 [NTG-context] " Fabrice Couvreur
2023-08-23 15:48 ` [NTG-context] " Wolfgang Schuster
2023-08-23 23:04 ` Otared Kavian
2023-08-24 4:03 ` Wolfgang Schuster
2023-08-24 10:50 ` Otared Kavian [this message]
2023-08-24 19:43 ` Wolfgang Schuster
2023-08-25 12:47 ` Fabrice Couvreur
2023-08-24 11:15 ` Fabrice Couvreur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0D8E23FE-0CC5-4D07-AD38-566AF5F7326A@gmail.com \
--to=otared@gmail.com \
--cc=ntg-context@ntg.nl \
--cc=wolfgang.schuster.lists@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).