9
$\begingroup$

Bug introduced in 10.0.2 and fixed in 10.2.0


Since 10.0.2 some code that previously worked using named slots fail in very particular circumstances.

Attchd screenshot shows the issue w/ a particular Dataset which involves multiple pre-processing steps to construct, so cannot display here.

Lookup using form #name& fails, while the more normal forms or in Key form work.

enter image description here

However, it's difficult to reproduce this issue in a minimal example. When I try to project out a few rows and columns from this table to copy-paste it as text, subsequent re-casting to Dataset works w/ all forms of Slot.

Can anyone reproduce?

$\endgroup$
  • $\begingroup$ Well, I haven't been able to reproduce this so far. I'd like to remark that you can drop the double quotes in the last slot form. $\endgroup$ – Sjoerd C. de Vries Dec 11 '14 at 22:09
  • $\begingroup$ What's the Dataset`GetType of byVisit? My debugging process for these things would be to do Normal[Query[All,#KinectSyncTime&]] to get the compiled query, then do compiledquery ** type to see what the type inference thinks (it will yield a FailureType judging by the error you saw). $\endgroup$ – Taliesin Beynon Dec 11 '14 at 23:11
7
$\begingroup$

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]]}]]
|improve this answer|||||
$\endgroup$
  • $\begingroup$ This is now fixed. Thanks for reporting! $\endgroup$ – Taliesin Beynon Jul 2 '15 at 7:38
  • $\begingroup$ @TaliesinBeynon Can you confirm, that #"boing" is officially supported as alternative to #["boing"]? I ask because I need to review some things for named slots in the IntelliJ plugin anyway and I would like to support it completely. The documentation for Slot doesn't even mention the #"name" form. $\endgroup$ – halirutan Jul 23 '15 at 1:12
  • $\begingroup$ @halirutan if you look at FullForm[#"boing"] you'll see it is exactly the same as #boing -- they parse to the same thing. For some reason #"boing" is not documented. I've reported that as a bug. $\endgroup$ – Taliesin Beynon Jul 23 '15 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.