Steel Bank Common Lisp

docstring for CL:REPLACE - reference to target/source sequences not congruent with lambda list parameters

Reported by mon_key on 2012-03-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

Verified current through commit 137b4d0 on Head

cl:replace has the following lambda-list:

(sequence1 sequence2 &rest args
           &key (start1 0) (end1 nil) (start2 0) (end2 nil))

(documentation 'cl:replace 'function)
=> "The target sequence is destructively modified by copying successive
elements into it from the source sequence."

The docstring of cl:replace should reflect the function's parameters.

It is not clear what is being referenced by "target sequence" and
"source sequence". Something like the following would suffice to clarify:

"Destructively modify SEQUENCE-1 by copying successive elements
into it from SEQUENCE-2."

FTR following is from the "Description" from the spec for cl:replace:

"SEQUENCE-1 is destructively modified by copying successive elements
into it from SEQUENCE-2.

Destructively modifies SEQUENCE-1 by replacing the elements of
SUBSEQUENCE-1 bounded by START1 and END1 with the elements of
SUBSEQUENCE-2 bounded by START2 and END2.
..."

Including the second paragraph from above with the docstring of cl:replace might also be nice :)

(lisp-implementation-version)
=> "1.0.55.4-eee9d17"

mon_key (mon-key) wrote :

The above proposed modification to the docstring is wrong.
I'd assumed that the sequence parameter names were congruent with the spec and contained a #\- but they do not.

Following reflects SBCL's parameter names:

"Destructively modify SEQUENCE1 by copying successive elements into it from SEQUENCE2."

Nikodemus Siivola (nikodemus) wrote :

Committing fix after freeze.

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: New → In Progress
importance: Undecided → Low
Nikodemus Siivola (nikodemus) wrote :

commit 768798e7839d849017164154d0ab70ce975fe5e3
Author: Nikodemus Siivola <email address hidden>
Date: Wed Mar 28 10:00:00 2012 +0300

    better REPLACE docstring

      lp#965592

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
Stas Boukarev (stassats) on 2012-05-21
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers