Reputation
64,708
Next tag badge:
207/100 score
19/20 answers
Badges
6 194 284
Newest
 Guru
Impact
~405k people reached

Feb
18
comment Context of localised (dynamic) symbols
One reason might be that, given the Module approach to lexical scoping (symbol generation), and that these symbols may, under certain conditions, leak (persist after the execution leaves Module), it may be a good idea for them to at least leak into whatever context was there when they were constructed. If we think about it, once we state that Module implements lexical scoping by symbol generation, the currently existing scheme is the simplest possible.
Feb
18
comment How to search Dataset to find all keys share same Value
@WReach Precisely the reason I discarded it too - in exactly the same form. But, also, +1.
Feb
17
comment How to search Dataset to find all keys share same Value
@Mr.Wizard Anyway, FWIW, your suggestion with PositionIndex is perhaps the most idiomatic for Mathematica (IMO). I already voted for it, but after this discussion I started to appreciate it more.
Feb
17
comment How to search Dataset to find all keys share same Value
@Mr.Wizard Sorry, I apparently wasn't paying enough attention. Perhaps, my general hesitation to embrace position-based solutions is that I prefer to think about this problem in terms of data and relations, rather than the structure of expressions used to represent this data in Mathematica. Admittedly, such approach often isn't the right one for Mathematica code (particularly if we need it to be fast), but I decided that I can afford this luxury in this case :)
Feb
17
comment How to search Dataset to find all keys share same Value
@Mr.Wizard Yes, it is slower for any particular single value, but if you need to query this for several (many) different values, then I think it should be faster, since it only does it once. But, as you said, the main value is conceptual. We may in the future get some efficient version of invertManyToMany, which could even be lazy (do only as much as needed to service a particular query). The main point is - my solution stresses the conceptual problem we need to solve, and separates the high-level query from the lower-level implementation details - at least, this is what I like about it.
Feb
16
answered How to search Dataset to find all keys share same Value
Feb
13
comment Most efficient way of splitting a file into length-prefixed blocks
+1. It is interesting that this is so efficient - I did not expect this (don't have the time to test right now, but the 1.65 coefficient isn't bad at all). I guess this would also depend on the average chunk size, and for really small chunks (like 5-10 bytes), the difference will me more, while for larger chunks, it will be less.
Feb
12
comment Why does an inert ReplaceAll modify this Dataset?
@StefanR Thanks, I wasn't aware of that. But that doesn't change the fact that in principle, typesetting for Assoc and Struct is likely to be different. The other question is whether to consider type inferencing not powerful enough to produce the same result as type deduction, as a bug. Personally, I would not, but I didn't discuss that with Tali yet.
Feb
12
answered Why does an inert ReplaceAll modify this Dataset?
Feb
10
comment Most efficient way of splitting a file into length-prefixed blocks
@Mr.Wizard Thanks :) But I am sure you would do it at least just as well, and besides, it uses your code as an ingredient.
Feb
10
comment Most efficient way of splitting a file into length-prefixed blocks
@R.Kazeno Good to know. Was glad to help. Thanks for the accept.
Feb
10
revised Most efficient way of splitting a file into length-prefixed blocks
added 366 characters in body
Feb
10
answered Most efficient way of splitting a file into length-prefixed blocks
Feb
10
comment Most efficient way of splitting a file into length-prefixed blocks
@Mr.Wizard You don't need separators - the lengths instruct you when one block ends and the next starts.
Feb
9
answered What is the fastest way to get notebook CellGroups / Cells structure?
Feb
8
answered Can I view a package as a regular notebook?
Feb
8
revised Messages leak out from Block
edited tags
Feb
8
comment Messages leak out from Block
@Mr.Wizard I think so. I just did.
Feb
7
comment Copy Built-in function to new name
Re: links - yes, sure, that's why I said that your code and use case is different. I only meant that it would help link together similar approaches, not in any other sense. Re: core functions - yes, but I thought you take care of internal definitions via Internal`InheritedBlock, while for top-level ones, I thought it should work.
Feb
7
comment Copy Built-in function to new name
Re: links - you are right, I haven't checked those. Although, given your answer, it would perhaps make more sense to mention them directly in it, but that's of course up to you. Besides, your construct is still different and used in a different context. Re: clone - there is actually a better way, exposed by Szabolcs here.