JuliaCollections / JuliaCollections/DataStructures.jl

`show` does not make distinction between the type of `list`

Open
#591 0 comments 1 reaction 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

julia> cons(1, cons(2, nil()))
list(1, 2)

julia> cons(1, cons(2, nil(Int32)))
list(1, 2)

julia> typeof(cons(1, cons(2, nil())))
Cons{Any}

julia> typeof(cons(1, cons(2, nil(Int32))))
Cons{Int32}

what I'm calling out for is that Base.show for list should display the type of list, just to make a distinction in the above mentioned case.

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 locating the list implementation's Base.show entry point in DataStructures.jl and reproduce the two examples from the issue. Determine how show currently formats lists and define output that distinguishes their element types. Done means the two cases display differently while remaining valid list representations.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.