How to implement a dictionary?
Posted: Mon Oct 17, 2005 1:24 pm
Hello
I have been reading the passage http://www.newlisp.org/DesignPatterns.h ... processing of the newlisp design patterns document. For me the paragraph about text processing is too terse and I do not really understand how to implement a dictionary.
For example I would like to implement the example given under http://en.wikipedia.org/wiki/Associative_array#Lisp.
(It shows how to use a dictionary/associative array in various languages. The example shown has name as key and phone number as value attribute).
How do I create a dictionary/associative array in newlisp?
How do I access the value of a certain key element?
How do I add a new entry?
How do I remove an entry?
How do I get a list of all keys?
If somebody already has some code snippets / comments explaining this issue that would be a great help. Thanks in advance.
--HJH
I have been reading the passage http://www.newlisp.org/DesignPatterns.h ... processing of the newlisp design patterns document. For me the paragraph about text processing is too terse and I do not really understand how to implement a dictionary.
For example I would like to implement the example given under http://en.wikipedia.org/wiki/Associative_array#Lisp.
(It shows how to use a dictionary/associative array in various languages. The example shown has name as key and phone number as value attribute).
How do I create a dictionary/associative array in newlisp?
How do I access the value of a certain key element?
How do I add a new entry?
How do I remove an entry?
How do I get a list of all keys?
If somebody already has some code snippets / comments explaining this issue that would be a great help. Thanks in advance.
--HJH