I have a set of functions called "ip", "date", "url", etc.
With this, I want to generate another set of functions: "ip-is", "date-is", etc.
I finally got the following solution, which works fine, but uses "eval".
(loop for name in '(ip date url code bytes referer user-agent) do
(let ((c-name (intern (concatenate 'string (symbol-name name) "-IS"))))
(eval `(defun ,c-name (c)
Can someone help me how to get rid of the "evil eval"? It is very important for my program that the function names are presented as a list. So call for some marcro
(define-predicate ip)
(define-predicate date)
(define-predicate url)
etc..
not fit my needs. I don't have a real problem with "eval", but I read very often that eval is considered bad and should be avoided if possible.
Thank Advance
source
share