ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Merging two lua tables
@ 2022-08-29 12:20 Aditya Mahajan via ntg-context
  2022-08-29 12:29 ` Aditya Mahajan via ntg-context
  2022-08-29 14:28 ` Hans Hagen via ntg-context
  0 siblings, 2 replies; 8+ messages in thread
From: Aditya Mahajan via ntg-context @ 2022-08-29 12:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Aditya Mahajan

Hi,

How do I merge two lua tables? I believe that table.merge or table.merged should do the trick, but I cannot figure out how to use them. 

``` 
local t1 = { 1, 2 }
local t2 = { 8, 9 }

local m1 = {}
table.merge(m1,t1, t2)
table.print(m1)

local m2 = table.merged(t1, t2)
table.print(m2)
```

Processing the file with context filename shows that both m1 and m2 are {8, 9}. What am I missing. 

Thanks,
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-30 10:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29 12:20 Merging two lua tables Aditya Mahajan via ntg-context
2022-08-29 12:29 ` Aditya Mahajan via ntg-context
2022-08-29 17:33   ` BPJ via ntg-context
2022-08-29 18:10     ` Hans Hagen via ntg-context
2022-08-30  8:56       ` BPJ via ntg-context
2022-08-30 10:08         ` BPJ via ntg-context
2022-08-29 14:28 ` Hans Hagen via ntg-context
2022-08-30  5:52   ` Aditya Mahajan via ntg-context

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).