rev 526 - trunk/docs/tutorial

SVN User <[email protected]> Fri, 21 May 2004 01:05:42 -0400
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-05-21 01:05:39 -0400 (Fri, 21 May 2004)
New Revision: 526

Modified:
   trunk/docs/tutorial/outline1.htm
   trunk/docs/tutorial/tutorial3.htm
   trunk/docs/tutorial/tutorial4.htm
Log:
added symbols to tutorial

Modified: trunk/docs/tutorial/outline1.htm
===================================================================
--- trunk/docs/tutorial/outline1.htm	2004-05-21 04:25:31 UTC (rev 525)
+++ trunk/docs/tutorial/outline1.htm	2004-05-21 05:05:39 UTC (rev 526)
@@ -100,8 +100,16 @@
                   <li><a href="tutorial3.htm#negnum">Negative Numbers</a> 
                   <li><a href="tutorial3.htm#defind"> Default Indexes</a> 
                   <li><a href="tutorial3.htm#strfunc">String Functions</a> 
+
+                    </ul>
+                  
+              <li><a href="tutorial3.htm#symbols">3.4 Symbols</a> 
+                <ul>
+                      
+                  <li><a href="tutorial3.htm#symbolsyntax">Symbol Syntax</a> 
+                  <li><a href="tutorial3.htm#symsample">Constants &amp; Functions</a> 
                 </ul>
-              <li><a href="tutorial4.htm#lists">3.4 Lists</a> 
+              <li><a href="tutorial4.htm#lists">3.5 Lists</a> 
                 <ul>
                   <li><a href="tutorial4.htm#entlist">Entering a List</a> 
                   <li><a href="tutorial4.htm#indlist">List Indexing</a> 
@@ -109,12 +117,12 @@
                   <li><a href="tutorial4.htm#listassign">Assignment and del</a> 
                   <li><a href="tutorial4.htm#listfunc">List Functions and !</a> 
                 </ul>
-              <li><a href="tutorial4.htm#tuples">3.5 Tuples</a> 
+              <li><a href="tutorial4.htm#tuples">3.6 Tuples</a> 
                 <ul>
                   <li><a href="tutorial4.htm#tucr">Entering a Tuple</a> 
                   <li><a href="tutorial4.htm#tufun">Functions</a> 
                 </ul>
-              <li><a href="tutorial4.htm#dicts">3.6 Dictionaries</a> 
+              <li><a href="tutorial4.htm#dicts">3.7 Dictionaries</a> 
                 <ul>
                   <li><a href="tutorial4.htm#keyval">Keys and Values</a> 
                   <li><a href="tutorial4.htm#keyrules">Rules about Keys</a> 
@@ -124,6 +132,7 @@
                     !</a> 
                 </ul>
             </ul>
+          
           <li>4. <a href="tutorial5.htm#flowcntrl">Flow Control</a> 
             <ul>
               <li><a href="tutorial5.htm#if-then-else">4.1 If-Elif-Else</a> 
@@ -186,8 +195,7 @@
                   <li><a href="tutorial6.htm#passref">Pass By Reference</a> 
                   <li><a href="tutorial6.htm#noneobj">None Object</a> 
                   <li><a href="tutorial6.htm#rtrnstmt">Return Statement</a> 
-                  </ul>
-				  
+                </ul>
               <li><a href="tutorial7.htm#self">5.4 Self, Methods &amp; Binding</a> 
                 <ul>
                   <li><a href="tutorial7.htm#selfscope">Self Scope Object</a> 
@@ -196,9 +204,8 @@
                   <li><a href="tutorial7.htm#selfexpl">Explicit Self</a> 
                   <li><a href="tutorial7.htm#methods">Methods</a> 
                   <li><a href="tutorial7.htm#binding">Binding</a> 
-                  <li><a href="tutorial7.htm#boundmethod">Bound Methods</a>
+                  <li><a href="tutorial7.htm#boundmethod">Bound Methods</a> 
                 </ul>
-               
               <li><a href="tutorial7.htm#expr">5.5 Expressions</a> 
                 <ul>
                   <li><a href="tutorial7.htm#exprfunc">Operators = Functions</a> 
Modified: trunk/docs/tutorial/tutorial3.htm
===================================================================
--- trunk/docs/tutorial/tutorial3.htm	2004-05-21 04:25:31 UTC (rev 525)
+++ trunk/docs/tutorial/tutorial3.htm	2004-05-21 05:05:39 UTC (rev 526)
@@ -219,10 +219,30 @@
 >>>'<'+" x ".rStrip()+'>' # remove white space from right
 &lt; x&gt;
 >>>'<'+" x ".strip()+'>'  # remove white space from sides
-&lt;x&gt;
+&lt;x&gt;</pre>
 
+        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="symbols"></a>3.4 
+          Symbols</font> </p>
+        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="symbolsyntax"></a></font>A 
+          symbol is a special type of object similar to a string that holds Prothon 
+          variable names. A symbol may only have the characters &quot;a&quot; 
+          to &quot;z&quot;, &quot;A&quot; to &quot;Z&quot;, the digits &quot;0&quot; 
+          to &quot;9&quot;, the underbar &quot;_&quot;, the exclamation mark &quot;!&quot;, 
+          and the question mark &quot;?&quot;. It may not begin with a digit and 
+          the exclamation mark and question mark may only appear at the end.</p>
+        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="symsample"></a></font>You 
+          may put a symbol in the code as a constant by typing the variable name 
+          prefixed with a reverse quote symbol ( ` ). You may also convert a string 
+          to a symbol with &quot;Symbol(str)&quot; and do the reverse with &quot;String(symbol)&quot;.</p>
+        <pre>>>> sym = `var_name
+`var_name
+>>> print String(sym)
+var_name
+>>> print Symbol("init_")
+`init_
+>>>
+
 </pre>
-
       </td>
     </tr>
   </table>
Modified: trunk/docs/tutorial/tutorial4.htm
===================================================================
--- trunk/docs/tutorial/tutorial4.htm	2004-05-21 04:25:31 UTC (rev 525)
+++ trunk/docs/tutorial/tutorial4.htm	2004-05-21 05:05:39 UTC (rev 526)
@@ -33,7 +33,7 @@
   <table width="630" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffee" height="1707">
     <tr> 
       <td height="3521" valign="top"> 
-        <p align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="lists"></a>3.4 
+        <p align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="lists"></a>3.5 
           Lists</font></p>
         <p align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="entlist"></a></font>A 
           Prothon list is a sequential list of objects. Each object can be of 
@@ -137,7 +137,7 @@
 >>> list.reverse!()
 [6, 4, 3, 2, 1, 0]
 >>></pre>
-        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="tuples"></a>3.5 
+        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="tuples"></a>3.6 
           Tuples</font> </p>
         <p>Tuples are almost exactly like lists except for one big difference. 
           They are immutable. This means you cannot change the items in a tuple 
@@ -173,7 +173,7 @@
 >>> tuple.index(2)
 1
 >>></pre>
-        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="dicts"></a>3.6 
+        <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="dicts"></a>3.7 
           Dictionaries</font> </p>
         <p><font face="Verdana, Arial, Helvetica, sans-serif" size="+2"><a name="keyval"></a></font>A 
           dictionary is a mutable (changeable) collection of objects like the