24

Bug introduced in 10.0 and fixed in 11.0.0


Related to Mapping (Query) a function at multiple locations in nested data via All, Span, it seems to me that the behavior of MapAt with Span in 10.1.0, applied to an Association, has a bug:

asc = <|"a" -> 1, "b" -> 2, "c" -> 3|>;

MapAt[f, asc, 1 ;; 2]

(* out=  <|"a" -> f[1], "b" -> f[2]|>             *)

I think it should evaluate the same as:

MapAt[f, asc, {{1}, {2}}]

(* out=  <|"a" -> f[1], "b" -> f[2], "c" -> 3|>   *)

Do others agree that the disappearance of key "c" is a bug, and which versions are affected?

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371

1 Answers1

4

This bug has been fixed in the just released Mathematica 11.0:

MapAt[f, <|"a" -> 1, "b" -> 2, "c" -> 3|>, 1 ;; 2]

(* <|"a" -> f[1], "b" -> f[2], "c" -> 3|> *)
ilian
  • 25,474
  • 4
  • 117
  • 186