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: | 765 |
| Nodes: | 16 (1 / 15) |
| Uptime: | 02:54:06 |
| Calls: | 12,761 |
| Calls today: | 5 |
| Files: | 15,362 |
| Messages: | 6,557,012 |