From: Matthias T. <mt...@we...> - 2010-07-04 15:45:41
|
My second try to forward my message. Sorry. -------- Weitergeleitete Nachricht -------- Von: Matthias Trute <mt...@we...> An: pito <pi...@vo...> Betreff: Re: [Amforth-devel] Starting with amforth v4 Datum: Sun, 04 Jul 2010 14:57:30 +0200 Am Samstag, den 03.07.2010, 20:53 +0200 schrieb pito: > Matthias, > I see the marker usage with sieve example. If you mark the set of words > with -foo2 where is the end of the marked area (as you may have X words > defined)? Is that the next new marker position? It means (wordlist): > > bla bla -foo3 hello hello -foo2 happy happy -foo1 > <-----------> <---------------> <---------------> the area of marker > > -foo2 > > bla bla -foo3 happy happy -foo1 > <-----------> <---------------> > > or > > bla bla -foo3 ...................happy happy -foo1 ?? > <-----------> <---------------> > > My understanding is it works like a "file system" so a deleted -foo will > create a free space for new words - am I right? calling -foo1 will erase everything left to it: all happy's, the -foo2, the hello's and the bla's and -foo3. You association with a file system and (perhaps) directories (for wordlists) is misleading somehow. marker resets the whole dictionary to the state when the marker-word is defined. That frees all allocated ressources as well for re-use (RAM, EEPROM, Flash). > As I uploaded lot of stuff for my naive experiments and the word list > is now very long so the way how the list is maintained seems to be a > challenge.. word lists are simple linear lists, that are searched item by item. There is no index or whatever comes to mind. Simple and slow. But easy to implement and IMHO good enough: worst case szenario: The whole dictionary is limited in size (64KWords), each dictionary entry is at least 4 words in size. If you add another 4 words for the real code, you will have some 8000 entries in the list. I did not yet benchmark this situation, but I'd guess, it is still usable. If you do have concerns with the interactive speed, you can organize the interactive words in a separate wordlist that is searched first by the interpreter. Once the words are compiled, the word list length is no longer relevant. Matthias |