0 Members and 1 Guest are viewing this topic.
@pBeI just noticed your latest edit now. Your latest edit code looks good (looks to meet the specifications).
Hi,To avoid calling apply (or eval) at each loop, it would be more efficient to set f to (eval f) before the loops and simply call (f item) at each loop.Code - Auto/Visual Lisp: [Select](defun deleteif (f l / loop) (defun loop (f l) (cond ((not l) l) ((f (car l)) (deleteif f (cdr l))) ((cons (car l) (deleteif f (cdr l)))) ) ) (loop (eval f) l))