I prefer to use KEY and TEST keyword arguments that default to #'IDENTITY
and #'EQL.
(defun duplic8 (element list &key (test #'eql) (key #'identity))
(loop for x in list
collect x
when (funcall test (funcall key x) element) collect x))
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 797 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 185:51:39 |
| Calls: | 13,202 |
| Calls today: | 1 |
| Files: | 15,490 |
| Messages: | 6,579,519 |