Hi, On 03/20/2013 11:29 PM, Enoch wrote: > Hello AmForth-ers: > > Did any of you put "wordlists" into a good use?
yes. I use this to create a separate wordlist, which is used to parse a special source code structure. I need a special wordlist, because I need to *temporarily* "overload" the meaning of some important words. I have also used this to reduce the available wordlist on the serial interface after startup. Also, Lubos Pekny (forth.cz) uses wordlists to separate things. > I suspect the answer is no for a simple reason. To use it, say, to > create a private "scope" ("namespace") of words / variables / constants > one needs to wrap each dictionary entry with calls to get-current, > get-order, set-current, set-order, ... too much trouble. > > What if we decide that all names that begin with a tilde (~) should > *automatically* be created into a specific private wordlist. How can we > accomplish that? Well. I do use a number of words myself starting with ~ (tilde). And I do not agree at all, that creating special prefixes *for everyone* and do something entirely different with those words, is the way to go. Even if I need to explicitly enable the feature, I do not want to have the freedom of choosing token names stumpled upon. Remember the FORTRAN rule of "undeclared variables starting with [I-N] are assumed integer"? How awkward. Can I at least choose the prefix freely? Can it be more than one character? Recognizers would be the way to go, I think. Who stops you from implementing this for your use and put the resulting code into a message on the list ? (reminder: I will not look at code elsewhere) And why do you want your solution to be included into the amforth distribution and *enabled by default*? What use cases for the suggested feature are you currently looking at? Are there other ways to accomplish your goal? Why is this way the ultimate thing to do? Imho Forth is about simplicity. You suggest to add a bit of complexity (automagic different behaviour). > > Here's my suggestion for your review: > > If I am correct the kernel word "header ( addr len wid -- voc-link )" is > responsible for creating dictionary entries of all kinds. What if this > "header" would begin with a call to a (e)deferred word, say, "autoscope" > that would examine the new entry name (via "addr len") and would set the > "wid" etc. as needed. > > In the best Forth tradition let this "autoscope" be initially a NOP and > allow the programmer to introduce whatever naming scheme he/she desires > via a subsequent IS. But that is a penalty of 1 call to noop for every call of header, and for everyone. ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel