Skip to main content
deleted 5 characters in body
Source Link
alancalvitti
  • 15.2k
  • 3
  • 27
  • 93

Following discussion w/ Jason GrisbyGrigsby at WRI, rather than edit the Q w/ additional detail, the conclusion is that composite Keys such as lists of strings, interferesinterfere with the above-mentioned named slot access:

data = <|"a" -> 1, {"b", "c"} -> 2|> // Dataset;

data[#["a"] &]

1

while

data[#"a" &]
Failure[Function, 
Association[
 "MessageTemplate" :> MessageName[Function, "slot1"], 
  "MessageParameters" -> {"a", Slot["a"]& , 
TypeSystem`SkeletonForm[
TypeSystem`Assoc[TypeSystem`AnyType, 
TypeSystem`Atom[Integer], 2]]}]]

Following discussion w/ Jason Grisby at WRI, rather than edit the Q w/ additional detail, the conclusion is that composite Keys such as lists of strings, interferes with the above-mentioned named slot access:

data = <|"a" -> 1, {"b", "c"} -> 2|> // Dataset;

data[#["a"] &]

1

while

data[#"a" &]
Failure[Function, 
Association[
 "MessageTemplate" :> MessageName[Function, "slot1"], 
  "MessageParameters" -> {"a", Slot["a"]& , 
TypeSystem`SkeletonForm[
TypeSystem`Assoc[TypeSystem`AnyType, 
TypeSystem`Atom[Integer], 2]]}]]

Following discussion w/ Jason Grigsby at WRI, rather than edit the Q w/ additional detail, the conclusion is that composite Keys such as lists of strings, interfere with above-mentioned named slot access:

data = <|"a" -> 1, {"b", "c"} -> 2|> // Dataset;

data[#["a"] &]

1

while

data[#"a" &]
Failure[Function, 
Association[
 "MessageTemplate" :> MessageName[Function, "slot1"], 
  "MessageParameters" -> {"a", Slot["a"]& , 
TypeSystem`SkeletonForm[
TypeSystem`Assoc[TypeSystem`AnyType, 
TypeSystem`Atom[Integer], 2]]}]]
Source Link
alancalvitti
  • 15.2k
  • 3
  • 27
  • 93

Following discussion w/ Jason Grisby at WRI, rather than edit the Q w/ additional detail, the conclusion is that composite Keys such as lists of strings, interferes with the above-mentioned named slot access:

data = <|"a" -> 1, {"b", "c"} -> 2|> // Dataset;

data[#["a"] &]

1

while

data[#"a" &]
Failure[Function, 
Association[
 "MessageTemplate" :> MessageName[Function, "slot1"], 
  "MessageParameters" -> {"a", Slot["a"]& , 
TypeSystem`SkeletonForm[
TypeSystem`Assoc[TypeSystem`AnyType, 
TypeSystem`Atom[Integer], 2]]}]]