JuliaCollections / JuliaCollections/DataStructures.jl

define pairs for Cons

Open
#580 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
745
Forks
261
PR merge metrics
No merged PRs in 30d

Description

With this definition

Base.pairs(x::Cons) = (first(p) => last(p) for p in enumerate(x))

findall, findfirst, etc. will work with linked lists.

Or maybe even, since there seems to be no default method for pairs,

Base.pairs(x) = (first(p) => last(p) for p in enumerate(x))

(Of course, the latter would go in Julia, not a package)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the Cons implementation and the existing pairs and enumerate methods in DataStructures.jl, then check how findall and findfirst consume pairs. Confirm whether the change belongs in the package or Julia itself; done means linked-list Cons values support the intended lookup functions without breaking existing pair behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.