JuliaCollections / JuliaCollections/DataStructures.jl
fill!(::CircularBuffer) has a surprising definition
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 745
- Forks
- 261
- PR merge metrics
- No merged PRs in 30d
Description
The definition of fill!(::CircularBuffer, val)
fill!(cb, data)
Grows the buffer up-to capacity, and fills it entirely.
It doesn't overwrite existing elements.
is at odds with the Base definition
fill!(A, x)
Fill array A with the value x. If x is an object reference, all elements
will refer to the same object. fill!(A, Foo()) will return A filled with the
result of evaluating Foo() once.
When I think of the English word "fill", the CircularBuffer definition makes more sense, but clearly it's too late to change Base, and it seems bad to have the same function with two different meanings. I propose that, by analogy with isempty/empty!, we could rename the above fill! definition to full!, to match with isfull. @femtotrader
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named in the issue. Start by locating the CircularBuffer definitions of fill! and isfull, then compare their behavior with Julia Base's fill! semantics. Done requires an agreed API direction and consistent naming or compatibility behavior, with the affected documentation and tests updated accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100