From: George H. <geo...@us...> - 2011-03-01 21:52:08
|
Update of /cvsroot/win32forth/win32forth/Help/html In directory vz-cvs-4.sog:/tmp/cvs-serv18263 Modified Files: w32f-HelpOthers.htm w32f-HelpPresent.htm w32f-locals.htm w32f-memory.htm Log Message: Added documentation for {: :} locals and minor corrections Index: w32f-locals.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/Help/html/w32f-locals.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** w32f-locals.htm 8 Aug 2009 19:02:55 -0000 1.2 --- w32f-locals.htm 1 Mar 2011 21:52:06 -0000 1.3 *************** *** 9,17 **** <h1>Local variables (or named input parameters)</h2> ! <p>Thought including the ANS ! standard LOCALS word set, W32F also implement a more useful set (ported from the Macintosh Forth system Yerkes, formerly Neon). The ANSI Standard "Local" is similar to what are called "args" in this ! documentation, except for reversed order. </p> <h2>Syntax</h2> --- 9,19 ---- <h1>Local variables (or named input parameters)</h2> ! <p>Though including the ANS ! standard LOCALS word set, W32F also implement a more useful set (originally ported from the Macintosh Forth system Yerkes, formerly Neon). The ANSI Standard "Local" is similar to what are called "args" in this ! documentation, except for reversed order. W32F also supports (since V6.15.01) ! the proposed new 200X standard locals extension, which is similar to the Yerkes ! system except {: and :} replace { and }. </p> <h2>Syntax</h2> *************** *** 27,58 **** <p>You can have 0 or more args or ! locals up to a total of 12. The <code>--</code> and <code>}</code> are required parts of the syntax. Anything between <code>--</code> and <code>}</code> is treated as a comment and does not do anything. The following are all valid argument declarations: </p> ! <pre> { -- } \ does nothing ! { arg -- } \ one input argument ! { \ local -- } \ one local (not initialized!) ! { arg \ local -- } \ one arg and one local ! { arg1 arg2 -- result } \ two args </pre></blockquote> <p>The args and locals are similar to "values", in the sense that the value of the current arg or local is pushed on the stack during execution of a definition when the name is ! encountered. The content of an arg or local may be changed by using <code>TO</code> or <code>+TO</code> . </p> <h2>Restrictions</h2> <ol start=1 type=1> ! <li>Left brace '<code>{</code>' must be first word if used in a <code>:M</code> method definition. </li> ! <li>Total numbor of args and locals is limited to 12. </li> <li>Only ordinary (single cell) numbers are supported. Neither Double numbers nor floating point numbers are supported. <code>LOCALALLOC:</code> can be used for Doubles, Floats and strings. </li> <li>Locals are not initialized. </li> - <li>Names cannot begin with '\' '-' or '}' </li> <li>A definition may have only one occurrence ! of the use of either <code>{</code> or <code>LOCALS|</code> . ! If one is used in a definition, the other may NOT be used! </li> <li>Locals can't be declared inside of control structures. </li> <li>Only the return address should be on the --- 29,69 ---- <p>You can have 0 or more args or ! locals up to a total of 12. The <code>}</code> or <code>:}</code> is a required part of the syntax. Anything between <code>--</code> and <code>}</code> is treated as a comment and does not do anything. The following are all valid argument declarations: </p> ! <pre> { } \ does nothing ! { -- } \ does nothing ! { arg -- } \ one input argument ! { | local -- } \ one local (not initialized!) ! { arg | local -- } \ one arg and one local ! { arg1 arg2 -- result } \ two args ! {: :} \ does nothing ! {: -- :} \ does nothing ! {: arg -- :} \ one input argument ! {: | local -- :} \ one local (not initialized!) ! {: arg | local -- :} \ one arg and one local ! {: arg1 arg2 -- result :} \ two args ! { \ local -- } \ one local (not initialized!) ! { arg \ local -- } \ one arg and one local ! </pre></blockquote> <p>The args and locals are similar to "values", in the sense that the value of the current arg or local is pushed on the stack during execution of a definition when the name is ! encountered. The content of an arg or local may be changed by using <code>TO</code> or <code>+TO</code> . The older <code>\</code> seperator cannot be used with <code>{:</code> and <code>:}</code> which only accepts <code>|</code> . Also <code>{</code> must be terminated with <code>}</code> , while <code>{:</code> must be temrninated with <code>:}</code></p> <h2>Restrictions</h2> <ol start=1 type=1> ! <li>Left brace '<code>{</code>' or '<code>{:</code>' must be the first word if used in a <code>:M</code> method definition. </li> ! <li>Total numbor of args and locals is limited to 16. </li> <li>Only ordinary (single cell) numbers are supported. Neither Double numbers nor floating point numbers are supported. <code>LOCALALLOC:</code> can be used for Doubles, Floats and strings. </li> <li>Locals are not initialized. </li> <li>A definition may have only one occurrence ! of the use of any of <code>{</code> , <code>{:</code> or <code>LOCALS|</code> . ! If one is used in a definition, the others may NOT be used! </li> <li>Locals can't be declared inside of control structures. </li> <li>Only the return address should be on the Index: w32f-HelpPresent.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/Help/html/w32f-HelpPresent.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** w32f-HelpPresent.htm 28 May 2008 04:01:07 -0000 1.2 --- w32f-HelpPresent.htm 1 Mar 2011 21:52:06 -0000 1.3 *************** *** 31,36 **** <li><img border=0 width=16 height=18 src="../Res/Hwww.bmp"> icon ! means an external link that will take you to the wordlwide web (need an ! internet connexion) </li> </ul> --- 31,36 ---- <li><img border=0 width=16 height=18 src="../Res/Hwww.bmp"> icon ! means an external link that will take you to the wordlwide web (needs an ! internet connection) </li> </ul> Index: w32f-memory.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/Help/html/w32f-memory.htm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** w32f-memory.htm 15 May 2008 07:36:49 -0000 1.1 --- w32f-memory.htm 1 Mar 2011 21:52:06 -0000 1.2 *************** *** 23,29 **** handle result flags, except for <code>REALLOC</code>.</p> ! <p><code>MALLOC ( n -- addr )</code> allocate n bytes of heap memory, at addr</p> ! <p><code>REALLOC ( n addr -- addr' flag )</code> resize a previously allocated block of memory to ! the new size n - n may be less or more than previously allocated - return possibly new address addr' and flag=0 if success</p> <p><code>RELEASE ( addr -- )</code> release the previously allocated memory block</p> --- 23,29 ---- handle result flags, except for <code>REALLOC</code>.</p> ! <p><code>MALLOC ( u -- addr )</code> allocate n bytes of heap memory, at addr</p> ! <p><code>REALLOC ( u addr -- addr' flag )</code> resize a previously allocated block of memory to ! the new size u - u may be less or more than previously allocated - return possibly new address addr' and flag=0 if success</p> <p><code>RELEASE ( addr -- )</code> release the previously allocated memory block</p> *************** *** 33,39 **** <h2>ANS heap memory management</h2> ! <p><code>ALLOCATE ( n -- addr flag )</code> allocate n bytes of memory, give addr and flag=0 if success</p> ! <p><code>RESIZE ( a1 n1 -- a2 flag )</code> resize memory at addr1 to n1 bytes, return possibly new ! address a2 and flag=0 if success</p> <p><code>FREE ( addr -- flag )</code> release memory, flag=0 if success</p> --- 33,39 ---- <h2>ANS heap memory management</h2> ! <p><code>ALLOCATE ( u -- addr flag )</code> allocate n bytes of memory, give addr and flag=0 if success</p> ! <p><code>RESIZE ( addr1 u -- addr2 flag )</code> resize memory at addr1 to u bytes, return possibly new ! address addr2 and flag=0 if success</p> <p><code>FREE ( addr -- flag )</code> release memory, flag=0 if success</p> Index: w32f-HelpOthers.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/Help/html/w32f-HelpOthers.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** w32f-HelpOthers.htm 28 May 2008 04:01:07 -0000 1.2 --- w32f-HelpOthers.htm 1 Mar 2011 21:52:06 -0000 1.3 *************** *** 74,78 **** important unless you have defined a particular word more than once. Also you cannot get help about words that cannot be found in dictionary searches, such ! as "hidden" words or methods in classes. One advantage of theese tools, however, is that they can find information about any word that is currently loaded (conversely, the present help system knows only the words that --- 74,78 ---- important unless you have defined a particular word more than once. Also you cannot get help about words that cannot be found in dictionary searches, such ! as "hidden" words or methods in classes. One advantage of these tools, however, is that they can find information about any word that is currently loaded (conversely, the present help system knows only the words that |