Browse Source

Merge branch 'master' into add_list_contains_to_docs

Marco Bambini 8 years ago
parent
commit
592e39bd3d
3 changed files with 14 additions and 5 deletions
  1. 10 1
      docs/lists.html
  2. 2 2
      docs/operators.html
  3. 2 2
      docs/syntax.html

+ 10 - 1
docs/lists.html

@@ -118,7 +118,7 @@
 			</code></pre>
 			
 			<h4 class="section-h4">List as a stack</h4>
-			<p>The List class implements the push/pop methods as a convenient way to threat a list as a stack:</p> 
+			<p>The List class implements the push/pop methods as a convenient way to treat a list as a stack:</p> 
 			<pre><code class="swift">
 	var list = [10,20,30,40,50];
 	list.push(100);		// add 100 to the list
@@ -132,6 +132,15 @@
 	var list = [1, 2, "Hello", 3.1415, true];
 	return list.contains(3.1415); // Returns: true
 			</code></pre>
+            
+			<h4 class="section-h4">List Joins</h4>
+			<p>The List class implements the join method as a convenient way to
+			interpret a list as a string:</p> 
+			<pre><code class="swift">
+	var list = [1,2,3,4,5];
+	list.join(" + "); // Becomes: "1 + 2 + 3 + 4 + 5"
+			</code></pre>
+            
        	</div> <!-- /row -->
        </div> <!-- /main-content -->
      </div> <!-- /container -->

+ 2 - 2
docs/operators.html

@@ -124,7 +124,7 @@
 				<li>Greater than or equal (>=)</li>
 				<li>Identical (===)</li>
 				<li>Not identical (!==)</li>
-				<li>Type check (isa)</li>
+				<li>Type check (is)</li>
 				<li>Pattern match (~=)</li>
 			</ul>
 			</p>
@@ -136,7 +136,7 @@
 	1 > 2		// false because 1 is not greater than 2
 	1 >= 1		// true because 1 is greater than or equal to 1
 	1 === 1		// true because 1 is identical to 1 (same value and same class)
-	1 isa Int	// true because 1 is of class Int
+	1 is Int	// true because 1 is of class Int
 			</code></pre>
 			<p>Gravity performs some conversions at runtime, so 1 == "1" but not 1 === '1'.</p>
 

+ 2 - 2
docs/syntax.html

@@ -127,7 +127,7 @@
 			<h4 class="section-h4">Reserved Keywords</h4>
 			<p>Like many other programming languages Gravity has some reserved keywords that assumes a very specific meaning in the context of the source code:</p>
 			<pre><code class="swift">
-	if in or isa for var and not func else true enum case null
+	if in or is for var and not func else true enum case null
 	file lazy super false break while class const event _func
 	_args struct repeat switch return public static extern
 	import module default private continue internal undefined
@@ -193,4 +193,4 @@
     <script>hljs.initHighlightingOnLoad();</script>
     
 	</body>
-</html>
+</html>