Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@gitlab:/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl# grep -A 40 -i "defmacro pushnew" . -R
- --
- ./reference/rcyc/cynd/cl.lisp:(defmacro pushnew (item place) (ret `(progn (cpushnew ,item ,place) ,place)))
- --
- ./reference/rcyc/cynd/common.lisp:(defmacro pushnew (item place &key key test test-not) (ret (fif test (list 'cpushnew item place test)(list 'cpushnew item place))))
- --
- ./reference/rcyc/cynd/cb_prolog.lisp: (defmacro pushnew (item place) (ret `(progn (cpushnew ,item ,place) ,place)))
- ./reference/rcyc/cynd/cb_prolog.lisp- (define map (result-type function &body sequences)
- ./reference/rcyc/cynd/cb_prolog.lisp- (let ((result (map-sequences function sequences)))
- ./reference/rcyc/cynd/cb_prolog.lisp- (ret (fif result-type (coerce result result-type) nil))))
- ./reference/rcyc/cynd/cb_prolog.lisp-
- --
- ./reference/ccl/lib/setf.lisp:(defmacro pushnew (value place &rest keys &environment env)
- ./reference/ccl/lib/setf.lisp- "Takes an object and a location holding a list. If the object is
- ./reference/ccl/lib/setf.lisp- already in the list, does nothing; otherwise, conses the object onto
- ./reference/ccl/lib/setf.lisp- the list. Returns the modified list. If there is a :TEST keyword, this
- ./reference/ccl/lib/setf.lisp- is used for the comparison."
- ./reference/ccl/lib/setf.lisp- (if (not (consp place))
- ./reference/ccl/lib/setf.lisp- `(setq ,place (adjoin ,value ,place ,@keys))
- ./reference/ccl/lib/setf.lisp- (let ((valvar (gensym)))
- ./reference/ccl/lib/setf.lisp- (multiple-value-bind (dummies vals store-var setter getter)
- ./reference/ccl/lib/setf.lisp- (get-setf-method place env)
- ./reference/ccl/lib/setf.lisp- `(let* ((,valvar ,value)
- ./reference/ccl/lib/setf.lisp- ,@(mapcar #'list dummies vals)
- ./reference/ccl/lib/setf.lisp- (,(car store-var) (adjoin ,valvar ,getter ,@keys)))
- ./reference/ccl/lib/setf.lisp- ,@dummies
- ./reference/ccl/lib/setf.lisp- ,(car store-var)
- ./reference/ccl/lib/setf.lisp- ,setter)))))
- ./reference/ccl/lib/setf.lisp-
- --
- ./reference/ccl/lib/setf.lisp:(defmacro pushnew (item place &rest key-args)
- ./reference/ccl/lib/setf.lisp- (let ((item-gsym (gensym)))
- ./reference/ccl/lib/setf.lisp- (if (not (consp place))
- ./reference/ccl/lib/setf.lisp- `(let ((,item-gsym ,item))
- ./reference/ccl/lib/setf.lisp- (setq ,place (adjoin ,item-gsym ,place ,@key-args)))
- ./reference/ccl/lib/setf.lisp- (let* ((arg-num (1- (length place)))
- ./reference/ccl/lib/setf.lisp- (place-args (make-gsym-list arg-num)))
- ./reference/ccl/lib/setf.lisp- `(let ,(cons (list item-gsym item)
- ./reference/ccl/lib/setf.lisp- (reverse (assoc-2-lists place-args (cdr place))))
- ./reference/ccl/lib/setf.lisp- (setf (,(car place) ,@place-args)
- ./reference/ccl/lib/setf.lisp- (adjoin ,item-gsym (,(car place) ,@place-args)
- ./reference/ccl/lib/setf.lisp- ,@key-args)))))))
- ./reference/jscl/src/setf.lisp:(defmacro pushnew (x place &rest keys &key key test test-not)
- ./reference/jscl/src/setf.lisp- (declare (ignore key test test-not))
- ./reference/jscl/src/setf.lisp- (multiple-value-bind (dummies vals newval setter getter)
- ./reference/jscl/src/setf.lisp- (!get-setf-expansion place)
- ./reference/jscl/src/setf.lisp- (let ((g (gensym))
- ./reference/jscl/src/setf.lisp- (v (gensym)))
- ./reference/jscl/src/setf.lisp- `(let* ((,g ,x)
- ./reference/jscl/src/setf.lisp- ,@(mapcar #'list dummies vals)
- ./reference/jscl/src/setf.lisp- ,@(cdr newval)
- ./reference/jscl/src/setf.lisp- (,v ,getter))
- ./reference/jscl/src/setf.lisp- (if (member ,g ,v ,@keys)
- ./reference/jscl/src/setf.lisp- ,v
- ./reference/jscl/src/setf.lisp- (let ((,(car newval) (cons ,g ,getter)))
- ./reference/jscl/src/setf.lisp- ,setter))))))
- --
- ./reference/sbcl/src/code/setf.lisp:(sb!xc:defmacro pushnew (obj place &rest keys &environment env)
- ./reference/sbcl/src/code/setf.lisp- "Takes an object and a location holding a list. If the object is
- ./reference/sbcl/src/code/setf.lisp- already in the list, does nothing; otherwise, conses the object onto
- ./reference/sbcl/src/code/setf.lisp- the list. Keyword arguments are accepted as per the ADJOIN function."
- ./reference/sbcl/src/code/setf.lisp- ;; Can't specify the actual keywords above since, apparently,
- ./reference/sbcl/src/code/setf.lisp- ;; non-constant keywords should be accepted.
- ./reference/sbcl/src/code/setf.lisp- (declare (sb!c::lambda-list (obj place &key key test test-not)))
- ./reference/sbcl/src/code/setf.lisp- ;; Passing AFTER-ARGS-BINDP = NIL causes the forms subsequent to PLACE
- ./reference/sbcl/src/code/setf.lisp- ;; to be inserted literally as-is, giving the (apparently) desired behavior
- ./reference/sbcl/src/code/setf.lisp- ;; of *not* evaluating them before the Read/Modify/Write of PLACE, which
- ./reference/sbcl/src/code/setf.lisp- ;; seems to be an exception to the 5.1.3 exception on L-to-R evaluation.
- ./reference/sbcl/src/code/setf.lisp- ;; The spec only mentions that ITEM is eval'd before PLACE.
- ./reference/sbcl/src/code/setf.lisp- (expand-rmw-macro 'adjoin (list obj) place keys nil env '(item)))
- --
- ./reference/abcl/macros.lisp:(defmacro pushnew (&environment env item place &rest keys)
- ./reference/abcl/macros.lisp- (if (and (symbolp place)
- ./reference/abcl/macros.lisp- (eq place (macroexpand place env)))
- ./reference/abcl/macros.lisp- `(setq ,place (adjoin ,item ,place ,@keys))
- ./reference/abcl/macros.lisp- (multiple-value-bind (dummies vals newval setter getter)
- ./reference/abcl/macros.lisp- (get-setf-expansion place env)
- ./reference/abcl/macros.lisp- (let ((g (gensym)))
- ./reference/abcl/macros.lisp- `(let* ((,g ,item)
- ./reference/abcl/macros.lisp- ,@(mapcar #'list dummies vals)
- ./reference/abcl/macros.lisp- (,(car newval) (adjoin ,g ,getter ,@keys)))
- ./reference/abcl/macros.lisp- ,setter)))))
- ./reference/abcl/macros.lisp-
- --
- ./reference/xlisp500/wam-cl-init6.lisp:(defmacro pushnew (item place &rest rest)
- ./reference/xlisp500/wam-cl-init6.lisp- `(unless (member ,item ,place ,@rest)
- ./reference/xlisp500/wam-cl-init6.lisp- (push ,item ,place)))
- --
- ./reference/clisp/src/places.lisp:(defmacro pushnew (item place &rest keylist &environment env)
- ./reference/clisp/src/places.lisp- (multiple-value-bind (temps subforms stores setterform getterform)
- ./reference/clisp/src/places.lisp- (get-setf-expansion place env)
- ./reference/clisp/src/places.lisp- (let ((itemtemps (gensym-list (length stores)))
- ./reference/clisp/src/places.lisp- (bindlist (mapcar #'list temps subforms))
- ./reference/clisp/src/places.lisp- (oldtemps (gensym-list (length stores))))
- ./reference/clisp/src/places.lisp- (optimized-wrap-multiple-value-bind env itemtemps item
- ./reference/clisp/src/places.lisp- (wrap-let* bindlist
- ./reference/clisp/src/places.lisp- (optimized-wrap-multiple-value-bind env oldtemps getterform
- ./reference/clisp/src/places.lisp- ;; We're not blindly optimizing this to
- ./reference/clisp/src/places.lisp- ;; (sublis-in-form
- ./reference/clisp/src/places.lisp- ;; (mapcar #'(lambda (storevar itemvar oldvar)
- ./reference/clisp/src/places.lisp- ;; (cons storevar `(ADJOIN ,itemvar ,oldvar ,@keylist)))
- ./reference/clisp/src/places.lisp- ;; stores itemtemps oldtemps)
- ./reference/clisp/src/places.lisp- ;; setterform)
- ./reference/clisp/src/places.lisp- ;; because we don't want the ADJOIN forms to be evaluated multiple
- ./reference/clisp/src/places.lisp- ;; times. Instead we rely on simple-occurrence-in-basic-block-p for
- ./reference/clisp/src/places.lisp- ;; doing the analysis.
- ./reference/clisp/src/places.lisp- (optimized-wrap-let* env
- ./reference/clisp/src/places.lisp- (mapcar #'(lambda (storevar itemvar oldvar)
- ./reference/clisp/src/places.lisp- (list storevar `(ADJOIN ,itemvar ,oldvar ,@keylist)))
- ./reference/clisp/src/places.lisp- stores itemtemps oldtemps)
- ./reference/clisp/src/places.lisp- setterform)))))))
- ./reference/clisp/src/places.lisp-;;;----------------------------------------------------------------------------
- --
- ./reference/emacs-cl/cl-conses.el:(cl:defmacro PUSHNEW (object place &rest keys)
- ./reference/emacs-cl/cl-conses.el- (MULTIPLE-VALUE-BIND (temps values variables setter getter)
- ./reference/emacs-cl/cl-conses.el- (GET-SETF-EXPANSION place nil) ;TODO: environment
- ./reference/emacs-cl/cl-conses.el- (with-gensyms (obj)
- ./reference/emacs-cl/cl-conses.el- `(LET* ((,obj ,object)
- ./reference/emacs-cl/cl-conses.el- ,@(MAPCAR #'list temps values)
- ./reference/emacs-cl/cl-conses.el- (,(first variables) (ADJOIN ,obj ,getter ,@keys)))
- ./reference/emacs-cl/cl-conses.el- ,setter))))
- ./reference/emacs-cl/cl-conses.el-
- --
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp:(defmacro pushnew (item place
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- &environment env
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- &rest args
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- &key
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (key nil key-p)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (test nil test-p)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (test-not nil test-not-p))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (declare (ignorable test test-not))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (if (and test-p test-not-p)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (progn (warn 'warn-both-test-and-test-not-given
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- :name 'pushnew)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- `(error 'both-test-and-test-not-given :name 'pushnew))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (let ((item-var (gensym)))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (multiple-value-bind (vars vals store-vars writer-form reader-form)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (get-setf-expansion place env)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- `(let ((,item-var ,item)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- ,@(mapcar #'list vars vals)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- ,@(make-bindings args))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- ,@(if key-p `((declare (ignorable key))) `())
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (let ((,(car store-vars) ,reader-form))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- ,(if key
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (if test-p
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- `(unless (|member test=other key=other|
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- 'pushnew
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (funcall key ,item-var)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- ,(car store-vars)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- test
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- key)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (push ,item-var ,(car store-vars)))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (if test-not-p
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- `(unless (|member test-not=other key=other|
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- 'pushnew
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (funcall key ,item-var)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- ,(car store-vars)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- test-not
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- key)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (push ,item-var ,(car store-vars)))
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- `(unless (|member test=eql key=other|
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- 'pushnew
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- (funcall key ,item-var)
- ./reference/SICL/Code/Cons/pushnew-defmacro.lisp- ,(car store-vars)
- --
- ./reference/SICL/Code/Cons-high/cons-high.lisp:(defmacro pushnew (item place
- ./reference/SICL/Code/Cons-high/cons-high.lisp- &environment env
- ./reference/SICL/Code/Cons-high/cons-high.lisp- &rest args
- ./reference/SICL/Code/Cons-high/cons-high.lisp- &key
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (key nil key-p)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (test nil test-p)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (test-not nil test-not-p))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (declare (ignorable test test-not))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (if (and test-p test-not-p)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (progn (warn 'warn-both-test-and-test-not-given
- ./reference/SICL/Code/Cons-high/cons-high.lisp- :name 'pushnew)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- `(error 'both-test-and-test-not-given :name 'pushnew))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (let ((item-var (gensym)))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (multiple-value-bind (vars vals store-vars writer-form reader-form)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (get-setf-expansion place env)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- `(let ((,item-var ,item)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- ,@(mapcar #'list vars vals)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- ,@(make-bindings args))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- ,@(if key-p `((declare (ignorable key))) `())
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (let ((,(car store-vars) ,reader-form))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- ,(if key
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (if test-p
- ./reference/SICL/Code/Cons-high/cons-high.lisp- `(unless (|member test=other key=other|
- ./reference/SICL/Code/Cons-high/cons-high.lisp- 'pushnew
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (funcall key ,item-var)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- ,(car store-vars)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- test
- ./reference/SICL/Code/Cons-high/cons-high.lisp- key)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (push ,item-var ,(car store-vars)))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (if test-not-p
- ./reference/SICL/Code/Cons-high/cons-high.lisp- `(unless (|member test-not=other key=other|
- ./reference/SICL/Code/Cons-high/cons-high.lisp- 'pushnew
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (funcall key ,item-var)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- ,(car store-vars)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- test-not
- ./reference/SICL/Code/Cons-high/cons-high.lisp- key)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (push ,item-var ,(car store-vars)))
- ./reference/SICL/Code/Cons-high/cons-high.lisp- `(unless (|member test=eql key=other|
- ./reference/SICL/Code/Cons-high/cons-high.lisp- 'pushnew
- ./reference/SICL/Code/Cons-high/cons-high.lisp- (funcall key ,item-var)
- ./reference/SICL/Code/Cons-high/cons-high.lisp- ,(car store-vars)
- --
- ./reference/ecl/src/lsp/setf.lsp:(defmacro pushnew (&environment env item place &rest rest)
- ./reference/ecl/src/lsp/setf.lsp- "Syntax: (pushnew form place {keyword-form value-form}*)
- ./reference/ecl/src/lsp/setf.lsp-Evaluates FORM first. If the value is already in the list stored in PLACE,
- ./reference/ecl/src/lsp/setf.lsp-does nothing. Else, conses the value onto the list and makes the result the
- ./reference/ecl/src/lsp/setf.lsp-new value of PLACE. Returns NIL. KEYWORD-FORMs and VALUE-FORMs are used to
- ./reference/ecl/src/lsp/setf.lsp-check if the value of FORM is already in PLACE as if their values are passed
- ./reference/ecl/src/lsp/setf.lsp-to MEMBER."
- ./reference/ecl/src/lsp/setf.lsp- (declare (notinline mapcar))
- ./reference/ecl/src/lsp/setf.lsp- (multiple-value-bind (vars vals stores store-form access-form)
- ./reference/ecl/src/lsp/setf.lsp- (get-setf-expansion place env)
- ./reference/ecl/src/lsp/setf.lsp- (when (trivial-setf-form place vars stores store-form access-form)
- ./reference/ecl/src/lsp/setf.lsp- (return-from pushnew `(setq ,place (adjoin ,item ,place ,@rest))))
- ./reference/ecl/src/lsp/setf.lsp- ;; The item to be pushed has to be evaluated before the destination
- ./reference/ecl/src/lsp/setf.lsp- (unless (constantp item env)
- ./reference/ecl/src/lsp/setf.lsp- (setq vals (cons item vals)
- ./reference/ecl/src/lsp/setf.lsp- item (gensym)
- ./reference/ecl/src/lsp/setf.lsp- vars (cons item vars)))
- ./reference/ecl/src/lsp/setf.lsp- `(let* ,(mapcar #'list
- ./reference/ecl/src/lsp/setf.lsp- (append vars stores)
- ./reference/ecl/src/lsp/setf.lsp- (append vals
- ./reference/ecl/src/lsp/setf.lsp- (list (list* 'adjoin item access-form rest))))
- ./reference/ecl/src/lsp/setf.lsp- (declare (:read-only ,@vars)) ; Beppe
- ./reference/ecl/src/lsp/setf.lsp- ,store-form)))
- ./reference/ecl/src/lsp/setf.lsp-root@gitlab:/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement