From: George H. <geo...@us...> - 2005-12-14 13:50:46
|
Update of /cvsroot/win32forth/win32forth/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8720/win32forth/src Modified Files: Module.f Log Message: gah: Added documentation for dexh to module.f Index: Module.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/Module.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Module.f 21 Dec 2004 00:19:08 -0000 1.1 --- Module.f 14 Dec 2005 13:50:30 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- + \ $Id$ + \ MODULE.F Local Definitions for Modules by Tom Zimmer *************** *** 9,15 **** \ multiple files 8Aug03 gah ! \ Modified INTERNAL to only a new module if pre-voc is zero or the hidden vocabulary is not \ at the top of the search order to allow using either MODULE or PREVIOUS to be used to end ! \ a module cr .( Loading Modules...) --- 11,34 ---- \ multiple files 8Aug03 gah ! \ Modified INTERNAL to only start a new module if pre-voc is zero or the hidden vocabulary is not \ at the top of the search order to allow using either MODULE or PREVIOUS to be used to end ! \ a module ! ! \ *! doc\p-module W32F modules ! \ *T Using the Module Wordset ! \ *P Win32Forth implements the ANSI search-order wordset and extensions as well as it's ! \ ** own set of words for constructing modules. Since the module wordset works by manipulating ! \ ** the search order then care should be taken when using the module wordset and search order ! \ ** wordset together. If the search order is changed with the search order words it should be ! \ ** restored to it's previous state before any of the words INTERNAL EXTERNAL or MODULE are ! \ ** executed. Similarly since the object compiler also manipulates the search order the same ! \ ** criterion applies while building classes or objects (with :OBJECT). The words INTERNAL ! \ ** EXTERNAL and MODULE should not be executed within a CLASS or OBJECT although they can ! \ ** be used before and after the CLASS or OBJECT. ! ! \ *S Error Handling ! ! \ *P If an uncaught error occurs while building a module then the default error handler resets ! \ ** the state of the module wordset as though the module had been finished correctly. cr .( Loading Modules...) *************** *** 25,37 **** forth definitions ! : (PRIVATE) ( xt-of-voc-- ) \ Set vocabulary for internal definitions dup @ [ ' forth @ ] literal <> abort" must be a Vocabulary" is hidden-voc ; ! : PRIVATE ( -<voc>- ) \ Set vocabulary for internal definitions ' (private) ; ! : INTERNAL ( -- ) \ start the internal list of words for a module context @ [ ' hidden-voc >body ] literal @ vcfa>voc = pre-voc and \ 0 if starting module --- 44,67 ---- forth definitions ! \ *S Glossary ! ! : (PRIVATE) ( xt-of-voc -- ) ! \ *G Set the vocabulary for internal definitions for the next module to be built. ! \ ** This is a non-parsing version of the word PRIVATE. dup @ [ ' forth @ ] literal <> abort" must be a Vocabulary" is hidden-voc ; ! : PRIVATE ( -<voc>- ) ! \ *G Set the vocabulary for internal definitions for the next module to be built. ! \ ** This is a parsing version of the word (PRIVATE). ' (private) ; ! : INTERNAL ( -- ) ! \ *G If a module hasn't yet been started or the internal vocabulary isn't the context ! \ ** vocabulary add the internal vocabulary to the search order and save the current ! \ ** vocabulary as the external vocabulary, then make the current vocabulary the internal ! \ ** vocabulary. If a module is already being built then make the current vocabulary ! \ ** the internal vocabulary. context @ [ ' hidden-voc >body ] literal @ vcfa>voc = pre-voc and \ 0 if starting module *************** *** 41,49 **** then ; ! : EXTERNAL ( -- ) \ Start the external list of words for a module pre-voc 0= abort" Use Only while building a module" pre-voc current ! ; ! : MODULE ( -- ) \ complete the module EXTERNAL context @ [ ' hidden-voc >body ] literal @ --- 71,83 ---- then ; ! : EXTERNAL ( -- ) ! \ *G Make the external vocabulary the current vocabulary. pre-voc 0= abort" Use Only while building a module" pre-voc current ! ; ! : MODULE ( -- ) ! \ *G Complete the module by making the external vocabulary the current vocabulary, ! \ ** removing the internal vocabulary from the search order if it's the context ! \ ** vocabulary and resetting the internal vocabulary to hidden. EXTERNAL context @ [ ' hidden-voc >body ] literal @ *************** *** 71,95 **** \S ! ! (PRIVATE) xt-of-voc -- ! ! .. Use vocab as hidden vocabulary for next module .. ! ! PRIVATE -<vocab>- ! ! .. Use -<vocab>- as hidden vocabulary for next module .. ! ! INTERNAL ! ! .. internal definitions .. ! ! EXTERNAL ! ! .. externally available definitions .. ! ! MODULE ! ! .. back to whatever vocabulary we started in .. ! ! ! --- 105,107 ---- \S ! \ *Z |