{"id":32157636,"url":"https://github.com/emmt/unsetindex.jl","last_synced_at":"2026-02-21T01:04:09.997Z","repository":{"id":313368765,"uuid":"1051164246","full_name":"emmt/UnsetIndex.jl","owner":"emmt","description":"Unset (delete) objects at given index in arrays","archived":false,"fork":false,"pushed_at":"2025-09-13T08:03:04.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-21T12:51:44.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-05T14:40:03.000Z","updated_at":"2025-09-10T07:48:22.000Z","dependencies_parsed_at":"2025-09-05T16:42:40.388Z","dependency_job_id":"19661c49-641c-4b48-95ee-8a353d129136","html_url":"https://github.com/emmt/UnsetIndex.jl","commit_stats":null,"previous_names":["emmt/unsetindex.jl"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/emmt/UnsetIndex.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FUnsetIndex.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FUnsetIndex.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FUnsetIndex.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FUnsetIndex.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmt","download_url":"https://codeload.github.com/emmt/UnsetIndex.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FUnsetIndex.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280264177,"owners_count":26300771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-21T12:51:41.882Z","updated_at":"2025-10-21T12:51:46.975Z","avatar_url":"https://github.com/emmt.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnsetIndex\n\n[![Build Status](https://github.com/emmt/UnsetIndex.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/emmt/UnsetIndex.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Build Status](https://ci.appveyor.com/api/projects/status/github/emmt/UnsetIndex.jl?svg=true)](https://ci.appveyor.com/project/emmt/UnsetIndex-jl) [![Coverage](https://codecov.io/gh/emmt/UnsetIndex.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/emmt/UnsetIndex.jl)\n[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)\n\n**UnsetIndex** is a [Julia](https://www.julialang.org) package to effectively delete objects\nstored in arrays and without changing anything else in the array unlike `deleteat!(A,i)` or\n`popat!(A,i)` which reduce the size of `A` and may shift its elements.\n\n## Usage\n\n**UnsetIndex** exports two symbols, the `unsetindex!` function and the `unset` constant,\nwhose usage is as follows:\n\n``` julia\nusing UnsetIndex\nunsetindex!(A, i)\nA[i] = unset\nsetindex!(A, unset, i)\n```\n\nThe former 3 statements are equivalent and delete the entry at index `i` of array `A` if it\nhas a non-bit type; otherwise, the entry is left unchanged. In any case, bound checking is\nperformed unless `@inbounds` is active. The only restriction is that `A` must be of type\n`Array` or `Memory`.\n\nFor example:\n\n``` julia\njulia\u003e A = [\"hello\", \"world!\"]\n2-element Vector{String}:\n \"hello\"\n \"world!\"\n\njulia\u003e A[end] = unset\n#undef\n\njulia\u003e A\n2-element Vector{String}:\n    \"hello\"\n #undef\n\njulia\u003e map(i -\u003e isassigned(A, i), eachindex(A))\n2-element Vector{Bool}:\n 1\n 0\n\n```\n\nIt is also possible to unset entries using dot notation. For example:\n\n``` julia\n@. A = unset       # unset all entries of A\nA[:] .= unset      # unset all entries of A\nA[3:2:15] .= unset # unset every other entry of A between the 3rd and the 15th\n```\n\n## Discussion and alternatives\n\nMeans to unset array elements have always existed in Julia (at least since version 0.7) but\nwere not exposed for usage in other packages. The non-exported `Base._unsetindex!` function\nappeared in Julia 1.3 but, as of Julia 1.12, this function is neither documented nor\n`public`. Prior to Julia 1.3, the C function `jl_arrayunset` have to be called with `ccall`.\nThe `unsetindex!` function of **UnsetIndex** is a public and documented equivalent to\n`Base._unsetindex!` for any Julia version (since 1.0). The `unset` constant of\n**UnsetIndex** implements a portable, simple, and intuitive syntax.\n\nThe `@undef!` macro provided by the [`Undefs`](https://github.com/mkitti/Undefs.jl) package\ndeals with the same issue but differently: `@undef! A[i]` to unset `i`-th element but `i`\nmust be a scalar index and `A` must be an `Array` (not a `Memory`).\n\nSee this [discussion in Julia\nDiscourse](https://discourse.julialang.org/t/undefs-jl-convenience-and-experiment).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Funsetindex.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmt%2Funsetindex.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Funsetindex.jl/lists"}