Mercurial > hg > xemacs-beta
diff src/sequence.c @ 5752:70a3f4ff8da8
Improve coding style, variable names, data.c, sequence.c
src/ChangeLog addition:
2013-08-05 Aidan Kehoe <kehoea@parhasard.net>
* data.c:
* data.c (Fcar):
* data.c (Fcdr):
* data.c (Fmake_weak_box):
* data.c (Fweak_box_ref):
* data.c (init_marking_ephemerons):
* data.c (continue_marking_ephemerons):
* data.c (finish_marking_ephemerons):
* data.c (prune_ephemerons):
* data.c (zap_finalize_list):
* data.c (ephemeron_equal):
* data.c (ephemeron_hash):
* data.c (Fmake_ephemeron):
* data.c (Fephemeron_ref):
* data.c (Fephemeronp):
* sequence.c:
* sequence.c (Fcopy_tree):
* sequence.c (Freplace):
Improve coding style here; #'car and #'cdr accept lists, not just
cons cells, update their argument names to reflect that.
Follow coding conventions in the weak box and ephemeron code.
Don't needlessly abbreviate in copy-tree, use argument names from
Common Lisp in #'merge and #'replace.
Document ALIST better in #'nsublis, #'sublis.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Mon, 05 Aug 2013 17:20:16 +0100 |
parents | 37479d841681 |
children | cd4f5f1f1f4c |
line wrap: on
line diff
--- a/src/sequence.c Mon Aug 05 13:34:27 2013 +0100 +++ b/src/sequence.c Mon Aug 05 17:20:16 2013 +0100 @@ -1161,12 +1161,12 @@ Return a copy of a list and substructures. The argument is copied, and any lists contained within it are copied recursively. Circularities and shared substructures are not preserved. -Second arg VECP causes vectors to be copied, too. Strings and bit vectors -are not copied. +Second arg VECTORP causes vectors to be copied, too. Strings and bit +vectors are not copied. */ - (arg, vecp)) -{ - return safe_copy_tree (arg, vecp, 0); + (arg, vectorp)) +{ + return safe_copy_tree (arg, vectorp, 0); } Lisp_Object @@ -3723,15 +3723,15 @@ } while (0) DEFUN ("merge", Fmerge, 4, MANY, 0, /* -Destructively merge SEQUENCE-ONE and SEQUENCE-TWO, producing a new sequence. +Destructively merge SEQUENCE1 and SEQUENCE2, producing a new sequence. TYPE is the type of sequence to return. PREDICATE is a `less-than' predicate on the elements. Optional keyword argument KEY is a function used to extract an object to be -used for comparison from each element of SEQUENCE-ONE and SEQUENCE-TWO. - -arguments: (TYPE SEQUENCE-ONE SEQUENCE-TWO PREDICATE &key (KEY #'IDENTITY)) +used for comparison from each element of SEQUENCE1 and SEQUENCE2. + +arguments: (TYPE SEQUENCE1 SEQUENCE2 PREDICATE &key (KEY #'IDENTITY)) */ (int nargs, Lisp_Object *args)) { @@ -5270,16 +5270,16 @@ } DEFUN ("replace", Freplace, 2, MANY, 0, /* -Replace the elements of SEQUENCE-ONE with the elements of SEQUENCE-TWO. - -SEQUENCE-ONE is destructively modified, and returned. Its length is not +Replace the elements of SEQUENCE1 with the elements of SEQUENCE2. + +SEQUENCE1 is destructively modified, and returned. Its length is not changed. -Keywords :start1 and :end1 specify a subsequence of SEQUENCE-ONE, and -:start2 and :end2 a subsequence of SEQUENCE-TWO. See `search' for more +Keywords :start1 and :end1 specify a subsequence of SEQUENCE1, and +:start2 and :end2 a subsequence of SEQUENCE2. See `search' for more information. -arguments: (SEQUENCE-ONE SEQUENCE-TWO &key (START1 0) (END1 (length SEQUENCE-ONE)) (START2 0) (END2 (length SEQUENCE-TWO))) +arguments: (SEQUENCE1 SEQUENCE2 &key (START1 0) (END1 (length SEQUENCE1)) (START2 0) (END2 (length SEQUENCE2))) */ (int nargs, Lisp_Object *args)) { @@ -6234,6 +6234,9 @@ Perform substitutions indicated by ALIST in TREE (non-destructively). Return a copy of TREE with all matching elements replaced. +Each dotted pair in ALIST describes a map from an old value (the car) to be +replaced by a new value (the cdr). + See `member*' for the meaning of :test, :test-not and :key. arguments: (ALIST TREE &key (TEST #'eql) (KEY #'identity) TEST-NOT) @@ -6362,6 +6365,9 @@ Perform substitutions indicated by ALIST in TREE (destructively). Any matching element of TREE is changed via a call to `setcar'. +Each dotted pair in ALIST describes a map from an old value (the car) to be +replaced by a new value (the cdr). + See `member*' for the meaning of :test, :test-not and :key. arguments: (ALIST TREE &key (TEST #'eql) (KEY #'identity) TEST-NOT)