newLISP Fan Club

Forum => newLISP in the real world => Topic started by: TedWalther on June 10, 2010, 12:37:39 AM

Title: Self evaluating results of rb-tree lookups?
Post by: TedWalther on June 10, 2010, 12:37:39 AM
I want to stash some code in red-black trees.  I'd like it to automatically execute when I access it.



For instance,



(foo "bar" '(println "hi"))



When I do



(foo "bar")



I want the result to be



true



And also have the side effecting of printing "hi" to the console.



What is the best way to go about doing this?
Title: Re: Self evaluating results of rb-tree lookups?
Post by: TedWalther on June 10, 2010, 02:08:54 AM
I just had to overcome my fear of eval.   Problem solved.