Skip to main content
37 events
when toggle format what by license comment
Nov 4, 2015 at 20:10 history edited Jacob Akkerboom CC BY-SA 3.0
Not sure if it is a good idea to post WRI code
Nov 4, 2015 at 19:41 comment added Jacob Akkerboom @TaliesinBeynon have reported this as "Re: [CASE:3460557] Evaluation leaks in functions that end in By". Sorry for the rather long delay.
Nov 4, 2015 at 19:09 history edited Jacob Akkerboom CC BY-SA 3.0
Update for 10.3, removed IndexBy
Apr 20, 2015 at 13:40 history edited Jacob Akkerboom CC BY-SA 3.0
IndexBy
Apr 20, 2015 at 13:18 history edited Jacob Akkerboom CC BY-SA 3.0
PrintDefinitions
Apr 20, 2015 at 13:13 history edited Jacob Akkerboom CC BY-SA 3.0
Made q print in correspondence with previous output. Added behavior scope description.
Aug 25, 2014 at 11:29 vote accept Mr.Wizard
Jul 20, 2014 at 21:56 comment added Jacob Akkerboom @TaliesinBeynon you are welcome, I enjoy the interaction. About reporting, so far I have just mailed [email protected] and I have always received nice replies. I am hoping send the bug report tomorrow, I want to make sure I don't complain about undocumented behaviour. I will make sure to ask them to CC you.
Jul 20, 2014 at 19:32 comment added Taliesin Beynon @JacobAkkerboom go ahead and report the other leaks, but please ask that I be CC so I'm aware of what happens to them. And thanks for finding this, the behavior is doing multiple strange things with the evaluation semantics of GroupBy. P.S. To who do you report such things and how?
Jul 20, 2014 at 8:04 comment added Jacob Akkerboom @TaliesinBeynon thank you posting an answer and for reporting. I had not reported anything yet. If you feel I should report the other leaks (or if my answer can be improved), please let me know.
Jul 20, 2014 at 7:50 comment added Jacob Akkerboom @Mr.Wizard that is an effective workaround, but I guess the stripping of Unevaluated in this case is kind of odd.
Jul 20, 2014 at 1:33 comment added Mr.Wizard SortBy at least is documented to support any head. Consider this work-around for the leak: SortBy[Unevaluated /@ Hold[{a, 2}, {b, 2}, {c, 1}], {Last}][[All, 1]]
Jul 19, 2014 at 22:04 comment added Taliesin Beynon @Rojo thanks, I've reported the leak in GroupBy already.
Jul 19, 2014 at 20:40 history edited Jacob Akkerboom CC BY-SA 3.0
Misinterpreted CountsBy before, now fixed
Jul 19, 2014 at 19:55 comment added Rojo @JacobAkkerboom you are right, that output doesn't make sense to me either
Jul 19, 2014 at 18:47 history edited Jacob Akkerboom CC BY-SA 3.0
Mainly summary
Jul 19, 2014 at 16:39 comment added Jacob Akkerboom @Rojo I'm not sure, I don't like the output of this: GroupBy[Unevaluated@{Print@"a";2+2,4,5},Hold], which is not the same as the output without Unevaluated and which is also not the same as what we would expect if we had assumed Unevaluated would work (three groups).
Jul 19, 2014 at 16:28 comment added Rojo @JacobAkkerboom I agree. I don't really mind the messages, I take them as bonus warnings. Furthermore, it does work in the sense that it returns what it should (right?. e.g GroupBy[Unevaluated@{Print@"a"; 2 + 2}, Hold, Hold]), even though it leaks. But I hope they started taking the leaks more seriously and not evaluate stuff they don't need to. One sometimes needs to count on "sensible behaviour".
Jul 19, 2014 at 16:22 comment added Jacob Akkerboom @Rojo hmm maybe I am spoiled, I have been using (regular) DeleteDuplicates with other heads a lot. Then maybe the critique should be that it doesn't work with Unevaluated and that it applies a rule without printing a message in a case where output is not sensible.
Jul 19, 2014 at 16:21 comment added Rojo Nice analysis +1
Jul 19, 2014 at 16:19 history edited Rojo CC BY-SA 3.0
added 5 characters in body
Jul 19, 2014 at 16:13 comment added Rojo I can't find DeleteDuplicatesBy documentation for anything other than lists and associations
Jul 19, 2014 at 15:37 history edited Jacob Akkerboom CC BY-SA 3.0
Changed conclusion about converting between association and list
Jul 19, 2014 at 15:16 history edited Jacob Akkerboom CC BY-SA 3.0
Minor
Jul 19, 2014 at 15:04 history edited Jacob Akkerboom CC BY-SA 3.0
KeySortBy
Jul 19, 2014 at 14:47 history edited Jacob Akkerboom CC BY-SA 3.0
KeySortBy
Jul 19, 2014 at 14:18 history edited Jacob Akkerboom CC BY-SA 3.0
KeySortBy
Jul 19, 2014 at 14:12 comment added Mr.Wizard Hm... I think you're right, and that shouldn't leak. Strange I never noticed it before. I wonder if it's been the source for a few stray bugs I could never track down. Good thing we have you around to find these things. :-)
Jul 19, 2014 at 14:10 history edited Jacob Akkerboom CC BY-SA 3.0
Not so harsh
Jul 19, 2014 at 14:04 comment added Mr.Wizard @Jacob It's funny but I knew SplitBy wasn't as fast as I'd have liked but I don't think I was aware it was merely a proxy for Split[e, f[#1] === f[#2] &]. As I've said so often before: still so much to learn. Please, so me the SortBy side effects you're referring to.
Jul 19, 2014 at 14:03 history edited Jacob Akkerboom CC BY-SA 3.0
SortBy
Jul 19, 2014 at 13:51 comment added Jacob Akkerboom @Mr.Wizard note that for example SplitBy works in a similar way and already present in 7. GatherBy also has to deal with the problem that it has to rely on evaluation. It deals with this reasonably, as it generates a bunch of expressions which it then appears to compare in C. However, the one thing I don't like about GatherBy is that it only works on expressions with head List.
Jul 19, 2014 at 13:39 history edited Jacob Akkerboom CC BY-SA 3.0
Removed bad example, showed incorrect results
Jul 19, 2014 at 13:31 history edited Jacob Akkerboom CC BY-SA 3.0
Removed bad example, showed incorrect results
Jul 19, 2014 at 13:14 comment added Simon Woods I note that for an association argument there are four conversions!: assoc -> list -> assoc -> list -> assoc
Jul 19, 2014 at 12:39 comment added Mr.Wizard Thanks for the analysis. I didn't try Spelunk on this function because I assumed that it would be implemented in C. I'm pretty disappointed that this is how core functions are being handled in v10.
Jul 19, 2014 at 12:27 history answered Jacob Akkerboom CC BY-SA 3.0