Ramarren wrote:Anyway, I believe this is one of those cases where asking "why do you want to do that" is warranted. In almost all cases for associating strings or symbols with values dynamically hash tables are better.
I was interested in making a list of symbols that would be easy to manipulate as a list and yet could have all of the cool features of symbols. I had been looking at Paul Grahams Double-Linked List Structure and thought it was cool, but didn't like that it seemed like I would have to reinvent alot of functionality that was already in normal lists. I don't want to do 'wierd things' though and had strongly considered looking at hashes. I am interested in making a general html menu structure or class that can handle many sub-menus when appropriate yet also know given a page name where it fits in the structure. I have read that plists are both very cool (Graham) and are somewhat archaic (Steele). In this snippet below, if you know that a current page is 'MAIN, then without searching, you also know that it is a member of TOPMENU. I had envisioned only using these symbols in a special HTML package, so as to be isolated and can't really imagine over 50 of these symbols loaded up at any given time.
(setf TOPMENU (list 'MAIN 'GALLERY 'ABOUT 'CONTACT))
(setf MAIN(list 'MAIN_SUB1 'MAIN_SUB2))
(setf (get 'MAIN 'URL) "main.html")
(setf (get 'MAIN 'TITLE) "Main Page of Website")
(setf (get 'MAIN 'PARENT) 'TOPMENU)
Maybe this will just lead to inflexibility and more wierdness down the road and I should go back to looking at a combination of structures or classes and hash tables.
Thanks, hope this makes (some) sense, if you think this is odd, you should see what I was doing to php