How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?
stndshp at gmail.com
Thu Aug 19 02:23:02 CEST 2010
On Aug 17, 6:38 pm, John Passaniti <john.passan... at gmail.com> wrote:
> You asked if Forth "borrowed" lists from Lisp. It did not. In Lisp,
> lists are constructed with pair of pointers called a "cons cell".
> That is the most primitive component that makes up a list. Forth has
> no such thing; in Forth, the dictionary (which is traditionally, but
> not necessarily a list) is a data structure that links to the previous
> word with a pointer.
Would you show me a picture, ascii art or whatever for Forth ? I know
what lisp lists look like so I dont need that for comparison. Forth
must have a convention and a standard or preferred practice for its
dicts. However, let me tell you that in postscript the dictionaries
can be nested inside other dictionaries and any such hiearchical
structure is a nested associative list, which is what linked list,
nested dictionaries, nested tables are.
> This is in fact one of the nice things about
> Lisp; because all lists are created out of the same primitive cons
> cell, you can consistently process any list in the system. In Forth,
> any lists (such as the dictionary, if it is a list) are specific to
> their purpose and have to be treated individually.
> I don't know what you mean by "nested-dictionaries." There is no such
> thing in Forth. Dictionaries don't nest. You can create wordlists,
> but each wordlist is flat. When most people think of a nested
> dictionary, they would think of a structure that would allow any
> arbitrary level of nesting, not a string of flat wordlists.
More information about the Python-list