Self evaluating results of rb-tree lookups?

Q&A's, tips, howto's
Locked
TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Self evaluating results of rb-tree lookups?

Post by TedWalther »

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?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: Self evaluating results of rb-tree lookups?

Post by TedWalther »

I just had to overcome my fear of eval. Problem solved.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

Locked