<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://miniscript.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Marc+Gurevitx</id>
	<title>MiniScript Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://miniscript.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Marc+Gurevitx"/>
	<link rel="alternate" type="text/html" href="http://miniscript.org/wiki/Special:Contributions/Marc_Gurevitx"/>
	<updated>2026-04-17T18:45:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Key&amp;diff=1231</id>
		<title>Key</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Key&amp;diff=1231"/>
		<updated>2024-07-17T09:38:34Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[Mini Micro]], the &amp;lt;msinline&amp;gt;key&amp;lt;/msinline&amp;gt; module is a small collection of functions related to detecting the keyboard state and handling the keyboard input buffer, as well as interfacing with button inputs on joystick/gamepad devices.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| [[key.available]] || check whether there is a keypress in the input buffer&lt;br /&gt;
|-&lt;br /&gt;
| [[key.get]] || pull the next key out of the input buffer (waiting if necessary)&lt;br /&gt;
|-&lt;br /&gt;
| [[key.put]](keyChar) || allows you to enqueue a string, or single character by code point, into the keyboard buffer&lt;br /&gt;
|-&lt;br /&gt;
| [[key.clear]] || clear the input buffer&lt;br /&gt;
|-&lt;br /&gt;
| [[key.pressed]](keyName=&amp;quot;space&amp;quot;) || check whether a specific key is currently down&lt;br /&gt;
|-&lt;br /&gt;
| [[key.keyNames]] || get list of all possible names for [[key.pressed]]&lt;br /&gt;
|-&lt;br /&gt;
| [[key.axis]](axis=&amp;quot;Horizontal&amp;quot;) || get value (-1 to 1) of an analog input axis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See also: [[input]]; [[mouse]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;br /&gt;
[[Category:Soda]]&lt;br /&gt;
[[Category:Farmtronics]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Key&amp;diff=1230</id>
		<title>Key</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Key&amp;diff=1230"/>
		<updated>2024-07-17T05:14:59Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: + key.put&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[Mini Micro]], the &amp;lt;msinline&amp;gt;key&amp;lt;/msinline&amp;gt; module is a small collection of functions related to detecting the keyboard state and handling the keyboard input buffer, as well as interfacing with button inputs on joystick/gamepad devices.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| [[key.available]] || check whether there is a keypress in the input buffer&lt;br /&gt;
|-&lt;br /&gt;
| [[key.get]] || pull the next key out of the input buffer (waiting if necessary)&lt;br /&gt;
|-&lt;br /&gt;
| [[key.put]] || allows you to enqueue a string, or single character by code point, into the keyboard buffer&lt;br /&gt;
|-&lt;br /&gt;
| [[key.clear]] || clear the input buffer&lt;br /&gt;
|-&lt;br /&gt;
| [[key.pressed]](keyName=&amp;quot;space&amp;quot;) || check whether a specific key is currently down&lt;br /&gt;
|-&lt;br /&gt;
| [[key.keyNames]] || get list of all possible names for [[key.pressed]]&lt;br /&gt;
|-&lt;br /&gt;
| [[key.axis]](axis=&amp;quot;Horizontal&amp;quot;) || get value (-1 to 1) of an analog input axis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See also: [[input]]; [[mouse]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;br /&gt;
[[Category:Soda]]&lt;br /&gt;
[[Category:Farmtronics]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=RawData&amp;diff=1221</id>
		<title>RawData</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=RawData&amp;diff=1221"/>
		<updated>2024-05-15T10:58:50Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Examples */ + Convert string -&amp;gt; RawData&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;c&amp;gt;RawData&amp;lt;/c&amp;gt; class in [[Mini Micro]] represents a buffer of raw bytes.  Interpretation of these bytes is entirely up to the programmer.&lt;br /&gt;
&lt;br /&gt;
See also: [[file.loadRaw]], [[file.saveRaw]]&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property Name !! Type !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;littleEndian&amp;lt;/c&amp;gt; || number (boolean) || [[true]] || whether multi-byte values are stored with least significant byte first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;len&amp;lt;/c&amp;gt; || returns the length of the raw data buffer, in bytes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.resize|resize]](''bytes=32'')&amp;lt;/c&amp;gt; || change the size of the raw data buffer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.byte|byte]](''self, offset=0'')&amp;lt;/c&amp;gt; || get one unsigned byte of data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setByte|setByte]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set one unsigned byte value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.sbyte|sbyte]](''self, offset=0'')&amp;lt;/c&amp;gt; || get one signed byte of data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setSbyte|setSbyte]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set one signed byte value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.ushort|ushort]](''self, offset=0'')&amp;lt;/c&amp;gt; || get an unsigned 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUshort|setUshort]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set an unsigned 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.short|short]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a signed 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setShort|setShort]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a signed 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.uint|uint]](''self, offset=0'')&amp;lt;/c&amp;gt; || get an unsigned 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUint|setUint]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set an unsigned 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.int|int]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a signed 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setInt|setInt]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a signed 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.float|float]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a 32-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setFloat|setFloat]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a 32-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.double|double]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a 64-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setDouble|setDouble]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a 64-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.utf8|utf8]](''self, offset=0, bytes=-1'')&amp;lt;/c&amp;gt; || get a string of ASCII or UTF-8 text&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUtf8|setUtf8]](''self, offset=0, value=&amp;quot;&amp;quot;'')&amp;lt;/c&amp;gt; || set a string as UTF-8; return number of bytes written&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
The getter and setter methods accept &amp;lt;c&amp;gt;offset&amp;lt;/c&amp;gt; argument which, as with [[string]] and [[list]] indexing, may be &amp;lt;c&amp;gt;0 .. (len-1)&amp;lt;/c&amp;gt; or &amp;lt;c&amp;gt;-len .. -1&amp;lt;/c&amp;gt; where the negative indexes mean offset from the end of data.&lt;br /&gt;
&lt;br /&gt;
If offset (positive or negative) is out of range, an &amp;lt;c&amp;gt;IndexError&amp;lt;/c&amp;gt; is raised. Same error is raised if the span of read or written bytes go beyond the data boundaries, with the exception of &amp;lt;c&amp;gt;.setUtf8&amp;lt;/c&amp;gt; that writes as much of its string value as possible and drops the rest.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
r = new RawData  // Create new RawData of zero length&lt;br /&gt;
&lt;br /&gt;
r.resize 100  // resize it before writing and reading data&lt;br /&gt;
&lt;br /&gt;
r.setByte 42, 200&lt;br /&gt;
&lt;br /&gt;
print r.sbyte(42)  // prints: -56&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Converting a string to RawData ====&lt;br /&gt;
&lt;br /&gt;
There's no easy way to know how big a string will be in bytes, but it should be less than (or equal to) 4 times the length.  So start with a buffer equal to 4 times s.len, and then after you setUtf8 you can get the actual byte count, and resize your rawData down to size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
r = new RawData&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;ॐ मणि पद्मे हूँ&amp;quot;&lt;br /&gt;
&lt;br /&gt;
r.resize s.len * 4&lt;br /&gt;
&lt;br /&gt;
r.resize r.setUtf8(0, s)&lt;br /&gt;
&lt;br /&gt;
print r.utf8 == &amp;quot;ॐ मणि पद्मे हूँ&amp;quot;  // prints: 1&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Key.axis&amp;diff=1211</id>
		<title>Key.axis</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Key.axis&amp;diff=1211"/>
		<updated>2024-04-25T15:39:37Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Arguments */ +smoothed param&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;[[key]].axis&amp;lt;/c&amp;gt; returns the numeric value (from -1 to 1) of an input axis (for example, a joystick horizontal or vertical axis).&lt;br /&gt;
&lt;br /&gt;
See also: [[key.pressed]]; [[How to move a sprite with directional inputs]]&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Type !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ''axisName'' || string || Horizontal || name of axis to get&lt;br /&gt;
|-&lt;br /&gt;
| ''smoothed'' || boolean || 1 || if true, return smoothed values to make the input a little more joystick-like; otherwise, return either &amp;lt;c&amp;gt;-1&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;0&amp;lt;/c&amp;gt; or &amp;lt;c&amp;gt;1&amp;lt;/c&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
Available axis names are:&lt;br /&gt;
* &amp;quot;Horizontal&amp;quot; and &amp;quot;Vertical&amp;quot;, which can be activated by both WASD and arrow keys as well as any joystick or gamepad&lt;br /&gt;
* &amp;quot;Mouse X&amp;quot;, &amp;quot;Mouse Y&amp;quot;, and &amp;quot;Mouse ScrollWheel&amp;quot;, which reflect movement/scrolling with the mouse&lt;br /&gt;
* &amp;quot;JoyAxis1&amp;quot; through &amp;quot;JoyAxis29&amp;quot; which detect axis inputs from any joystick or gamepad&lt;br /&gt;
* &amp;quot;Joy1Axis1&amp;quot; through &amp;quot;Joy8Axis29&amp;quot; which detect axis inputs from specific joystick/gamepad 1 through 8.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;print key.axis(&amp;quot;Vertical&amp;quot;)&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A bigger example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;sp = new Sprite&lt;br /&gt;
sp.image = file.loadImage(&amp;quot;/sys/pics/Wumpus.png&amp;quot;)&lt;br /&gt;
display(4).sprites.push sp&lt;br /&gt;
speed = 10  // pixels per frame&lt;br /&gt;
while true&lt;br /&gt;
	sp.x = sp.x + key.axis(&amp;quot;Horizontal&amp;quot;) * speed&lt;br /&gt;
	sp.y = sp.y + key.axis(&amp;quot;Vertical&amp;quot;) * speed&lt;br /&gt;
	yield&lt;br /&gt;
end while&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=RawData&amp;diff=1210</id>
		<title>RawData</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=RawData&amp;diff=1210"/>
		<updated>2024-04-15T19:17:25Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: + Examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;c&amp;gt;RawData&amp;lt;/c&amp;gt; class in [[Mini Micro]] represents a buffer of raw bytes.  Interpretation of these bytes is entirely up to the programmer.&lt;br /&gt;
&lt;br /&gt;
See also: [[file.loadRaw]], [[file.saveRaw]]&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property Name !! Type !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;littleEndian&amp;lt;/c&amp;gt; || number (boolean) || [[true]] || whether multi-byte values are stored with least significant byte first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;len&amp;lt;/c&amp;gt; || returns the length of the raw data buffer, in bytes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.resize|resize]](''bytes=32'')&amp;lt;/c&amp;gt; || change the size of the raw data buffer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.byte|byte]](''self, offset=0'')&amp;lt;/c&amp;gt; || get one unsigned byte of data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setByte|setByte]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set one unsigned byte value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.sbyte|sbyte]](''self, offset=0'')&amp;lt;/c&amp;gt; || get one signed byte of data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setSbyte|setSbyte]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set one signed byte value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.ushort|ushort]](''self, offset=0'')&amp;lt;/c&amp;gt; || get an unsigned 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUshort|setUshort]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set an unsigned 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.short|short]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a signed 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setShort|setShort]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a signed 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.uint|uint]](''self, offset=0'')&amp;lt;/c&amp;gt; || get an unsigned 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUint|setUint]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set an unsigned 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.int|int]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a signed 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setInt|setInt]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a signed 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.float|float]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a 32-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setFloat|setFloat]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a 32-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.double|double]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a 64-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setDouble|setDouble]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a 64-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.utf8|utf8]](''self, offset=0, bytes=-1'')&amp;lt;/c&amp;gt; || get a string of ASCII or UTF-8 text&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUtf8|setUtf8]](''self, offset=0, value=&amp;quot;&amp;quot;'')&amp;lt;/c&amp;gt; || set a string as UTF-8; return number of bytes written&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
The getter and setter methods accept &amp;lt;c&amp;gt;offset&amp;lt;/c&amp;gt; argument which, as with [[string]] and [[list]] indexing, may be &amp;lt;c&amp;gt;0 .. (len-1)&amp;lt;/c&amp;gt; or &amp;lt;c&amp;gt;-len .. -1&amp;lt;/c&amp;gt; where the negative indexes mean offset from the end of data.&lt;br /&gt;
&lt;br /&gt;
If offset (positive or negative) is out of range, an &amp;lt;c&amp;gt;IndexError&amp;lt;/c&amp;gt; is raised. Same error is raised if the span of read or written bytes go beyond the data boundaries, with the exception of &amp;lt;c&amp;gt;.setUtf8&amp;lt;/c&amp;gt; that writes as much of its string value as possible and drops the rest.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
r = new RawData  // Create new RawData of zero length&lt;br /&gt;
&lt;br /&gt;
r.resize 100  // resize it before writing and reading data&lt;br /&gt;
&lt;br /&gt;
r.setByte 42, 200&lt;br /&gt;
&lt;br /&gt;
print r.sbyte(42)  // prints: -56&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=RawData&amp;diff=1209</id>
		<title>RawData</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=RawData&amp;diff=1209"/>
		<updated>2024-04-15T19:09:27Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Methods */ + about offset&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;c&amp;gt;RawData&amp;lt;/c&amp;gt; class in [[Mini Micro]] represents a buffer of raw bytes.  Interpretation of these bytes is entirely up to the programmer.&lt;br /&gt;
&lt;br /&gt;
See also: [[file.loadRaw]], [[file.saveRaw]]&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property Name !! Type !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;littleEndian&amp;lt;/c&amp;gt; || number (boolean) || [[true]] || whether multi-byte values are stored with least significant byte first&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;len&amp;lt;/c&amp;gt; || returns the length of the raw data buffer, in bytes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.resize|resize]](''bytes=32'')&amp;lt;/c&amp;gt; || change the size of the raw data buffer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.byte|byte]](''self, offset=0'')&amp;lt;/c&amp;gt; || get one unsigned byte of data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setByte|setByte]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set one unsigned byte value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.sbyte|sbyte]](''self, offset=0'')&amp;lt;/c&amp;gt; || get one signed byte of data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setSbyte|setSbyte]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set one signed byte value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.ushort|ushort]](''self, offset=0'')&amp;lt;/c&amp;gt; || get an unsigned 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUshort|setUshort]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set an unsigned 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.short|short]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a signed 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setShort|setShort]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a signed 16-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.uint|uint]](''self, offset=0'')&amp;lt;/c&amp;gt; || get an unsigned 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUint|setUint]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set an unsigned 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.int|int]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a signed 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setInt|setInt]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a signed 32-bit integer value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.float|float]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a 32-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setFloat|setFloat]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a 32-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.double|double]](''self, offset=0'')&amp;lt;/c&amp;gt; || get a 64-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setDouble|setDouble]](''self, offset=0, value=0'')&amp;lt;/c&amp;gt; || set a 64-bit floating-point value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.utf8|utf8]](''self, offset=0, bytes=-1'')&amp;lt;/c&amp;gt; || get a string of ASCII or UTF-8 text&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[RawData.setUtf8|setUtf8]](''self, offset=0, value=&amp;quot;&amp;quot;'')&amp;lt;/c&amp;gt; || set a string as UTF-8; return number of bytes written&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&lt;br /&gt;
The getter and setter methods accept &amp;lt;c&amp;gt;offset&amp;lt;/c&amp;gt; argument which, as with [[string]] and [[list]] indexing, may be &amp;lt;c&amp;gt;0 .. (len-1)&amp;lt;/c&amp;gt; or &amp;lt;c&amp;gt;-len .. -1&amp;lt;/c&amp;gt; where the negative indexes mean offset from the end of data.&lt;br /&gt;
&lt;br /&gt;
If offset (positive or negative) is out of range, an &amp;lt;c&amp;gt;IndexError&amp;lt;/c&amp;gt; is raised. Same error is raised if the span of read or written bytes go beyond the data boundaries, with the exception of &amp;lt;c&amp;gt;.setUtf8&amp;lt;/c&amp;gt; that writes as much of its string value as possible and drops the rest.&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=PixelDisplay.color&amp;diff=1206</id>
		<title>PixelDisplay.color</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=PixelDisplay.color&amp;diff=1206"/>
		<updated>2024-03-01T07:13:26Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: merging example from PixelDipslay.color&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;c&amp;gt;color&amp;lt;/c&amp;gt; property of the [[PixelDisplay]] class sets the default drawing color for subsequent drawing calls such as [[PixelDisplay.line]], [[PixelDisplay.drawRect]], and [[PixelDisplay.fillPoly]].&lt;br /&gt;
&lt;br /&gt;
The default value is &amp;quot;#FFFFFFFF&amp;quot;, or solid white.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;gfx.color = color.green&lt;br /&gt;
gfx.fillRect 50,100, 200,200&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=TextDisplay.cellBackColor&amp;diff=1205</id>
		<title>TextDisplay.cellBackColor</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=TextDisplay.cellBackColor&amp;diff=1205"/>
		<updated>2024-02-26T13:49:10Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Example */ Fix syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;TextDisplay.cellBackColor&amp;lt;/c&amp;gt; returns the background color of the given cell.&lt;br /&gt;
&lt;br /&gt;
See also:  [[TextDisplay.setCellBackColor]]&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Type !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ''x'' || number || 0 || column of interest&lt;br /&gt;
|-&lt;br /&gt;
| ''y'' || number || 0 || row of interest&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
&amp;lt;c&amp;gt;TextDisplay.cellBackColor&amp;lt;/c&amp;gt; may appear as either the text color or the surrounding color, depending&lt;br /&gt;
on whether the given cell is in inverse mode.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;print text.cellBackColor(0, 10)&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=TextDisplay.cellColor&amp;diff=1204</id>
		<title>TextDisplay.cellColor</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=TextDisplay.cellColor&amp;diff=1204"/>
		<updated>2024-02-26T13:48:21Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Example */ Fix syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;[[TextDisplay]].cellColor&amp;lt;/c&amp;gt; returns the foreground color of the given cell of a text display.&lt;br /&gt;
&lt;br /&gt;
See also: [[TextDisplay.setCellColor]]&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Type !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ''x'' || number || 0 || column of interest&lt;br /&gt;
|-&lt;br /&gt;
| ''y'' || number || 0 || row of interest&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
This may appear as either the text color or the surrounding color, depending&lt;br /&gt;
on whether the given cell is in inverse mode.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;print text.cellColor(0, 10)&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=TextDisplay.backColor&amp;diff=1203</id>
		<title>TextDisplay.backColor</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=TextDisplay.backColor&amp;diff=1203"/>
		<updated>2024-02-25T20:13:00Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: + about assigning invalid color&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;[[TextDisplay]].backColor&amp;lt;/c&amp;gt; gets or sets the background color used on any future printing to this&lt;br /&gt;
text display.  This is the surrounding color for normal text, or the&lt;br /&gt;
text color for inverse-mode text.&lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
Assigning an invalid color value to this property will result in &amp;lt;c&amp;gt;&amp;quot;#00000000&amp;quot;&amp;lt;/c&amp;gt; (transparent color).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;text.backColor = color.navy&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=TextDisplay.color&amp;diff=1202</id>
		<title>TextDisplay.color</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=TextDisplay.color&amp;diff=1202"/>
		<updated>2024-02-25T20:11:38Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: + about assigning invalid color&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;[[TextDisplay]].color&amp;lt;/c&amp;gt; gets or sets the foreground [[Color|color]] used on any future printing to this&lt;br /&gt;
text display.  This is the text color for normal text, or the surrounding&lt;br /&gt;
color for inverse-mode text.&lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
Assigning an invalid color value to this property will result in &amp;lt;c&amp;gt;&amp;quot;#00000000&amp;quot;&amp;lt;/c&amp;gt; (transparent color).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;text.color = color.aqua&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=TextDisplay&amp;diff=1201</id>
		<title>TextDisplay</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=TextDisplay&amp;diff=1201"/>
		<updated>2024-02-21T21:30:00Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Methods and Properties */ + clear&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;c&amp;gt;TextDisplay&amp;lt;/c&amp;gt; class in [[Mini Micro]] is a display type that represents a 68-column, 26-row text character display.  Each row/column position in this display is called a &amp;quot;cell&amp;quot; and may display one character, with any foreground and background color (including transparent colors).&lt;br /&gt;
&lt;br /&gt;
[[File:TextDisplay.png|682px|frameless|center|Illustration of the Mini Micro text display: 26 rows by 68 columns.]]&lt;br /&gt;
&lt;br /&gt;
By default, [[display]] 3 is configured as a text display, and is in fact the main text display to which [[print]] prints, and to which the [[text]] global refers (unless you change it).  But you can make any display layer a text display by setting its [[Display.mode|mode]] to &amp;lt;c&amp;gt;displayMode.text&amp;lt;/c&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There are two ways to put text into a text display: use the [[TextDisplay.print]] method, which applies the current values of [[TextDisplay.color]], etc.; or set individual cells with [[TextDisplay.setCell]], [[TextDisplay.setCellColor]], etc.&lt;br /&gt;
&lt;br /&gt;
== Methods and Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method or Property !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.color]] || get or set the text color (used on subsequent [[TextDisplay.print]])&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.backColor]] || get or set the background color (used on subsequent [[TextDisplay.print]])&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.column]] || get/set the cursor column, 0-67 (where subsequent [[TextDisplay.print]] begins)&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.row]] || get or set the cursor row, 0-25 (used on subsequent [[TextDisplay.print]])&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.inverse]] || when true, subsequent printing swaps text and background color&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.delimiter]] || get/set the extra character output after every [[TextDisplay.print]])&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.cell]](''x'', ''y'') || get the character at the given column and row&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.setCell]] ''x'', ''y'', k || store character ''k'' into the given column and row&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.cellColor]](''x'', ''y'') || get the text color at the given column and row&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.setCellColor]] ''x'', ''y'', c || set the text color at the given column and row to ''c''&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.cellBackColor]](''x'', ''y'') || get the background color at the given column and row&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.setCellBackColor]] ''x'', ''y'', c || set the background color at the given column and row to ''c''&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.print]] ''s'' || print string ''s'' (followed by the [[TextDisplay.delimiter|delimiter]])&lt;br /&gt;
|-&lt;br /&gt;
| [[TextDisplay.clear]] || clear the text display&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TextDisplay in Farmtronics ==&lt;br /&gt;
&lt;br /&gt;
The [[Farmtronics]] computer also has a TextDisplay, but it is only 20 rows by 40 columns.  Moreover, there is only ''one'' TextDisplay, unlike Mini Micro, which can have any number of them.&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;br /&gt;
[[Category:Farmtronics]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Env.shell&amp;diff=1192</id>
		<title>Env.shell</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Env.shell&amp;diff=1192"/>
		<updated>2024-02-18T08:16:37Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: Copy paste `help &amp;quot;shells&amp;quot;`&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In Mini Micro, a &amp;quot;shell&amp;quot; is a program that launches other programs, and which is automatically re-run when those other programs exit.  You can make any program a shell by storing its path in &amp;lt;c&amp;gt;env.shell&amp;lt;/c&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;c&amp;gt;/sys/demo&amp;lt;/c&amp;gt; directory contains three shell programs:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;c&amp;gt;demos&amp;lt;/c&amp;gt;: lists and easily runs a subset of demos&lt;br /&gt;
* &amp;lt;c&amp;gt;desktop&amp;lt;/c&amp;gt;: a simple desktop-style graphical interface&lt;br /&gt;
* &amp;lt;c&amp;gt;lcars&amp;lt;/c&amp;gt;: a futuristic sci-fi graphical interface&lt;br /&gt;
&lt;br /&gt;
In addition, these are defined (by code in &amp;lt;c&amp;gt;/sys/startup.ms&amp;lt;/c&amp;gt;) as commands in their own right.  So, for example, you can launch the desktop shell by just entering &amp;lt;c&amp;gt;desktop&amp;lt;/c&amp;gt; at the command line.&lt;br /&gt;
&lt;br /&gt;
Once you have a shell defined in &amp;lt;c&amp;gt;env.shell&amp;lt;/c&amp;gt;, you can return to it from the command line (or a program) by using [[exit]].  But note that pressing control-C will always break out to the MiniScript prompt, even if a shell is defined.&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Env&amp;diff=1191</id>
		<title>Env</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Env&amp;diff=1191"/>
		<updated>2024-02-18T08:12:50Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Mini Micro */ + shell&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;env&amp;lt;/c&amp;gt; is a built-in map in both [[Mini Micro]] and [[command-line MiniScript]].  It has somewhat different meaning and usage in each environment.&lt;br /&gt;
&lt;br /&gt;
== Mini Micro ==&lt;br /&gt;
&lt;br /&gt;
In [[Mini Micro]], &amp;lt;c&amp;gt;env&amp;lt;/c&amp;gt; refers to a map of special values that affect the Mini Micro environment.  It contains at least the following keys:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| bootOpts || a complete copy of the data in the [[bootOpts.grfon]] file&lt;br /&gt;
|-&lt;br /&gt;
| curdir || current working directory (same as [[pwd]])&lt;br /&gt;
|-&lt;br /&gt;
| cmdLine || command line command that was used to launch Mini Micro (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| cmdLineArgs || command line arguments (as a [[list]]) used when Mini Micro was launched (where applicable)&lt;br /&gt;
|-&lt;br /&gt;
| importPaths || [[list]] of directories searched for [[import]] modules&lt;br /&gt;
|-&lt;br /&gt;
| prompt || [[string]] or [[function]] to use as the command-line prompt&lt;br /&gt;
|-&lt;br /&gt;
| morePrompt || [[string]] or [[function]] to use as the prompt when more input is needed&lt;br /&gt;
|-&lt;br /&gt;
| shell || path to the current [[Env.shell|shell]] program (&amp;lt;c&amp;gt;&amp;quot;&amp;quot;&amp;lt;/c&amp;gt; for the default Mini Micro shell)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Command-Line MiniScript ==&lt;br /&gt;
&lt;br /&gt;
In [[command-line MiniScript]], &amp;lt;c&amp;gt;env&amp;lt;/c&amp;gt; is a copy of the shell environment variables.  Assignments to entries of &amp;lt;c&amp;gt;env&amp;lt;/c&amp;gt; add or update environment variables.  (Deleting environment variables is not possible; you may delete from the &amp;lt;c&amp;gt;env&amp;lt;/c&amp;gt; map, but this does not actually affect the environment.)&lt;br /&gt;
&lt;br /&gt;
The exact meaning of environment variables varies with the platform.  They have many uses, such as in [http://www.cgi101.com/book/ch3/text.html CGI scripts].&lt;br /&gt;
&lt;br /&gt;
=== Windows Version ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| MS_EXE_DIR || Launch directory ||Returns the directory ([[String]]) of which the miniscript.exe was launched from&lt;br /&gt;
|-&lt;br /&gt;
| MS_IMPORT_PATH || &amp;quot;$MS_SCRIPT_DIR/lib:$MS_EXE_DIR/lib&amp;quot; ||directory listings ([[String]]) of where MiniScript files are located allowing [[Import]] to search in those for file import.&lt;br /&gt;
|-&lt;br /&gt;
| HOMEPATH || User home || Returns the home Directory ([[String]]) of the user that had launched miniscript.exe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Linux Version===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Default !! Meaning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Useful tips ==&lt;br /&gt;
&lt;br /&gt;
=== Adding more import paths (Windows Command Line) ===&lt;br /&gt;
To add more folders to [[Import]] from, alter or add the path with a dollar sign ('''$''') to the beginning of $MS_SCRIPT_DIR or $MS_EXE_DIR [[String]] text with a forward slash ('''/''') before the folder name like so: '''$MS_SCRIPT_DIR/sprites'''. To add multiple paths for import simply add a colon (''':''') between the designated paths to indicate multiple directories to import from. Apply the string to the [[Env|env]].MS_IMPORT_PATH like below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt; env.MS_IMPORT_PATH = &amp;quot;$MS_SCRIPT_DIR/sprites&amp;quot; // replaces the default with one folder named sprites&lt;br /&gt;
 env.MS_IMPORT_PATH = &amp;quot;$MS_SCRIPT_DIR/lib:$MS_EXE_DIR/lib:$MS_SCRIPT_DIR/sprites&amp;quot; // default plus new folder sprites&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;br /&gt;
[[Category:Command-Line MiniScript]]&lt;br /&gt;
[[Category:Farmtronics]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Open-Source_Projects&amp;diff=1171</id>
		<title>Open-Source Projects</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Open-Source_Projects&amp;diff=1171"/>
		<updated>2024-02-06T17:44:12Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Third-Party Implementations/Ports */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a collection of links to open-source projects in or for MiniScript.&lt;br /&gt;
&lt;br /&gt;
=== Main Repository ===&lt;br /&gt;
https://github.com/JoeStrout/miniscript&lt;br /&gt;
&lt;br /&gt;
Official repository of source code for the MiniScript language (both C# and C++ versions), as well as [[Command-Line MiniScript]].&lt;br /&gt;
&lt;br /&gt;
=== Third-Party Implementations/Ports ===&lt;br /&gt;
==== Java version of MiniScript ====&lt;br /&gt;
https://github.com/heatseeker0/JavaMiniScript&lt;br /&gt;
&lt;br /&gt;
A third-party reimplementation of MiniScript in Java, suitable for adding MiniScript support to Java games and apps.&lt;br /&gt;
&lt;br /&gt;
==== Kotlin version of MiniScript ====&lt;br /&gt;
https://github.com/Arcnor/miniscript-kt&lt;br /&gt;
&lt;br /&gt;
A third-party reimplementation of MiniScript in Kotlin (a more modern Java-like language which runs on the JVM).&lt;br /&gt;
&lt;br /&gt;
==== MiniScript in MiniScript ====&lt;br /&gt;
https://github.com/marcgurevitx/ms-ms&lt;br /&gt;
&lt;br /&gt;
A MiniScript parser and evaluator written in MiniScript. Works in [[Command-Line MiniScript]] and [[Mini Micro]] (a slightly modified version of [[TestSuite.txt]] passes).&lt;br /&gt;
&lt;br /&gt;
=== MiniScript-Enhanced Development Environments ===&lt;br /&gt;
&lt;br /&gt;
==== Soda ====&lt;br /&gt;
https://github.com/JoeStrout/soda&lt;br /&gt;
&lt;br /&gt;
An open-source, cross-platform game development environment based on MiniScript and SDL.&lt;br /&gt;
&lt;br /&gt;
==== MiniScript in RayLib ====&lt;br /&gt;
https://github.com/AlRado/Raylib-cs-Examples/tree/miniscript&lt;br /&gt;
&lt;br /&gt;
Adds MiniScript support to RayLib-cs, an open-source C# game engine.&lt;br /&gt;
&lt;br /&gt;
==== MiniScript in MonoGame ====&lt;br /&gt;
https://github.com/guiprada/monomicro&lt;br /&gt;
&lt;br /&gt;
Adds MiniScript support to MonoGame, another open-source C# game engine.&lt;br /&gt;
&lt;br /&gt;
==== GameLodge ====&lt;br /&gt;
https://github.com/bananaHemic/gamelodge_unity&lt;br /&gt;
&lt;br /&gt;
A multiplayer VR project that supports online coding &amp;amp; development based on MiniScript.  Edit the game while people are in it!&lt;br /&gt;
&lt;br /&gt;
=== Editors &amp;amp; Syntax Highlighting ===&lt;br /&gt;
&lt;br /&gt;
==== NotePad++ UDL ====&lt;br /&gt;
: https://github.com/SynapticBytes/MiniScript-UDL-for-Notepad-plus-plus&lt;br /&gt;
: User-Defined Language for the NotePad++ text editor for Windows.&lt;br /&gt;
&lt;br /&gt;
==== VS Code Language Toolkit ====&lt;br /&gt;
: https://marketplace.visualstudio.com/items?itemName=ayecue.miniscript-vs&lt;br /&gt;
: MiniScript Toolkit for Visual Studio Code. Includes syntax highlighting, a built-in interpreter and debugger, and many more features.&lt;br /&gt;
&lt;br /&gt;
==== VS Code Language Module ====&lt;br /&gt;
: https://bitbucket.org/colinmac/miniscript-syntax/src/master/&lt;br /&gt;
: Provides MiniScript syntax highlighting for Visual Studio Code.&lt;br /&gt;
&lt;br /&gt;
==== BBEdit Language Module ====&lt;br /&gt;
: https://github.com/JoeStrout/miniscript-bbedit-lang-mod&lt;br /&gt;
: Provides MiniScript syntax highlighting for the BBEdit text editor for macOS.&lt;br /&gt;
&lt;br /&gt;
==== Pygments fork ====&lt;br /&gt;
: https://github.com/JoeStrout/pygments&lt;br /&gt;
: Fork of the Pygments syntax-coloring library which adds support for MiniScript.&lt;br /&gt;
: [https://github.com/pygments/pygments/pull/1397 Merged] into the main Pygments repo on Feb. 29, 2020.&lt;br /&gt;
&lt;br /&gt;
==== Highlight.js Package ====&lt;br /&gt;
: https://github.com/JoeStrout/highlightjs-miniscript&lt;br /&gt;
: Add-on language module for [https://github.com/highlightjs/highlight.js Highlight.js].&lt;br /&gt;
&lt;br /&gt;
=== MiniScript code libraries ===&lt;br /&gt;
&lt;br /&gt;
==== minimicro-fonts ====&lt;br /&gt;
: https://github.com/JoeStrout/minimicro-fonts&lt;br /&gt;
: Provides support for colored, proportional or monospaced screen fonts in BMF format.&lt;br /&gt;
&lt;br /&gt;
==== minimicro-tiled ====&lt;br /&gt;
: https://github.com/Mantic/minimicro-tiled&lt;br /&gt;
: Provides a [https://www.mapeditor.org/ Tiled] map importer and renderer!&lt;br /&gt;
&lt;br /&gt;
=== Games/Apps/Programs written in MiniScript ===&lt;br /&gt;
&lt;br /&gt;
* '''Annelids''': https://github.com/JoeStrout/annelids&lt;br /&gt;
* '''Sokoban''': https://github.com/sebnozzi/minimicro-sokoban&lt;br /&gt;
* '''Quatris''': https://github.com/JoeStrout/quatris&lt;br /&gt;
* '''Clacks''': https://github.com/JoeStrout/clacks&lt;br /&gt;
* '''Memory Game''': https://github.com/sebnozzi/minimicro-memorygame&lt;br /&gt;
* '''Sliding Puzzle''': https://github.com/sebnozzi/minimicro-sliding-puzzle/&lt;br /&gt;
* '''Letter Shooter''': https://github.com/sebnozzi/minimicro-lettershooter/&lt;br /&gt;
* '''minimicro-raytracer''': https://github.com/Syntaxxor/minimicro-raytracer&lt;br /&gt;
* '''World Conquest''': https://github.com/JoeStrout/worldConquest&lt;br /&gt;
* '''Retro Robots''': https://github.com/JoeStrout/RetroRobots&lt;br /&gt;
* '''μ-hack''': https://github.com/treytomes/micro-hack&lt;br /&gt;
&lt;br /&gt;
=== Tagged collections ===&lt;br /&gt;
&lt;br /&gt;
* GitHub: https://github.com/topics/miniscript&lt;br /&gt;
* itch.io: https://itch.io/games/tag-minimicro&lt;br /&gt;
* Rosetta Code: http://www.rosettacode.org/wiki/Category:MiniScript&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Key.keyNames&amp;diff=1161</id>
		<title>Key.keyNames</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Key.keyNames&amp;diff=1161"/>
		<updated>2023-12-13T19:01:53Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: Deleted redundant `while true`&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;[[key]].keyNames&amp;lt;/c&amp;gt; returns a list of all the key names available for use with &amp;lt;c&amp;gt;[[key.pressed]]&amp;lt;/c&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
This can be used to check (via &amp;lt;c&amp;gt;[[key.pressed]]&amp;lt;/c&amp;gt;) all possible button-like inputs (keypresses, joystick buttons, etc). For example: if waiting for the user to press anything to continue or while configuring their input preferences.&lt;br /&gt;
&lt;br /&gt;
Note the values from &amp;lt;c&amp;gt;[[key]].keyNames&amp;lt;/c&amp;gt; are not the same that are received from &amp;lt;c&amp;gt;[[key.get]]&amp;lt;/c&amp;gt;. &amp;lt;c&amp;gt;[[key.get]]&amp;lt;/c&amp;gt; returns characters including upper- and lower-case letters, etc., which may be generated by a single key or some key combination (such as shift-4 for $ on a U.S. keyboard), whereas &amp;lt;c&amp;gt;[[key]].keyNames&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;[[key.pressed]]&amp;lt;/c&amp;gt; refer to physical hardware keys, regardless of what character (if any) they generate.&lt;br /&gt;
&lt;br /&gt;
== Example 1 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;while true&lt;br /&gt;
	for n in key.keyNames&lt;br /&gt;
		if key.pressed(n) then&lt;br /&gt;
			while key.pressed(n)&lt;br /&gt;
			end while&lt;br /&gt;
			print n&lt;br /&gt;
		end if&lt;br /&gt;
	end for&lt;br /&gt;
end while&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also: &amp;lt;c&amp;gt;[[key.pressed]]&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;[[key]]&amp;lt;/c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sample Output ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
Windows 10 sample output: &lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
a&amp;lt;/br&amp;gt;&lt;br /&gt;
b&amp;lt;/br&amp;gt;&lt;br /&gt;
c&amp;lt;/br&amp;gt;&lt;br /&gt;
d&amp;lt;/br&amp;gt;&lt;br /&gt;
e&amp;lt;/br&amp;gt;&lt;br /&gt;
f&amp;lt;/br&amp;gt;&lt;br /&gt;
g&amp;lt;/br&amp;gt;&lt;br /&gt;
h&amp;lt;/br&amp;gt;&lt;br /&gt;
i&amp;lt;/br&amp;gt;&lt;br /&gt;
j&amp;lt;/br&amp;gt;&lt;br /&gt;
k&amp;lt;/br&amp;gt;&lt;br /&gt;
l&amp;lt;/br&amp;gt;&lt;br /&gt;
m&amp;lt;/br&amp;gt;&lt;br /&gt;
n&amp;lt;/br&amp;gt;&lt;br /&gt;
o&amp;lt;/br&amp;gt;&lt;br /&gt;
p&amp;lt;/br&amp;gt;&lt;br /&gt;
q&amp;lt;/br&amp;gt;&lt;br /&gt;
r&amp;lt;/br&amp;gt;&lt;br /&gt;
s&amp;lt;/br&amp;gt;&lt;br /&gt;
t&amp;lt;/br&amp;gt;&lt;br /&gt;
u&amp;lt;/br&amp;gt;&lt;br /&gt;
v&amp;lt;/br&amp;gt;&lt;br /&gt;
w&amp;lt;/br&amp;gt;&lt;br /&gt;
x&amp;lt;/br&amp;gt;&lt;br /&gt;
y&amp;lt;/br&amp;gt;&lt;br /&gt;
z&amp;lt;/br&amp;gt;&lt;br /&gt;
1&amp;lt;/br&amp;gt;&lt;br /&gt;
2&amp;lt;/br&amp;gt;&lt;br /&gt;
3&amp;lt;/br&amp;gt;&lt;br /&gt;
4&amp;lt;/br&amp;gt;&lt;br /&gt;
5&amp;lt;/br&amp;gt;&lt;br /&gt;
6&amp;lt;/br&amp;gt;&lt;br /&gt;
7&amp;lt;/br&amp;gt;&lt;br /&gt;
8&amp;lt;/br&amp;gt;&lt;br /&gt;
9&amp;lt;/br&amp;gt;&lt;br /&gt;
0&amp;lt;/br&amp;gt;&lt;br /&gt;
-&amp;lt;/br&amp;gt;&lt;br /&gt;
=&amp;lt;/br&amp;gt;&lt;br /&gt;
[&amp;lt;/br&amp;gt;&lt;br /&gt;
]&amp;lt;/br&amp;gt;&lt;br /&gt;
\&amp;lt;/br&amp;gt;&lt;br /&gt;
,&amp;lt;/br&amp;gt;&lt;br /&gt;
.&amp;lt;/br&amp;gt;&lt;br /&gt;
/&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;amp;#59;&amp;lt;/br&amp;gt;&lt;br /&gt;
'&amp;lt;/br&amp;gt;&lt;br /&gt;
`&amp;lt;/br&amp;gt;&lt;br /&gt;
f1&amp;lt;/br&amp;gt;&lt;br /&gt;
f2&amp;lt;/br&amp;gt;&lt;br /&gt;
f3&amp;lt;/br&amp;gt;&lt;br /&gt;
f4&amp;lt;/br&amp;gt;&lt;br /&gt;
f5&amp;lt;/br&amp;gt;&lt;br /&gt;
f6&amp;lt;/br&amp;gt;&lt;br /&gt;
f7&amp;lt;/br&amp;gt;&lt;br /&gt;
f8&amp;lt;/br&amp;gt;&lt;br /&gt;
f9&amp;lt;/br&amp;gt;&lt;br /&gt;
f10&amp;lt;/br&amp;gt;&lt;br /&gt;
f11&amp;lt;/br&amp;gt;&lt;br /&gt;
f12&amp;lt;/br&amp;gt;&lt;br /&gt;
f13&amp;lt;/br&amp;gt;&lt;br /&gt;
f14&amp;lt;/br&amp;gt;&lt;br /&gt;
f15&amp;lt;/br&amp;gt;&lt;br /&gt;
up&amp;lt;/br&amp;gt;&lt;br /&gt;
down&amp;lt;/br&amp;gt;&lt;br /&gt;
left&amp;lt;/br&amp;gt;&lt;br /&gt;
right&amp;lt;/br&amp;gt;&lt;br /&gt;
[1]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[2]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[3]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[4]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[5]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[6]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[7]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[8]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[9]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[0]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[+]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[-]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[*]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
[/]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; // keypad input&amp;lt;/br&amp;gt;&lt;br /&gt;
enter&amp;lt;/br&amp;gt;&lt;br /&gt;
equals&amp;lt;/br&amp;gt;&lt;br /&gt;
clear&amp;lt;/br&amp;gt;&lt;br /&gt;
left shift&amp;lt;/br&amp;gt;&lt;br /&gt;
right shift&amp;lt;/br&amp;gt;&lt;br /&gt;
left ctrl&amp;lt;/br&amp;gt;&lt;br /&gt;
right ctrl&amp;lt;/br&amp;gt;&lt;br /&gt;
left alt&amp;lt;/br&amp;gt;&lt;br /&gt;
right alt&amp;lt;/br&amp;gt;&lt;br /&gt;
left cmd&amp;lt;/br&amp;gt;&lt;br /&gt;
right cmd&amp;lt;/br&amp;gt;&lt;br /&gt;
backspace&amp;lt;/br&amp;gt;&lt;br /&gt;
tab&amp;lt;/br&amp;gt;&lt;br /&gt;
return&amp;lt;/br&amp;gt;&lt;br /&gt;
escape&amp;lt;/br&amp;gt;&lt;br /&gt;
space&amp;lt;/br&amp;gt;&lt;br /&gt;
delete&amp;lt;/br&amp;gt;&lt;br /&gt;
insert&amp;lt;/br&amp;gt;&lt;br /&gt;
home&amp;lt;/br&amp;gt;&lt;br /&gt;
end&amp;lt;/br&amp;gt;&lt;br /&gt;
page up&amp;lt;/br&amp;gt;&lt;br /&gt;
page down&amp;lt;/br&amp;gt;&lt;br /&gt;
mouse 0&amp;lt;/br&amp;gt;&lt;br /&gt;
mouse 1&amp;lt;/br&amp;gt;&lt;br /&gt;
mouse 2&amp;lt;/br&amp;gt;&lt;br /&gt;
mouse 3&amp;lt;/br&amp;gt;&lt;br /&gt;
mouse 4&amp;lt;/br&amp;gt;&lt;br /&gt;
mouse 5&amp;lt;/br&amp;gt;&lt;br /&gt;
mouse 6&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 0&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 1&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 2&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 3&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 4&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 5&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 6&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 7&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 8&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 9&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 10&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 11&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 12&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 13&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 14&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick button 15&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 0&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 1&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 2&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 3&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 4&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 5&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 6&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 7&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 8&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 9&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 10&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 11&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 12&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 13&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 14&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 1 button 15&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 0&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 1&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 2&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 3&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 4&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 5&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 6&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 7&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 8&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 9&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 10&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 11&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 12&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 13&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 14&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 2 button 15&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 0&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 1&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 2&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 3&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 4&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 5&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 6&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 7&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 8&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 9&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 10&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 11&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 12&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 13&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 14&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 3 button 15&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 0&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 1&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 2&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 3&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 4&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 5&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 6&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 7&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 8&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 9&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 10&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 11&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 12&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 13&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 14&amp;lt;/br&amp;gt;&lt;br /&gt;
joystick 4 button 15&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Comparison&amp;diff=1156</id>
		<title>Comparison</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Comparison&amp;diff=1156"/>
		<updated>2023-11-22T15:10:36Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Equality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comparison operators: &amp;lt;c&amp;gt; == &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; != &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;gt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;gt;= &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt;= &amp;lt;/c&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equality ==&lt;br /&gt;
&lt;br /&gt;
The operator &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; tests for equality; the operator &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; is the negation of equality. These operators always result in [[true]] or [[false]] (or in some cases of incompatible types - &amp;lt;c&amp;gt;null&amp;lt;/c&amp;gt;). Both can be applied to ''any'' values, not necessarily of the same type. If the values have different types, they're considered not equal. Otherwise, they're compared according to their types:&lt;br /&gt;
&lt;br /&gt;
* [[null]] is equal to itself&lt;br /&gt;
* [[number]]s and [[string]]s are compared in the usual way. (Unlike in some other languages, &amp;lt;c&amp;gt;0 == &amp;quot;0&amp;quot;&amp;lt;/c&amp;gt; is false.)&lt;br /&gt;
* [[list]]s are equal if they contain equal elements&lt;br /&gt;
* [[map]]s are equal if they contain equal key/value pairs&lt;br /&gt;
* [[funcRef]]s are equal if they reference the same function&lt;br /&gt;
* The special value [[NaN]] is not equal to anything, even to itself&lt;br /&gt;
&lt;br /&gt;
To compare [[list]]s and [[map]]s by reference, use [[refEquals]] function.&lt;br /&gt;
&lt;br /&gt;
== Relational operators ==&lt;br /&gt;
&lt;br /&gt;
Comparisons &amp;lt;c&amp;gt; &amp;gt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;gt;= &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt;= &amp;lt;/c&amp;gt; are defined for numbers (arithmetic comparison) and strings (alphabetic comparison). These cases result in [[true]] or [[false]].&lt;br /&gt;
&lt;br /&gt;
For other data types or for operands of different data types they return [[null]].&lt;br /&gt;
&lt;br /&gt;
If the operands are a number and a [[null]], they substitute [[null]] with &amp;lt;c&amp;gt;0&amp;lt;/c&amp;gt; (resulting in [[true]] or [[false]]).&lt;br /&gt;
&lt;br /&gt;
If the operands are a string and a [[null]], it considers the string being always greater than [[null]] (resulting in [[true]] or [[false]]).&lt;br /&gt;
&lt;br /&gt;
All six operators support [[Operators#Comparison_Operators|chaining]].&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
print null == null      // prints 1&lt;br /&gt;
print 0 != &amp;quot;0&amp;quot;          // prints 1&lt;br /&gt;
print 13 &amp;lt; 42 &amp;lt;= 420    // prints 1&lt;br /&gt;
print 2 &amp;lt; 15            // prints 1&lt;br /&gt;
print &amp;quot;2&amp;quot; &amp;lt; &amp;quot;15&amp;quot;        // prints 0, alphabetic comparison&lt;br /&gt;
print 0/0 == 0/0        // prints 0, NaN != NaN&lt;br /&gt;
print [1, 2, 3] == [1, 2, 3]    // prints 1&lt;br /&gt;
print 0 != null and 0 &amp;gt;= null and 0 &amp;lt;= null  // prints 1 :)&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1155</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1155"/>
		<updated>2023-11-20T21:35:11Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Comparison Operators */ Added chaining of ==/!=&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning !! Precedence&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment || 0&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true || 1&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true || 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa || 3&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking || 4&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal || 5&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal || 5&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison || 5&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison || 5&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison || 5&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison || 5&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation || 6&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming || 6&lt;br /&gt;
|- &lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication || 7&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction || 7&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder) || 7&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-A&amp;lt;/c&amp;gt; || unary minus (numeric negation) || 8&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation || 9&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it) || 10&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B || 11&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing || 12&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || slicing || 12&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]] || 12&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]] || 12&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x == 5 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || &amp;lt;c&amp;gt;0 &amp;lt; x&amp;lt;/c&amp;gt; ''and'' &amp;lt;c&amp;gt;x == 5&amp;lt;/c&amp;gt; ''and'' &amp;lt;c&amp;gt;5 &amp;lt; y&amp;lt;/c&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
== Math-assignment operators ==&lt;br /&gt;
&lt;br /&gt;
In version ''1.6'' the math-assignment operators were added. They overwrite the value of the first operand variable with the result of the operation when performing the operator without assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
x = 42&lt;br /&gt;
x += 13  // x = x + 13&lt;br /&gt;
print x  // 55&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;hello.ms&amp;quot;&lt;br /&gt;
s -= &amp;quot;.ms&amp;quot;  // s = s - &amp;quot;.ms&amp;quot;&lt;br /&gt;
print s  // &amp;quot;hello&amp;quot;&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+=&amp;lt;/c&amp;gt; B || A = A + B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-=&amp;lt;/c&amp;gt; B || A = A - B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*=&amp;lt;/c&amp;gt; B || A = A * B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/=&amp;lt;/c&amp;gt; B || A = A / B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%=&amp;lt;/c&amp;gt; B || A = A % B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^=&amp;lt;/c&amp;gt; B || A = A ^ B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tricky spaces ==&lt;br /&gt;
&lt;br /&gt;
MiniScript allows an expression to be the entire statement (which is useful in [[REPL]] where it evaluates the expression and immediately prints the result).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
4 + 5           // REPL prints 9&lt;br /&gt;
&lt;br /&gt;
f = function(x,y)&lt;br /&gt;
	x + y       // the result is &amp;quot;dropped&amp;quot;&lt;br /&gt;
end function&lt;br /&gt;
f 4, 5          // prints nothing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few cases when using different spacing around operators in such expressions may make MiniScript confuse it with a function call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
X[Y]            // Index X with key Y&lt;br /&gt;
X [Y]           // Call function X with argument [Y]&lt;br /&gt;
&lt;br /&gt;
X-Y             // Subtract Y from X&lt;br /&gt;
X- Y            // Subtract Y from X&lt;br /&gt;
X -Y            // Call function X with argument -Y&lt;br /&gt;
X - Y           // Subtract Y from X&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Follow a simple convention to avoid such problems: put spaces around arithmetic operators and if possible don't use a space between an unary operator and its operand.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Comparison&amp;diff=1146</id>
		<title>Comparison</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Comparison&amp;diff=1146"/>
		<updated>2023-11-17T16:10:39Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: Details on comparison&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comparison operators: &amp;lt;c&amp;gt; == &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; != &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;gt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;gt;= &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt;= &amp;lt;/c&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Equality ==&lt;br /&gt;
&lt;br /&gt;
The operator &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; tests for equality; the operator &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; is the negation of equality. These operators always result in [[true]] or [[false]]. Both can be applied to ''any'' values, not necessarily of the same type. If the values have different types, they're considered not equal. Otherwise, they're compared according to their types:&lt;br /&gt;
&lt;br /&gt;
* [[null]] is equal to itself&lt;br /&gt;
* [[number]]s and [[string]]s are compared in the usual way. (Unlike in some other languages, &amp;lt;c&amp;gt;0 == &amp;quot;0&amp;quot;&amp;lt;/c&amp;gt; is false.)&lt;br /&gt;
* [[list]]s are equal if they contain equal elements&lt;br /&gt;
* [[map]]s are equal if they contain equal key/value pairs&lt;br /&gt;
* [[funcRef]]s are equal if they reference the same function&lt;br /&gt;
* The special value [[NaN]] is not equal to anything, even to itself&lt;br /&gt;
&lt;br /&gt;
To compare [[list]]s and [[map]]s by reference, use [[refEquals]] function.&lt;br /&gt;
&lt;br /&gt;
== Relational operators ==&lt;br /&gt;
&lt;br /&gt;
Comparisons &amp;lt;c&amp;gt; &amp;gt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt; &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;gt;= &amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt; &amp;lt;= &amp;lt;/c&amp;gt; are defined for numbers (arithmetic comparison) and strings (alphabetic comparison). These cases result in [[true]] or [[false]].&lt;br /&gt;
&lt;br /&gt;
For other data types or for operands of different data types they return [[null]].&lt;br /&gt;
&lt;br /&gt;
If the operands are a number and a [[null]], they substitute [[null]] with &amp;lt;c&amp;gt;0&amp;lt;/c&amp;gt; (resulting in [[true]] or [[false]]).&lt;br /&gt;
&lt;br /&gt;
If the operands are a string and a [[null]], it considers the string being always greater than [[null]] (resulting in [[true]] or [[false]]).&lt;br /&gt;
&lt;br /&gt;
All six operators support [[Operators#Comparison_Operators|chaining]].&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
print null == null      // prints 1&lt;br /&gt;
print 0 != &amp;quot;0&amp;quot;          // prints 1&lt;br /&gt;
print 13 &amp;lt; 42 &amp;lt;= 420    // prints 1&lt;br /&gt;
print 2 &amp;lt; 15            // prints 1&lt;br /&gt;
print &amp;quot;2&amp;quot; &amp;lt; &amp;quot;15&amp;quot;        // prints 0, alphabetic comparison&lt;br /&gt;
print 0/0 == 0/0        // prints 0, NaN != NaN&lt;br /&gt;
print [1, 2, 3] == [1, 2, 3]    // prints 1&lt;br /&gt;
print 0 != null and 0 &amp;gt;= null and 0 &amp;lt;= null  // prints 1 :)&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Isa&amp;diff=1145</id>
		<title>Isa</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Isa&amp;diff=1145"/>
		<updated>2023-11-17T08:43:58Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* isa (operator) */ Other types as RHS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Because this wiki software does not allow topic names to begin with an underscore, this page contains two different topics.&lt;br /&gt;
&lt;br /&gt;
== isa (operator) ==&lt;br /&gt;
&amp;lt;c&amp;gt;isa&amp;lt;/c&amp;gt; is a [[:Category:Keywords|keyword]] binary [[operators|operator]] which tests the left-hand operator for membership in the type defined by the right-hand side.  That right-hand operand could be a user-defined map (to which the left-hand side might belong via the &amp;lt;c&amp;gt;__isa&amp;lt;/c&amp;gt; chain), or it could be one of the [[:Category:Data Types|built-in types]]: [[number]], [[string]], [[list]], [[map]], or [[funcRef]].&lt;br /&gt;
&lt;br /&gt;
=== Examples for built-in types ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&amp;quot;Hello&amp;quot; isa string    // returns 1&lt;br /&gt;
&amp;quot;Hello&amp;quot; isa number    // returns 0&lt;br /&gt;
123 isa number        // returns 1&lt;br /&gt;
&amp;quot;123&amp;quot; isa number      // returns 0 &lt;br /&gt;
[1,2,3] isa list      // returns 1&lt;br /&gt;
{&amp;quot;uno&amp;quot;:1,&amp;quot;dos&amp;quot;:2} isa map    // returns 1&lt;br /&gt;
@print isa funcRef    // returns 1&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examples for user-defined types ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
MyDefinedType = {}&lt;br /&gt;
MyOtherDefinedType = {}&lt;br /&gt;
&lt;br /&gt;
obj = new MyDefinedType&lt;br /&gt;
&lt;br /&gt;
obj isa MyDefinedType        // returns 1 - direct type&lt;br /&gt;
obj isa map                  // returns 1 - related by inheritance&lt;br /&gt;
&lt;br /&gt;
obj isa MyOtherDefinedType   // returns 0 - because unrelated&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other types as RHS ===&lt;br /&gt;
&lt;br /&gt;
As of MiniScript version &amp;lt;c&amp;gt;1.6.1&amp;lt;/c&amp;gt;, it's possible to use ''any'' value as a right hand side of an &amp;lt;c&amp;gt;isa&amp;lt;/c&amp;gt; operator. When such values are not types, the operator returns [[false]], except when it's a [[null]] in which case &amp;lt;c&amp;gt;isa&amp;lt;/c&amp;gt; checks for equality with [[null]] (this behavior might currently be affected by [https://github.com/JoeStrout/miniscript/issues/84 a bug]).&lt;br /&gt;
&lt;br /&gt;
== __isa  (map entry) ==&lt;br /&gt;
&amp;lt;c&amp;gt;__isa&amp;lt;/c&amp;gt; is a special entry in a map that refers to the map's base class.  It is part of MiniScript's support for [[object-oriented programming]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Object-oriented programming]] in miniscript&lt;br /&gt;
* The [[map]] type&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
[[Category:Keywords]]&lt;br /&gt;
[[Category:Operators]]&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=RefEquals&amp;diff=1144</id>
		<title>RefEquals</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=RefEquals&amp;diff=1144"/>
		<updated>2023-11-17T08:13:37Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;c&amp;gt;refEquals&amp;lt;/c&amp;gt; function checks two values for reference equality.  This is different from the &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; operator, which checks whether two values are ''equivalent'' (e.g., two maps that contain equal key/value pairs, or two lists which contain equal values).&lt;br /&gt;
&lt;br /&gt;
Whenever &amp;lt;c&amp;gt;refEquals(a, b)&amp;lt;/c&amp;gt; is true (1), then you know that any modification of &amp;lt;c&amp;gt;a&amp;lt;/c&amp;gt; will also be seen via &amp;lt;c&amp;gt;b&amp;lt;/c&amp;gt;, because &amp;lt;c&amp;gt;a&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;b&amp;lt;/c&amp;gt; refer to the same object.&lt;br /&gt;
&lt;br /&gt;
For immutable types – &amp;lt;c&amp;gt;null&amp;lt;/c&amp;gt;s, &amp;lt;c&amp;gt;number&amp;lt;/c&amp;gt;s and &amp;lt;c&amp;gt;string&amp;lt;/c&amp;gt;'s – &amp;lt;c&amp;gt;refEquals&amp;lt;/c&amp;gt; returns the same result as the &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; operator.&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ''a'' || any value|| first argument&lt;br /&gt;
|-&lt;br /&gt;
| ''b'' || any value || second argument&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;a = {&amp;quot;foo&amp;quot;:42}&lt;br /&gt;
b = a&lt;br /&gt;
c = {&amp;quot;foo&amp;quot;:42}&lt;br /&gt;
print a == b          // prints 1, because a and b have the same value&lt;br /&gt;
print a == c          // prints 1, because a and c have the same value&lt;br /&gt;
print refEquals(a,b)  // prints 1, as these are the same map&lt;br /&gt;
print refEquals(a,c)  // prints 0, as these are different maps&lt;br /&gt;
&lt;br /&gt;
print refEquals(42,42)// prints 1&lt;br /&gt;
nan = 0/0&lt;br /&gt;
print refEquals(nan,nan)//prints 0&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Intrinsic Functions]]&lt;br /&gt;
[[Category:Numeric Functions]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Truth&amp;diff=1143</id>
		<title>Truth</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Truth&amp;diff=1143"/>
		<updated>2023-11-16T19:15:09Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: Created page with &amp;quot;In MiniScript certain statements and operations interpret their parts as being ''true'' or ''not true''. These are the conditions of the if and while statements, and t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In MiniScript certain statements and operations interpret their parts as being ''true'' or ''not true''. These are the conditions of the [[if]] and [[while]] statements, and the operands of [[and]], [[or]] and [[not]] operators &amp;lt;ref&amp;gt;Boolean operators treat numbers between 0 and 1 in a [[Fuzzy Logic|fuzzy manner]]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Any MiniScript value - not only [[true]] and [[false]] values - can be used in these constructions. This is how they are interpreted:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type || Considered false || Considered true&lt;br /&gt;
|-&lt;br /&gt;
| [[null]] || always false || &lt;br /&gt;
|-&lt;br /&gt;
| [[number]] || &amp;lt;c&amp;gt;0&amp;lt;/c&amp;gt;, [[false]] || any non-zero number, including [[true]], [[INF]]s and [[NaN]]&lt;br /&gt;
|-&lt;br /&gt;
| [[string]] || empty string (&amp;lt;c&amp;gt;&amp;quot;&amp;quot;&amp;lt;/c&amp;gt;) || non-empty strings&lt;br /&gt;
|-&lt;br /&gt;
| [[list]] || empty list (&amp;lt;c&amp;gt;[]&amp;lt;/c&amp;gt;) || non-empty lists&lt;br /&gt;
|-&lt;br /&gt;
| [[map]] || empty map (&amp;lt;c&amp;gt;{}&amp;lt;/c&amp;gt;) || non-empty maps&lt;br /&gt;
|-&lt;br /&gt;
| [[funcRef]] ||  || ''should'' always be true (but see [https://github.com/JoeStrout/miniscript/issues/87 this bug] for a command-line version)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
if 0 then print &amp;quot;hi&amp;quot;        // prints nothing&lt;br /&gt;
&lt;br /&gt;
if 0/0 then print &amp;quot;hi&amp;quot;      // prints &amp;quot;hi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [false] then print &amp;quot;hi&amp;quot;  // prints &amp;quot;hi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print 0 or {0:0}            // prints 1&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=RefEquals&amp;diff=1142</id>
		<title>RefEquals</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=RefEquals&amp;diff=1142"/>
		<updated>2023-11-11T20:10:18Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: On immutable types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;c&amp;gt;refEquals&amp;lt;/c&amp;gt; function checks two values for reference equality.  This is different from the &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; operator, which checks whether two values are ''equivalent'' (e.g., two maps that contain equal key/value pairs, or two lists which contain equal values).&lt;br /&gt;
&lt;br /&gt;
Whenever &amp;lt;c&amp;gt;refEquals(a, b)&amp;lt;/c&amp;gt; is true (1), then you know that any modification of &amp;lt;c&amp;gt;a&amp;lt;/c&amp;gt; will also be seen via &amp;lt;c&amp;gt;b&amp;lt;/c&amp;gt;, because &amp;lt;c&amp;gt;a&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;b&amp;lt;/c&amp;gt; refer to the same object.&lt;br /&gt;
&lt;br /&gt;
For immutable types – &amp;lt;c&amp;gt;null&amp;lt;/c&amp;gt;s, &amp;lt;c&amp;gt;number&amp;lt;/c&amp;gt;s and &amp;lt;c&amp;gt;string&amp;lt;/c&amp;gt;'s – &amp;lt;c&amp;gt;refEquals&amp;lt;/c&amp;gt; returns the same result as the &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; operator.&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ''a'' || any value|| first argument&lt;br /&gt;
|-&lt;br /&gt;
| ''b'' || any value || second argument&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;a = {&amp;quot;foo&amp;quot;:42}&lt;br /&gt;
b = a&lt;br /&gt;
c = {&amp;quot;foo&amp;quot;:42}&lt;br /&gt;
print a == b          // prints 1, because a and b have the same value&lt;br /&gt;
print a == c          // prints 1, because a and c have the same value&lt;br /&gt;
print refEquals(a,b)  // prints 1, as these are the same map&lt;br /&gt;
print refEquals(a,c)  // prints 0, as these are different maps&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Intrinsic Functions]]&lt;br /&gt;
[[Category:Numeric Functions]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1138</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1138"/>
		<updated>2023-11-03T10:06:59Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: Removing space between - and A&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-A&amp;lt;/c&amp;gt; || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || slicing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
== Math-assignment operators ==&lt;br /&gt;
&lt;br /&gt;
In version ''1.6'' the math-assignment operators were added. They overwrite the value of the first operand variable with the result of the operation when performing the operator without assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
x = 42&lt;br /&gt;
x += 13  // x = x + 13&lt;br /&gt;
print x  // 55&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;hello.ms&amp;quot;&lt;br /&gt;
s -= &amp;quot;.ms&amp;quot;  // s = s - &amp;quot;.ms&amp;quot;&lt;br /&gt;
print s  // &amp;quot;hello&amp;quot;&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+=&amp;lt;/c&amp;gt; B || A = A + B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-=&amp;lt;/c&amp;gt; B || A = A - B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*=&amp;lt;/c&amp;gt; B || A = A * B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/=&amp;lt;/c&amp;gt; B || A = A / B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%=&amp;lt;/c&amp;gt; B || A = A % B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^=&amp;lt;/c&amp;gt; B || A = A ^ B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tricky spaces ==&lt;br /&gt;
&lt;br /&gt;
MiniScript allows an expression to be the entire statement (which is useful in [[REPL]] where it evaluates the expression and immediately prints the result).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
4 + 5           // REPL prints 9&lt;br /&gt;
&lt;br /&gt;
f = function(x,y)&lt;br /&gt;
	x + y       // the result is &amp;quot;dropped&amp;quot;&lt;br /&gt;
end function&lt;br /&gt;
f 4, 5          // prints nothing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few cases when using different spacing around operators in such expressions may make MiniScript confuse it with a function call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
X[Y]            // Index X with key Y&lt;br /&gt;
X [Y]           // Call function X with argument [Y]&lt;br /&gt;
&lt;br /&gt;
X-Y             // Subtract Y from X&lt;br /&gt;
X- Y            // Subtract Y from X&lt;br /&gt;
X -Y            // Call function X with argument -Y&lt;br /&gt;
X - Y           // Subtract Y from X&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Follow a simple convention to avoid such problems: put spaces around arithmetic operators and if possible don't use a space between an unary operator and its operand.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1137</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1137"/>
		<updated>2023-11-03T10:05:04Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: Removing space between A and brackets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || slicing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;A(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
== Math-assignment operators ==&lt;br /&gt;
&lt;br /&gt;
In version ''1.6'' the math-assignment operators were added. They overwrite the value of the first operand variable with the result of the operation when performing the operator without assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
x = 42&lt;br /&gt;
x += 13  // x = x + 13&lt;br /&gt;
print x  // 55&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;hello.ms&amp;quot;&lt;br /&gt;
s -= &amp;quot;.ms&amp;quot;  // s = s - &amp;quot;.ms&amp;quot;&lt;br /&gt;
print s  // &amp;quot;hello&amp;quot;&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+=&amp;lt;/c&amp;gt; B || A = A + B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-=&amp;lt;/c&amp;gt; B || A = A - B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*=&amp;lt;/c&amp;gt; B || A = A * B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/=&amp;lt;/c&amp;gt; B || A = A / B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%=&amp;lt;/c&amp;gt; B || A = A % B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^=&amp;lt;/c&amp;gt; B || A = A ^ B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tricky spaces ==&lt;br /&gt;
&lt;br /&gt;
MiniScript allows an expression to be the entire statement (which is useful in [[REPL]] where it evaluates the expression and immediately prints the result).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
4 + 5           // REPL prints 9&lt;br /&gt;
&lt;br /&gt;
f = function(x,y)&lt;br /&gt;
	x + y       // the result is &amp;quot;dropped&amp;quot;&lt;br /&gt;
end function&lt;br /&gt;
f 4, 5          // prints nothing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few cases when using different spacing around operators in such expressions may make MiniScript confuse it with a function call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
X[Y]            // Index X with key Y&lt;br /&gt;
X [Y]           // Call function X with argument [Y]&lt;br /&gt;
&lt;br /&gt;
X-Y             // Subtract Y from X&lt;br /&gt;
X- Y            // Subtract Y from X&lt;br /&gt;
X -Y            // Call function X with argument -Y&lt;br /&gt;
X - Y           // Subtract Y from X&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Follow a simple convention to avoid such problems: put spaces around arithmetic operators and if possible don't use a space between an unary operator and its operand.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1136</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1136"/>
		<updated>2023-11-03T09:31:56Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: About tricky spaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || slicing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
== Math-assignment operators ==&lt;br /&gt;
&lt;br /&gt;
In version ''1.6'' the math-assignment operators were added. They overwrite the value of the first operand variable with the result of the operation when performing the operator without assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
x = 42&lt;br /&gt;
x += 13  // x = x + 13&lt;br /&gt;
print x  // 55&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;hello.ms&amp;quot;&lt;br /&gt;
s -= &amp;quot;.ms&amp;quot;  // s = s - &amp;quot;.ms&amp;quot;&lt;br /&gt;
print s  // &amp;quot;hello&amp;quot;&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+=&amp;lt;/c&amp;gt; B || A = A + B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-=&amp;lt;/c&amp;gt; B || A = A - B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*=&amp;lt;/c&amp;gt; B || A = A * B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/=&amp;lt;/c&amp;gt; B || A = A / B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%=&amp;lt;/c&amp;gt; B || A = A % B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^=&amp;lt;/c&amp;gt; B || A = A ^ B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tricky spaces ==&lt;br /&gt;
&lt;br /&gt;
MiniScript allows an expression to be the entire statement (which is useful in [[REPL]] where it evaluates the expression and immediately prints the result).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
4 + 5           // REPL prints 9&lt;br /&gt;
&lt;br /&gt;
f = function(x,y)&lt;br /&gt;
	x + y       // the result is &amp;quot;dropped&amp;quot;&lt;br /&gt;
end function&lt;br /&gt;
f 4, 5          // prints nothing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few cases when using different spacing around operators in such expressions may make MiniScript confuse it with a function call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
X[Y]            // Index X with key Y&lt;br /&gt;
X [Y]           // Call function X with argument [Y]&lt;br /&gt;
&lt;br /&gt;
X-Y             // Subtract Y from X&lt;br /&gt;
X- Y            // Subtract Y from X&lt;br /&gt;
X -Y            // Call function X with argument -Y&lt;br /&gt;
X - Y           // Subtract Y from X&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Follow a simple convention to avoid such problems: put spaces around arithmetic operators and if possible don't use a space between an unary operator and its operand.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Mouse&amp;diff=1135</id>
		<title>Mouse</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Mouse&amp;diff=1135"/>
		<updated>2023-11-01T05:55:08Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: +.locked&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[Mini Micro]], the &amp;lt;msinline&amp;gt;mouse&amp;lt;/msinline&amp;gt; module is a small collection of functions related to detecting the mouse state, and controlling display of the mouse cursor.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Method !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| [[mouse.button]](''which=0'') || detect whether a mouse button is pressed&lt;br /&gt;
|-&lt;br /&gt;
| [[mouse.x]] || get the current X position of the mouse, in [[screen coordinates]]&lt;br /&gt;
|-&lt;br /&gt;
| [[mouse.y]] || get the current Y position of the mouse, in [[screen coordinates]]&lt;br /&gt;
|-&lt;br /&gt;
| [[mouse.visible]] || get or set whether the mouse cursor is visible&lt;br /&gt;
|-&lt;br /&gt;
| mouse.locked || get or set whether the mouse cursor is locked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[How to detect single mouse clicks]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Mini Micro]]&lt;br /&gt;
[[Category:Soda]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1134</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1134"/>
		<updated>2023-10-30T06:03:32Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Math-assignment operators */ Removing ambiguous &amp;quot;in-place&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || slicing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
== Math-assignment operators ==&lt;br /&gt;
&lt;br /&gt;
In version ''1.6'' the math-assignment operators were added. They overwrite the value of the first operand variable with the result of the operation when performing the operator without assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
x = 42&lt;br /&gt;
x += 13  // x = x + 13&lt;br /&gt;
print x  // 55&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;hello.ms&amp;quot;&lt;br /&gt;
s -= &amp;quot;.ms&amp;quot;  // s = s - &amp;quot;.ms&amp;quot;&lt;br /&gt;
print s  // &amp;quot;hello&amp;quot;&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+=&amp;lt;/c&amp;gt; B || A = A + B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-=&amp;lt;/c&amp;gt; B || A = A - B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*=&amp;lt;/c&amp;gt; B || A = A * B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/=&amp;lt;/c&amp;gt; B || A = A / B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%=&amp;lt;/c&amp;gt; B || A = A % B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^=&amp;lt;/c&amp;gt; B || A = A ^ B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1126</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1126"/>
		<updated>2023-10-07T07:54:05Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: + Math-assignment operators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || slicing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
== Math-assignment operators ==&lt;br /&gt;
&lt;br /&gt;
In version ''1.6'' the math-assignment operators were added. They perform an operation in-place on a variable provided as first operand. They overwrite the value of the first operand variable with the result of the operation when performing the operator without assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
x = 42&lt;br /&gt;
x += 13  // x = x + 13&lt;br /&gt;
print x  // 55&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;hello.ms&amp;quot;&lt;br /&gt;
s -= &amp;quot;.ms&amp;quot;  // s = s - &amp;quot;.ms&amp;quot;&lt;br /&gt;
print s  // &amp;quot;hello&amp;quot;&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+=&amp;lt;/c&amp;gt; B || A = A + B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-=&amp;lt;/c&amp;gt; B || A = A - B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*=&amp;lt;/c&amp;gt; B || A = A * B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/=&amp;lt;/c&amp;gt; B || A = A / B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%=&amp;lt;/c&amp;gt; B || A = A % B&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^=&amp;lt;/c&amp;gt; B || A = A ^ B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1125</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1125"/>
		<updated>2023-10-07T07:22:05Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || slicing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1124</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1124"/>
		<updated>2023-10-07T07:04:36Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: +func call&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || [[Slice | slicing]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;(&amp;lt;/c&amp;gt;B, C...&amp;lt;c&amp;gt;)&amp;lt;/c&amp;gt; || [[Function#Calling_a_Function | calling a function]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1123</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1123"/>
		<updated>2023-10-07T06:38:20Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: +indexing and slicing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || indexing&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;[&amp;lt;/c&amp;gt;B&amp;lt;c&amp;gt;:&amp;lt;/c&amp;gt;C&amp;lt;c&amp;gt;]&amp;lt;/c&amp;gt; || [[Slice | slicing]]&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1122</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1122"/>
		<updated>2023-10-07T06:22:07Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: +mod&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;%&amp;lt;/c&amp;gt; B || modulo (remainder)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || [[@ operator|address-of]] (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chaining Operators ==&lt;br /&gt;
&lt;br /&gt;
Most binary operators in MiniScript can be combined into chains, for example &amp;lt;c&amp;gt;39 + 2 + 1&amp;lt;/c&amp;gt;.  The details depend on the type of operator:&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
In an expression involving a chain of arithmetic operators, the highest-precedent operators are evaluated first, as in standard algebra.  You can always use parentheses to break such a chain into smaller chunks, forcing a different evaluation order.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;2 + 5 * 8&amp;lt;/c&amp;gt; || 42&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;(2 + 5) * 8&amp;lt;/c&amp;gt; || 56&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;3 ^ 2 + 4 ^ 2&amp;lt;/c&amp;gt; || 25&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
In the case of comparison operators (&amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt;), operands are compared in pairs from left to right.  All comparisons must be true for the complete chained expression to be considered true.  The most common use of this is to check whether a variable is in a certain range, with an expression like &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt;, which is true only if &amp;lt;c&amp;gt;x&amp;lt;/c&amp;gt; is between 0 and 10 (non-inclusive).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Given !! Result || Read As&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 5 || true || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10&amp;lt;/c&amp;gt; || x = 10 || false || x is between 0 and 10&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt;= 10&amp;lt;/c&amp;gt; || x = 10 || true || x is between 0 and 10 (including 10)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;0 &amp;lt; x &amp;lt; 10 &amp;lt; y&amp;lt;/c&amp;gt; || x = 5; y = 15 || true || x is between 0 and 10, and 10 is less than y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dot Operator ===&lt;br /&gt;
&lt;br /&gt;
A chain of [[Dot syntax|dot operations]] is evaluated one step at a time left to right.&lt;br /&gt;
&lt;br /&gt;
For example, given the code:&lt;br /&gt;
&amp;lt;ms&amp;gt;foo.bar.baz&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniScript proceeds in the following steps:&lt;br /&gt;
# &amp;lt;c&amp;gt;foo.bar&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;bar&amp;quot; in &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt; (and in the event that this references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to &amp;lt;c&amp;gt;foo&amp;lt;/c&amp;gt;.&lt;br /&gt;
# &amp;lt;c&amp;gt;.baz&amp;lt;/c&amp;gt; is evaluated by looking up &amp;quot;baz&amp;quot; in the result of step 1 (which should be a map). (And if &amp;quot;baz&amp;quot; references a function, it's invoked with &amp;lt;c&amp;gt;[[self]]&amp;lt;/c&amp;gt; bound to the map from step 1.)&lt;br /&gt;
&lt;br /&gt;
This can continue for an arbitrarily long chain of dot operators.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Operators&amp;diff=1114</id>
		<title>Operators</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Operators&amp;diff=1114"/>
		<updated>2023-10-05T15:57:16Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: About chained comparison&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MiniScript defines the following operators (listed in order from lowest to highest precedence):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operator !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;=&amp;lt;/c&amp;gt; B || assignment&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;or&amp;lt;/c&amp;gt; B || logical OR: true if either operand is true&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;and&amp;lt;/c&amp;gt; B || logical AND: true if both operands are true&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;not&amp;lt;/c&amp;gt; A || logical negation: true if its operand is false, and vice versa&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;[[isa]]&amp;lt;/c&amp;gt; B || type checking&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;==&amp;lt;/c&amp;gt; B || equality comparison: true if operands are equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;!=&amp;lt;/c&amp;gt; B || inequality comparison: true if operands are not equal&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt; B || greater-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt; B || less-than comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; B || greater-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; B || less-than or equal-to comparison&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;+&amp;lt;/c&amp;gt; B || addition or concatenation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt; B || subtraction or string trimming&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;*&amp;lt;/c&amp;gt; B || multiplication or replication&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;/&amp;lt;/c&amp;gt; B || division or reduction&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;-&amp;lt;/c&amp;gt;A || unary minus (numeric negation)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;[[new]]&amp;lt;/c&amp;gt; A || instantiation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;c&amp;gt;@&amp;lt;/c&amp;gt;A || address-of (reference function without invoking it)&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;c&amp;gt;^&amp;lt;/c&amp;gt; B || power: A raised to the power of B&lt;br /&gt;
|-&lt;br /&gt;
| A&amp;lt;c&amp;gt;.&amp;lt;/c&amp;gt;B || [[Dot syntax|dot operator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Chained comparison ==&lt;br /&gt;
&lt;br /&gt;
Operators &amp;lt;c&amp;gt;&amp;gt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;lt;&amp;lt;/c&amp;gt;, &amp;lt;c&amp;gt;&amp;gt;=&amp;lt;/c&amp;gt; and &amp;lt;c&amp;gt;&amp;lt;=&amp;lt;/c&amp;gt; support chaining:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
x = 42&lt;br /&gt;
if 13 &amp;lt; x &amp;lt;= 100 then  // same as if (13 &amp;lt; x) and (x &amp;lt;= 100) ...&lt;br /&gt;
	print &amp;quot;foo&amp;quot;&lt;br /&gt;
end if&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Print&amp;diff=1112</id>
		<title>Print</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Print&amp;diff=1112"/>
		<updated>2023-09-30T19:44:41Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; is an [[:Category:Intrinsic Functions|intrinsic function]] that displays a [[string]] to the user.  It is a standard intrinsic, though there may be some implementations where this output is not actually visible.  In implementations that have something like a standard output stream, &amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; adds the given string to that stream, typically followed by the standard line delimiter.&lt;br /&gt;
&lt;br /&gt;
See also: [[PixelDisplay.print]]&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| s || &amp;quot;&amp;quot; || string to display to the user&lt;br /&gt;
|-&lt;br /&gt;
| delimiter || &amp;lt;platform's new line&amp;gt; || string to follow '''s''' instead of standard delimiter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
&amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; returns [[null]], and so it is usually used as a statement.  As such, it does not require [[parentheses]] around its argument.&lt;br /&gt;
&lt;br /&gt;
The argument defaults to an empty string, so &amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; by itself may be used to print a blank line.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;print &amp;quot;Hello, world!&amp;quot;&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Intrinsic Functions]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Print&amp;diff=1111</id>
		<title>Print</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Print&amp;diff=1111"/>
		<updated>2023-09-30T19:42:11Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: delimiter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; is an [[:Category:Intrinsic Functions|intrinsic function]] that displays a [[string]] to the user.  It is a standard intrinsic, though there may be some implementations where this output is not actually visible.  In implementations that have something like a standard output stream, &amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; adds the given string to that stream, typically followed by the standard line delimiter.&lt;br /&gt;
&lt;br /&gt;
See also: [[PixelDisplay.print]]&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| s || &amp;quot;&amp;quot; || string to display to the user&lt;br /&gt;
|-&lt;br /&gt;
| delimiter || &amp;lt;platform's new line&amp;gt; || lines delimiter following '''s'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
&amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; returns [[null]], and so it is usually used as a statement.  As such, it does not require [[parentheses]] around its argument.&lt;br /&gt;
&lt;br /&gt;
The argument defaults to an empty string, so &amp;lt;c&amp;gt;print&amp;lt;/c&amp;gt; by itself may be used to print a blank line.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;print &amp;quot;Hello, world!&amp;quot;&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Intrinsic Functions]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Bibliography&amp;diff=1109</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Bibliography&amp;diff=1109"/>
		<updated>2023-09-06T18:24:51Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: /* Articles &amp;amp; Conference Proceedings */ + more recent articles + consistent chronology&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists published articles that include some nontrivial mention of MiniScript or Mini Micro.&lt;br /&gt;
&lt;br /&gt;
== Primary Sources ==&lt;br /&gt;
&lt;br /&gt;
Primary sources are those written by people directly involved.  Currently, that mostly means things written by [[User:JoeStrout|Joe Strout]].&lt;br /&gt;
&lt;br /&gt;
=== Books ===&lt;br /&gt;
&lt;br /&gt;
* Strout, J (2020). ''Learn to Code in 30 Days: with MiniScript and Mini Micro''.  MiniScript Press. ISBN 978-1-7361676-0-1.  (Also available as ebook: ISBN 978-1-7361676-2-5.)&lt;br /&gt;
&lt;br /&gt;
* Strout, J (2021). ''Introduction to Computer Programming: for kids of all ages''.  MiniScript Press.  ISBN 978-1-7361676-1-8.&lt;br /&gt;
&lt;br /&gt;
=== Articles &amp;amp; Conference Proceedings ===&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://ieeexplore.ieee.org/document/9625108 MiniScript: A new language for computer programming education.]&amp;quot; [http://istem-ed.com/istem-ed2021/ iSTEM-Ed] (2021). (preprint [https://miniscript.org/files/Strout_iSTEM-Ed2021.pdf PDF])&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/mini-micro-coding-introduction/ Introducing Mini Micro]&amp;quot; [https://beanzmag.com/ Beanz Magazine] February 2022, p. 8-9.&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/mini-micro-stars-experiment/ Experimental Coding]&amp;quot; [https://beanzmag.com/ Beanz Magazine] April 2022, p. 24-25.&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/mini-micro-space-game-project/ An Apple a Day...]&amp;quot; [https://beanzmag.com/ Beanz Magazine] June 2022, p. 13.&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/mini-micro-clock-timer/ Make a Clock Timer]&amp;quot; [https://beanzmag.com/ Beanz Magazine] August 2022, p. 13.&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/mini-micro-secret-message-rot13/ Loopy Secret Messages] [https://beanzmag.com/ Beanz Magazine] October 2022, p. 12-13.&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/farmtronics/ Auto-Code in Stardew Valley]&amp;quot; [https://beanzmag.com/ Beanz Magazine] December 2022, p. 4-5.&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/farmtronics-gardening-howto/ A Bot “Outstanding in its Field”]&amp;quot; [https://beanzmag.com/ Beanz Magazine] February 2023&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/farmtronics-finding-your-way/ Finding Your Way]&amp;quot; [https://beanzmag.com/ Beanz Magazine] April 2023&lt;br /&gt;
&lt;br /&gt;
* Strout, J. &amp;quot;[https://kidscodecs.com/minimicro-project-find-objects/ Explore Mars like a Rover]&amp;quot; [https://beanzmag.com/ Beanz Magazine] June 2023&lt;br /&gt;
&lt;br /&gt;
=== Blog Posts ===&lt;br /&gt;
&lt;br /&gt;
* Strout, Joe. &amp;quot;Why MiniScript?&amp;quot; Luminary Apps, 06 Sep. 2019, https://luminaryapps.com/blog/miniscript-why/.  Accessed 5 Dec. 2021.&lt;br /&gt;
&lt;br /&gt;
* Strout, Joe. &amp;quot;VT100 Escape Codes in Command-Line MiniScript&amp;quot; Luminary Apps, 03 Oct. 2021, https://luminaryapps.com/blog/vt100-codes/index.html.  Accessed 13 Jul 2022.&lt;br /&gt;
&lt;br /&gt;
* Strout, Joe. &amp;quot;Debugging with a Validate Method&amp;quot; Luminary Apps, 01 Nov. 2021, https://luminaryapps.com/blog/validate/index.html.  Accessed 13 Jul 2022.&lt;br /&gt;
&lt;br /&gt;
* Strout, Joe. &amp;quot;String Fill and Match&amp;quot; Luminary Apps, 10 Jun. 2022, https://luminaryapps.com/blog/ms-fill-match/index.html.  Accessed 13 Jul 2022.&lt;br /&gt;
&lt;br /&gt;
* Strout, Joe. &amp;quot;Advanced Tricks with Import&amp;quot; Luminary Apps, 16 Jun. 2022, https://luminaryapps.com/blog/advanced-import/index.html.  Accessed 13 Jul 2022.&lt;br /&gt;
&lt;br /&gt;
== Secondary Sources ==&lt;br /&gt;
&lt;br /&gt;
Secondary sources are those written by people not directly involved in the work.&lt;br /&gt;
&lt;br /&gt;
=== Blog Posts ===&lt;br /&gt;
&lt;br /&gt;
* Nozzi, Sebastian. “Neo-Retro Computing.” Dev.to, 20 Nov. 2021, https://dev.to/sebnozzi/about-mini-micro-short-1g0e. Accessed 5 Dec. 2021.&lt;br /&gt;
&lt;br /&gt;
* TopaAzul062. &amp;quot;Review of Learn to Code in 30 Days.&amp;quot; OnlineBookClub.org, 21 Oct 2021, https://forums.onlinebookclub.org/viewtopic.php?f=24&amp;amp;t=205860.  Accessed 5 Dec. 2021.&lt;br /&gt;
&lt;br /&gt;
* Khorne. &amp;quot;Where to begin, where to start?&amp;quot; Khornes MiniScript Journey, 2 Mar 2022, https://khornemsjourney.blogspot.com/2023/07/where-to-begin-where-to-start.html.  Accessed 2 Aug. 2023.  (Originally located [https://khornems.blogspot.com/2022/03/where-to-begin-where-to-start.html here].)&lt;br /&gt;
&lt;br /&gt;
* Kratt, Max. &amp;quot;Launch in Mini Micro&amp;quot;. Max Kratt's blog, 19 Jan 2023, https://maxkratt.hashnode.dev/launch-in-mini-micro&lt;br /&gt;
&lt;br /&gt;
* Tomes, Trey. “Fluent Interfaces.”  Micro-Hack wiki, 30 Mar 2023, https://github.com/treytomes/micro-hack/wiki/Fluent-Interfaces&lt;br /&gt;
&lt;br /&gt;
=== Pro Journalism ===&lt;br /&gt;
&lt;br /&gt;
* Stanton, Rich.  &amp;quot;Stardew Valley mod adds farming bots.&amp;quot; PC Gamer, 01 Jan. 2022, https://www.pcgamer.com/stardew-valley-mod-adds-farming-bots/&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Isa&amp;diff=1102</id>
		<title>Isa</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Isa&amp;diff=1102"/>
		<updated>2023-08-09T06:32:06Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: (fixed typos)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Because this wiki software does not allow topic names to begin with an underscore, this page contains two different topics.&lt;br /&gt;
&lt;br /&gt;
== isa (operator) ==&lt;br /&gt;
&amp;lt;c&amp;gt;isa&amp;lt;/c&amp;gt; is a [[:Category:Keywords|keyword]] binary [[operators|operator]] which tests the left-hand operator for membership in the type defined by the right-hand side.  That right-hand operand could be a user-defined map (to which the left-hand side might belong via the &amp;lt;c&amp;gt;__isa&amp;lt;/c&amp;gt; chain), or it could be one of the [[:Category:Data Types|built-in types]]: [[number]], [[string]], [[list]], [[map]], or [[funcRef]].&lt;br /&gt;
&lt;br /&gt;
=== Examples for built-in types ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&amp;quot;Hello&amp;quot; isa string    // returns 1&lt;br /&gt;
&amp;quot;Hello&amp;quot; isa number    // returns 0&lt;br /&gt;
123 isa number        // returns 1&lt;br /&gt;
&amp;quot;123&amp;quot; isa number      // returns 0 &lt;br /&gt;
[1,2,3] isa list      // returns 1&lt;br /&gt;
{&amp;quot;uno&amp;quot;:1,&amp;quot;dos&amp;quot;:2} isa map    // returns 1&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examples for user-defined types ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;&lt;br /&gt;
MyDefinedType = {}&lt;br /&gt;
MyOtherDefinedType = {}&lt;br /&gt;
&lt;br /&gt;
obj = new MyDefinedType&lt;br /&gt;
&lt;br /&gt;
obj isa MyDefinedType        // returns 1 - direct type&lt;br /&gt;
obj isa map                  // returns 1 - related by inheritance&lt;br /&gt;
&lt;br /&gt;
obj isa MyOtherDefinedType   // returns 0 - because unrelated&lt;br /&gt;
&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== __isa  (map entry) ==&lt;br /&gt;
&amp;lt;c&amp;gt;__isa&amp;lt;/c&amp;gt; is a special entry in a map that refers to the map's base class.  It is part of MiniScript's support for [[object-oriented programming]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Object-oriented programming]] in miniscript&lt;br /&gt;
* The [[map]] type&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
[[Category:Keywords]]&lt;br /&gt;
[[Category:Operators]]&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Wait&amp;diff=1098</id>
		<title>Wait</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Wait&amp;diff=1098"/>
		<updated>2023-07-06T13:38:15Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: Comment on yield&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;c&amp;gt;wait&amp;lt;/c&amp;gt; pauses execution of this script for some amount of time.&lt;br /&gt;
&lt;br /&gt;
Behind the scenes, it [[yield]]s on every frame until the requested amount of time has passed.&lt;br /&gt;
&lt;br /&gt;
See also: [[time]], [[yield]]&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ''seconds'' || 1.0 || how many seconds to wait&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;wait 2.5		// pauses the script for 2.5 seconds&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Intrinsic Functions]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Globals&amp;diff=1089</id>
		<title>Globals</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Globals&amp;diff=1089"/>
		<updated>2023-05-23T10:21:55Z</updated>

		<summary type="html">&lt;p&gt;Marc Gurevitx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''globals''' is a built-in keyword that references [[variables]] at the global scope.  In the main program, any assignment outside of any function creates (or updates) an entry in the '''globals''' map.&lt;br /&gt;
&lt;br /&gt;
Inside a function, an unqualified assignment (i.e. an assignment to an identifier that does not follow a dot — like ''x'' rather than ''foo.x'') creates a local variable.  Local variables exist only within the function where they are created, and disappear as soon as the function exits.  This is true even if there happens to already be a global variable of the same name.&lt;br /&gt;
&lt;br /&gt;
So, when you want to create or update a global variable inside a function, the '''globals''' keyword must be used on the left-hand side of the assignment.&lt;br /&gt;
&lt;br /&gt;
See also: [[locals]]; [[outer]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The ''check'' function below compares its parameter to a global variable.  The comparison does not need the '''globals''' keyword, because it's only reading the value (and there is no local variable of the same name).  But when it updates the global value, it has to use '''globals'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;lastValue = null&lt;br /&gt;
check = function(someValue)&lt;br /&gt;
    if someValue != lastValue then&lt;br /&gt;
        print &amp;quot;The value is now: &amp;quot; + someValue&lt;br /&gt;
        globals.lastValue = someValue  // &amp;lt;--- Note use of globals&lt;br /&gt;
    end if&lt;br /&gt;
end function&lt;br /&gt;
&lt;br /&gt;
x = 0&lt;br /&gt;
while true&lt;br /&gt;
    check round(x)&lt;br /&gt;
    x = x + 0.1&lt;br /&gt;
    wait 0.1&lt;br /&gt;
end while&amp;lt;/ms&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also note that the [[while]] loop at the end is at the global scope, so it does not need to use '''globals''' at all; globals and locals are the same in this case.&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
[[Category:Intrinsic Functions]]&lt;/div&gt;</summary>
		<author><name>Marc Gurevitx</name></author>
		
	</entry>
</feed>