Julia: Change `deleteat!` to `delete!`

Created on 31 Jul 2018  Â·  2Comments  Â·  Source: JuliaLang/julia

As far as I can tell, there is no overlap between the methods of deleteat! and those of delete!.
I suggest that deleteat! can simply become delete!.

Most helpful comment

Dup of https://github.com/JuliaLang/julia/pull/20531.

But it still really feels like deleteat! should just be delete!.

All 2 comments

Dup of https://github.com/JuliaLang/julia/pull/20531.

But it still really feels like deleteat! should just be delete!.

I actually feel the opposite way here...

I'd like to see a coherent (across a range of different container types) interface for containers whose keys might change. With delete! a single key is removed. With deleteat! a key is removed and a whole string of other key-values are remapped. In this sense, they are different generic functions.

I've been tempted to open an issue about insert!. Dictionaries should probably support separate operations for insert, update, and so-called "upsert" (current behavior of Dict's setindex!). If deleteat! follows a different semantic to delete! then (to me) it might follow that insert! for Vector might be better called insertat! and support an insert-only insert! function for AbstractDicts.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omus picture omus  Â·  3Comments

i-apellaniz picture i-apellaniz  Â·  3Comments

StefanKarpinski picture StefanKarpinski  Â·  3Comments

musm picture musm  Â·  3Comments

Keno picture Keno  Â·  3Comments