Plaster
New
List
Login
common-lisp
default
phoe
2022.02.05 23:05:58
CL-USER> (defvar *things* nil) *THINGS* CL-USER> (pushnew 'thing1 *things*) (THING1) CL-USER> (deftype thing () `(member ,@*things*)) THING CL-USER> (defun foo (thing) (check-type thing thing) thing) FOO CL-USER> (foo 'thing1) THING1 CL-USER> (pushnew 'thing2 *things*) (THING2 THING1) CL-USER> (deftype thing () `(member ,@*things*)) THING CL-USER> (defun foo (thing) (check-type thing thing) thing) WARNING: redefining COMMON-LISP-USER::FOO in DEFUN FOO CL-USER> (foo 'thing2) THING2
Raw
Annotate
Repaste