<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to keywords-const</title><link>https://sourceforge.net/p/asil/wiki/keywords-const/</link><description>Recent changes to keywords-const</description><atom:link href="https://sourceforge.net/p/asil/wiki/keywords-const/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 18 Feb 2014 10:01:57 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/asil/wiki/keywords-const/feed" rel="self" type="application/rss+xml"/><item><title>keywords-const modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/keywords-const/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -10,6 +10,8 @@
 Modifying class declarations
 ============================
 When you declare a class as constant, all non-static data members become both **const** and **[readonly](keywords-readonly)**.  All non-static methods become **const** and non-static properties are limited to **[get](keywords-accessors)**.  **const** can't be combined with **[static](keywords-static)** when used as a class modifier.  **const** goes before the **[class](keywords-class)** keyword.  **const** classes are effectively immutable.
+
+All operators are already **const** and can be used with any type declared **const**.

 ~~~~
 :::text
@@ -73,3 +75,7 @@
 ~~~~

 If this is a prototype for an **[interface](keywords-interface)**, **[abstract](keywords-abstract)** **[class](keywords-class)**, or for use as a **[delegate](keywords-delegate)** type; **[instructions](keywords-instructions)** must be followed by a list of types that will correspond to the variables made visible by the complex statement.  Otherwise, **[instructions](keywords-instructions)** must be followed by the actual variables.
+
+Operators
+---------
+All operators are already **const** and don't require use of the **const** keyword.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Tue, 18 Feb 2014 10:01:57 -0000</pubDate><guid>https://sourceforge.net0b0e17303f8921d726d4a83c20e690c0bf84eb44</guid></item><item><title>keywords-const modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/keywords-const/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -8,7 +8,7 @@
 * To declare that a method won't change the any data members or call anything that could change a data member.

 Modifying class declarations
-----------------------------
+============================
 When you declare a class as constant, all non-static data members become both **const** and **[readonly](keywords-readonly)**.  All non-static methods become **const** and non-static properties are limited to **[get](keywords-accessors)**.  **const** can't be combined with **[static](keywords-static)** when used as a class modifier.  **const** goes before the **[class](keywords-class)** keyword.  **const** classes are effectively immutable.

 ~~~~
@@ -18,12 +18,58 @@
 ~~~~

 Declaring a run-time constant
------------------------------
-These are similar to **[conditional](keywords-conditional)** variables, except these are associated with a class and can't be used inside **[conditionalif](keywords-conditionalif)** statements.  Variables declared this way are both **const** (as described below and) **[readonly](keyword-readonly)**.
+=============================
+These are similar to **[conditional](keywords-conditional)** variables, except these are associated with a class and can't be used inside **[conditionalif](keywords-conditionalif)** statements.  Variables declared this way are both **const** (as described below and) **[readonly](keyword-readonly)**.  These variables are automatically **[static](keywords-static)** and not part of any one instance of the enclosing type.

 ~~~~
 :::text
-\const\ /TypeName/ /Identifier/ \=\ /Value/
+\const\ /TypeDescriptor/ /Identifier/ \=\ /Value/
 ~~~~

-/TypeName/ must be a type descriptor as described in [Type descriptors](Appendices-Terms-Type descriptors).  /Value/ must be an [R-Value](Appendices-Terms-r-value).
+/TypeDescriptor/ must be a type descriptor as described in [Type descriptors](Appendices-Terms-Type descriptors).  /Value/ must be an [R-Value](Appendices-Terms-r-value).
+
+Declaring a constant variable that isn't readonly
+=================================================
+If you combine **const** with **[var](keywords-var)** (in either order), you get a constant variable that doesn't have **[readonly](keywords-readonly)** applied to it.  Such variables can be initialized either when declared or by the **[constructor](keywords-constructor)**.  They can be **[static](keywords-static)** or non-**[static](keywords-static)**.  Regardless of how they are declared, they must be initialized by the time the **[constructor](keywords-constructor)** returns.  Otherwise, the compiler must issue an error.
+
+~~~~
+:::text
+(\var\ \const\ | \const\ \var\) /identifier/ [= /DefaultValue/]
+~~~~
+
+Declaring a constant method
+===========================
+If you place **const** between the access qualifier and the command/function/statement keywords, you're declaring a procedure that doesn't change any non-static data members or call anything that could change a non-static data member.  The compiler is required to enforce this rule.  **const** methods can be **[static](keywords-static)**, **[virtual](keywords-virtual)**, or **[abstract](keywords-abstract) as needed.
+
+In each case, /DeclarationSequence/ must be as described in [Declaration sequence](Appendices-Terms-Declaration sequence).  /TypeDescriptor/ must be as described in [Type descriptors](Appendices-Terms-Type descriptors).
+
+Commands
+--------
+~~~~
+:::text
+(\public\ | \protected\ | \private\) [\const\] [\static\] | [(\virtual\ | \abstract\)] \command\ [/DeclarationSequence/]
+    [\throws\ /TypeDescriptor/]
+  ' Run some code here
+~~~~
+
+Functions
+---------
+~~~~
+:::text
+(\public\ | \protected\ | \private\) [\const\] [\static\] | [(\virtual\ | \abstract\)] \command\ [/DeclarationSequence/]
+    (\returns\ /TypeDescriptor/ |
+    [\throws\ TypeDescriptor])
+  ' Run some code here
+~~~~
+
+Complex statements
+------------------
+~~~~
+:::text
+(\public\ | \protected\ | \private\) [\const\] [\static\] | [(\virtual\ | \abstract\)] \statement\ [/DeclarationSequence/]
+    [\throws\ /TypeDescriptor/]
+  ' Run some code here
+  \instructions\ ' See notes below
+~~~~
+
+If this is a prototype for an **[interface](keywords-interface)**, **[abstract](keywords-abstract)** **[class](keywords-class)**, or for use as a **[delegate](keywords-delegate)** type; **[instructions](keywords-instructions)** must be followed by a list of types that will correspond to the variables made visible by the complex statement.  Otherwise, **[instructions](keywords-instructions)** must be followed by the actual variables.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Tue, 18 Feb 2014 10:00:03 -0000</pubDate><guid>https://sourceforge.net33b4509294623a06bbf5d3f940433381cfa3b7fb</guid></item><item><title>keywords-const modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/keywords-const/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Tue, 18 Feb 2014 09:35:35 -0000</pubDate><guid>https://sourceforge.netb277c6982a268b5b48bbfe85c8ec3ffdd50eeb47</guid></item><item><title>keywords-const modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/keywords-const/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#modifying-class-declarations"&gt;Modifying class declarations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#declaring-a-run-time-constant"&gt;Declaring a run-time constant&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;strong&gt;const&lt;/strong&gt; keyword can be used in several different ways.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As a class modifier&lt;/li&gt;
&lt;li&gt;To declare a run-time constant&lt;/li&gt;
&lt;li&gt;To declare that what a reference points to can't be changed&lt;/li&gt;
&lt;li&gt;To declare that a method won't change the any data members or call anything that could change a data member.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="modifying-class-declarations"&gt;Modifying class declarations&lt;/h2&gt;
&lt;p&gt;When you declare a class as constant, all non-static data members become both &lt;strong&gt;const&lt;/strong&gt; and &lt;strong&gt;&lt;a class="" href="../keywords-readonly"&gt;readonly&lt;/a&gt;&lt;/strong&gt;.  All non-static methods become &lt;strong&gt;const&lt;/strong&gt; and non-static properties are limited to &lt;strong&gt;&lt;a class="" href="../keywords-accessors"&gt;get&lt;/a&gt;&lt;/strong&gt;.  &lt;strong&gt;const&lt;/strong&gt; can't be combined with &lt;strong&gt;&lt;a class="" href="../keywords-static"&gt;static&lt;/a&gt;&lt;/strong&gt; when used as a class modifier.  &lt;strong&gt;const&lt;/strong&gt; goes before the &lt;strong&gt;&lt;a class="" href="/p/asil/wiki/keywords-class/"&gt;class&lt;/a&gt;&lt;/strong&gt; keyword.  &lt;strong&gt;const&lt;/strong&gt; classes are effectively immutable.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;[(\static\ | \const\)] \class\ /identifier/
  ' Declare nested-types, nested type-less named structures, data members, constructors, static constructors, creators, static creators, destructors, methods, and properties as needed
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="declaring-a-run-time-constant"&gt;Declaring a run-time constant&lt;/h2&gt;
&lt;p&gt;These are similar to &lt;strong&gt;&lt;a class="" href="/p/asil/wiki/keywords-conditional/"&gt;conditional&lt;/a&gt;&lt;/strong&gt; variables, except these are associated with a class and can't be used inside &lt;strong&gt;&lt;a class="" href="/p/asil/wiki/keywords-conditionalif/"&gt;conditionalif&lt;/a&gt;&lt;/strong&gt; statements.  Variables declared this way are both &lt;strong&gt;const&lt;/strong&gt; (as described below and) &lt;strong&gt;&lt;a class="" href="../keyword-readonly"&gt;readonly&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;\const\ /TypeName/ /Identifier/ \=\ /Value/
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;/TypeName/ must be a type descriptor as described in &lt;a class="" href="../Appendices-Terms-Type%20descriptors"&gt;Type descriptors&lt;/a&gt;.  /Value/ must be an &lt;a class="" href="../Appendices-Terms-r-value"&gt;R-Value&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Tue, 18 Feb 2014 09:35:17 -0000</pubDate><guid>https://sourceforge.net480ca0bf0549bf9d610570cada84f53fc0b9b3fc</guid></item></channel></rss>