Randal Schwartz stole Lisp's decorate-sort-undecorate idiom when he came up with what we'd later call the Schwartzian transform. All of my Lisp knowledge disappeared through nine half lives, but I gave it a shot in SBCL. I'm aiming for an idiomatic example I can use in a presentation about the history of the Schwartzian transform.
This works (and I know I can generalize it further), but I wonder how Lisp-y it is:
(require :sb-posix) (defun schwartzian-files-mtime ( glob-pattern ) (map 'list #'cdr (stable-sort (map 'list ( lambda (x) ( cons (sb-posix:stat-mtime (sb-posix:stat x)) x ) ) (directory glob-pattern) ) #'< :key #'car ) ) ) (schwartzian-files-mtime "/etc/*")