Plaster
New
List
Login
common-lisp
default
anonymous
2021.04.14 12:33:46
(defun foo (thing) (alexandria:switch (thing :test (lambda (thing list) (member thing list :test #'equal))) ('(1 2 3) :number) ('("1" "2" "3") :string) ('(:one :two :three) :keyword))) Cl-USER> (foo 1) :NUMBER Cl-USER> (foo "2") :STRING Cl-USER> (foo :three) :KEYWORD
Raw
Annotate
Repaste
Edit