From: Jeong Dal <haksan@me.com>
To: ntg-context@ntg.nl
Subject: about table operation in lua-ConTeXt
Date: Mon, 13 Feb 2017 14:50:38 +0900 [thread overview]
Message-ID: <1869AF30-88A8-4A4F-9959-7E92E9A9DAB4@me.com> (raw)
In-Reply-To: <mailman.128.1486929767.14600.ntg-context@ntg.nl>
Dear all,
It may be a slight off topic.
In the following example, I copied a table “m” to “tempM”, and remove the last row of tempM.
Then the output is “ 2, 2”
I checked the contents of tempM and m and found that they are same even though I didn’t touch m.
I want to remove the last row of tempM while keeping the table m untouched.
Please tell me how to do it.
Thank you.
Best regards,
Dalyoung
\startbuffer[test]
\startluacode
m = {{0, 2, 4},{2, 3 , 4}, {2, 2, -6}}
local tempM = {}
tempM = m
table.remove(tempM)
context(#tempM, “, ” , #m)
\stopluacode
\stopbuffer
\starttext
getbuffer[test]
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next parent reply other threads:[~2017-02-13 5:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.128.1486929767.14600.ntg-context@ntg.nl>
2017-02-13 5:50 ` Jeong Dal [this message]
2017-02-13 8:54 ` Henri Menke
2017-02-13 8:56 ` Hans Hagen
2017-02-13 9:22 ` Procházka Lukáš Ing.
[not found] <mailman.1.1486983601.29608.ntg-context@ntg.nl>
2017-02-13 14:03 ` Jeong Dal
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=1869AF30-88A8-4A4F-9959-7E92E9A9DAB4@me.com \
--to=haksan@me.com \
--cc=ntg-context@ntg.nl \
/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).