Skip to content

Instantly share code, notes, and snippets.

@vendethiel
Created April 20, 2021 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vendethiel/cfbd1a444e4a1d2ca42ea6b35ba0b35a to your computer and use it in GitHub Desktop.
Save vendethiel/cfbd1a444e4a1d2ca42ea6b35ba0b35a to your computer and use it in GitHub Desktop.
Not a very good implementation of a not very impressive feature
(defmacro dart (&rest xs)
(flet ((wrap (x) (if (and (consp x) (eq 'if (car x)))
`(if ,(cadr x) (list ,(caddr x)))
`(list ,x))))
`(mapcan #'identity (list ,@(mapcar #'wrap xs)))))
(princ (list-length (dart
1
(if t 0))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment