Last active
April 18, 2021 13:11
-
-
Save jchros/d6573e39df554025cfe4abf87dc7dcdf to your computer and use it in GitHub Desktop.
Revisions
-
jchros revised this gist
Apr 18, 2021 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,14 @@ (defmacro valsetf (values-form . places) "Assigns the values of VALUES-FORM to the given PLACES. If VALUES-FORM yields more values than there are fields in PLACES, the remaining values are discarded. If there are more fields in PLACES than there are values returned by the VALUES-FORM, the remaining fields are initialized to NIL." (assert places) (let* ((*gensym-counter* 1) (gensyms (mapcar #'(lambda (_) (declare (ignore _)) (gensym "VALUE")) places))) `(multiple-value-bind ,gensyms ,values-form -
jchros created this gist
Apr 17, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ (defmacro valsetf (values-form . places) "Assigns the values of VALUES-FORM to the given PLACES." (assert places) (let* ((*gensym-counter* 1) (gensyms (mapcar #'(lambda (*) (declare (ignore *)) (gensym "VALUE")) places))) `(multiple-value-bind ,gensyms ,values-form (setf ,@(mapcan #'list places gensyms)))))