<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=Locals</id>
	<title>Locals - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=Locals"/>
	<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Locals&amp;action=history"/>
	<updated>2026-04-11T20:47:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Locals&amp;diff=525&amp;oldid=prev</id>
		<title>JoeStrout: Created page with &quot;'''locals''' is a reference to the set of local variables.  It's a map where each key is an identifier string, and the value is the value of that variable.  Because assignment...&quot;</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Locals&amp;diff=525&amp;oldid=prev"/>
		<updated>2020-06-03T15:23:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;locals&amp;#039;&amp;#039;&amp;#039; is a reference to the set of local variables.  It&amp;#039;s a map where each key is an identifier string, and the value is the value of that variable.  Because assignment...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''locals''' is a reference to the set of local variables.  It's a map where each key is an identifier string, and the value is the value of that variable.&lt;br /&gt;
&lt;br /&gt;
Because assignments and identifier look-up always try local variables first anyway, explicit use of the '''locals''' function is rarely needed.&lt;br /&gt;
&lt;br /&gt;
One common use in [[Mini Micro]] is to tell whether an [[import]] module is being actually being run as the main program.  In such a case, it will be true that &amp;lt;msinline&amp;gt;locals == globals&amp;lt;/msinline&amp;gt; at the file scope (i.e. not inside any explicitly defined function).  For examples, look at the bottom of any module in '''/sys/lib'''; when loaded and run directly, these modules run unit tests or otherwise do something useful.&lt;br /&gt;
&lt;br /&gt;
See also: [[globals]], [[outer]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
[[Category:Intrinsic Functions]]&lt;/div&gt;</summary>
		<author><name>JoeStrout</name></author>
		
	</entry>
</feed>