Message 1 of 23
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have a need to check if the variables v1 v2 v3 "" are equivalent, and if true, then set these variables to nil. To solve this problem, I created the following code:
(mapcar
'set '(v1 v2 v3)
(mapcar
'(lambda ( x ) (if (= "" x) (setq x nil) x))
(list v1 va2 v3)
)
)
My question is, is it possible to optimize this code so as not to repeat the list of variables twice? That is, exclude the repetition
'(v1 v2 v3) and (list v1 v2 v3) and define the list of variables once.
Solved! Go to Solution.