Skip to content

Commit

Permalink
setf-elt -> (setf elt)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bike committed Oct 16, 2023
1 parent 9baf8a2 commit 9699663
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/core/sequence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ CL_DEFUN T_sp cl__elt(T_sp sequence, size_t index) {
}
};


CL_LAMBDA(sequence index value);
CL_NAME("ELT");
CL_LAMBDA(value sequence index);
CL_DECLARE();
CL_DOCSTRING(R"dx(setfElt)dx");
DOCGROUP(clasp);
CL_DEFUN T_sp core__setf_elt(T_sp sequence, size_t index, T_sp value) {
CL_DEFUN_SETF T_sp core__setf_elt(T_sp value, T_sp sequence, size_t index) {
if (sequence.consp()) {
sequence.unsafe_cons()->setf_elt(index, value);
return value;
Expand Down
2 changes: 1 addition & 1 deletion src/lisp/kernel/cleavir/transform.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ Optimizations are available for any of:
#+(or)
(progn
(deftransform elt ((seq list) n) '(nth n seq))
(deftransform core:setf-elt ((seq list) n value) '(setf (nth n seq) value))
(deftransform (setf elt) (value (seq list) n) '(setf (nth n seq) value))
)

(deftransform reverse (((x list))) '(core:list-reverse x))
Expand Down
1 change: 0 additions & 1 deletion src/lisp/kernel/lsp/setf.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ by (DOCUMENTATION 'SYMBOL 'SETF)."

(defsetf bit (array &rest indices) (value) `(setf (aref ,array ,@indices) ,value))
(defsetf sbit (array &rest indices) (value) `(setf (aref ,array ,@indices) ,value))
(defsetf elt setf-elt)
(defsetf symbol-value set)
(defsetf nth (n l) (v) `(progn (rplaca (nthcdr ,n ,l) ,v) ,v))

Expand Down

0 comments on commit 9699663

Please sign in to comment.