<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.hoggitworld.com/index.php?action=history&amp;feed=atom&amp;title=MIST_deepCopy</id>
		<title>MIST deepCopy - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.hoggitworld.com/index.php?action=history&amp;feed=atom&amp;title=MIST_deepCopy"/>
		<link rel="alternate" type="text/html" href="https://wiki.hoggitworld.com/index.php?title=MIST_deepCopy&amp;action=history"/>
		<updated>2026-04-30T00:41:27Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.hoggitworld.com/index.php?title=MIST_deepCopy&amp;diff=986&amp;oldid=prev</id>
		<title>Grimes at 22:50, 13 April 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.hoggitworld.com/index.php?title=MIST_deepCopy&amp;diff=986&amp;oldid=prev"/>
				<updated>2018-04-13T22:50:59Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Mission Scripting&lt;br /&gt;
&lt;br /&gt;
|fName= mist.utils.deepCopy|&lt;br /&gt;
&lt;br /&gt;
|vNum = Mist 1.0&lt;br /&gt;
&lt;br /&gt;
|desc= This function returns a &amp;quot;deep copy&amp;quot; of table, &amp;quot;deep&amp;quot; in that the copy recursively progresses down all &amp;quot;levels&amp;quot; of the table, and the copy shares the same metatables as the passed-in table. This function also correctly handles tables with cycles.  This function is quite often useful because tables are passed by reference in Lua, not by value. |&lt;br /&gt;
&lt;br /&gt;
|rtnType= table&lt;br /&gt;
&lt;br /&gt;
|reqType1= table&lt;br /&gt;
&lt;br /&gt;
|reqName1= table&lt;br /&gt;
&lt;br /&gt;
|reqType2=&lt;br /&gt;
&lt;br /&gt;
|optType1= &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|varExamples= any table&lt;br /&gt;
&lt;br /&gt;
|rtnExamples= same as input table&lt;br /&gt;
&lt;br /&gt;
|example= &amp;lt;code&amp;gt;&lt;br /&gt;
do&lt;br /&gt;
: newTable = mist.utils.deepCopy(originalTable)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|notes= This code is from [http://lua-users.org/wiki/CopyTable]. &lt;br /&gt;
&lt;br /&gt;
Explained Further in '''English''':  If a variable is declared to equal a table, Lua does not create a new table, it instead &lt;br /&gt;
creates a new reference for the table. So now you have two references to the same table and &lt;br /&gt;
of course, any change made to one reference will apply to the other reference. &lt;br /&gt;
mist.utils.deepCopy gets around this by creating an entirely new table that is effectively a &lt;br /&gt;
&amp;quot;clone&amp;quot; of the other table.&lt;br /&gt;
&lt;br /&gt;
|funcs= {{listOfMistUtils}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
[[Category: MIST|deepCopy ]]&lt;/div&gt;</summary>
		<author><name>Grimes</name></author>	</entry>

	</feed>