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: | 741 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 74:17:58 |
| Calls: | 12,449 |
| Calls today: | 4 |
| Files: | 15,194 |
| Messages: | 6,537,658 |