[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shorter form of frequently-seen lisp idiom?
From: |
rgb |
Subject: |
Re: shorter form of frequently-seen lisp idiom? |
Date: |
22 Feb 2005 10:29:23 -0800 |
User-agent: |
G2/0.2 |
> Rule of thumb: if your solution uses `eval' it's either buggy or
clunky.
Interesting, I've never heard this.
My elisp isn't all that great yet so I looked for instances where
I use it.
(defun tacl-eldoc-function ()
"Returns a documentation string for context near point or nil"
(let ((word (thing-at-point 'symbol)))
(if word
(eval (intern-soft (upcase word) tacl-eldoc-obarray)))))
tacl-eldoc-obarray is populated like this.
(set (intern "FOO" tacl-eldoc-obarray) "FOO help text here")
(set (intern "BAR" tacl-eldoc-obarray) "BAR help text")
...
I thought this might be an exception to your rule because apply
doesn't apply. But then it occured to me that symbol-value is
probably what I should have coded.
Is there a collection of more such tips someplace?
Thanks
Rick
Re: shorter form of frequently-seen lisp idiom?, Stefan Monnier, 2005/02/22
- Re: shorter form of frequently-seen lisp idiom?,
rgb <=
Re: shorter form of frequently-seen lisp idiom?, Oliver Scholz, 2005/02/22
RE: shorter form of frequently-seen lisp idiom?, Drew Adams, 2005/02/22
Message not availableRe: shorter form of frequently-seen lisp idiom?, rgb, 2005/02/23