Skip to content

Instantly share code, notes, and snippets.

@matthew-piziak
Created December 30, 2019 23:21
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 matthew-piziak/8b8f5667c0318791e7c89bb31408a36c to your computer and use it in GitHub Desktop.
Save matthew-piziak/8b8f5667c0318791e7c89bb31408a36c to your computer and use it in GitHub Desktop.
(setq pred-action-one '(nil (print "one")))
(setq pred-action-two '(t (print "two")))
(eval `(cond ,pred-action-one ,pred-action-two))
@informatimago
Copy link

(let ((pred-action-one (list nil (lambda () (print "one"))))
      (pred-action-two (list t   (lambda () (print "two")))))
  (funcall (second (find nil (list pred-action-one pred-action-two) :test-not (function eql)))))

@matthew-piziak
Copy link
Author

@informatimago Thank you! <3

I went with (some #'funcall '(pred-action-one pred-action-two)) and made the functions simple if statements. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment