I tend to agree that 'pad' implies adding zero or more elements but does
not remove any.  In fact Gauche has implemented so, but a user pointed out
".. so that the length of the result is _length_" text, then I found that
the string-pad does truncate.

If both of the authors like to make it an error when _length_ is shorter
than the bitvector, it's ok as well, though inconsistencies between SRFIs
may confuse newcomers.  The SRFI text should be clarified either way,
though.

BTW, the current reference implementation returns _bvec_ as is when
_length_ is the same as the length of _bvec_, but it contradicts the SRFI
text "Returns a copy of _bvec_ ...".  As bitvectors are mutable, this makes
a difference.


On Mon, Aug 28, 2023 at 9:11 AM Wolfgang Corcoran-Mathe <[email protected]>
wrote:

> Sorry. I realize that Shiro already posed the same question.
>
> While string-pad is precedent, I wonder if "pad" is the right name
> for a procedure that may truncate a bitvector. "Padding" suggests
> to me that the result will always be at least as long as the input.
> Unless the name is changed, I lean toward returning the input vector
> or making it an error if *length* is less than input length.
>
> --
> Wolfgang Corcoran-Mathe  <[email protected]>
>

Reply via email to