Skip to content

Instantly share code, notes, and snippets.

@fouric
Created July 10, 2019 15:43
Show Gist options
  • Save fouric/ced465a3c22c4aac6f20ce6c14c17adb to your computer and use it in GitHub Desktop.
Save fouric/ced465a3c22c4aac6f20ce6c14c17adb to your computer and use it in GitHub Desktop.
(set-dispatch-macro-character #\# #\l
(lambda (stream c n)
(declare (ignore c))
(let ((list (read stream nil (values) t))
(arg-names '(x y z w)))
(when (consp list)
(let ((n (if n
(min (1- (length arg-names)) n)
0)))
`(lambda (,@(subseq arg-names 0 n))
,list))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment