56,312 reputation
5158249
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 37
visits member for 2 years, 6 months
seen 8 mins ago

Ok, an obligatory note: opinions expressed here are mine and not those of my employer.


6h
comment What is the story with Removed symbols?
@VladimirReshetnikov Interesting. Looks like a bug to me (the second behavior). The concept, as I understand it, is to have Removed as a print form, not as a full-fledged head. So that the symbols that have been removed, are cleared from all definitions, and no longer associated with their names (although, apparently, they can still be used in certain ways, as I outlined in my answer).
1d
revised Changing Values in an Association using Map
Added a section on the role of Hold-attributes
1d
revised Changing Values in an Association using Map
Added more on immutability
1d
revised Changing Values in an Association using Map
Added more on immutability
1d
answered Changing Values in an Association using Map
1d
comment Struct equivalent in Mathematica?
@Reb.Cabin All right, then I know whom to bombard with stupid questions when I finally get my hands on it :)
2d
comment Struct equivalent in Mathematica?
@Reb.Cabin I am going to do that, in fact. Clojure stands high on my to do list. Thanks for the suggestion, anyway!
2d
comment How to make use of Associations?
@Nasser No, there isn't. In fact, your suggestion might be better, since it will preserve the order of the key.
Jul
20
comment Why is AllTrue much slower than VectorQ?
@Mr.Wizard Alas, no. There was some other discussion, where I was mentioning the speed of VectorQ[..., NumericQ] in my answer. I seem to remember that Szabolcs also posted an answer there, also mentioning this.
Jul
19
comment Why is AllTrue much slower than VectorQ?
Re: post vs delete - let's see what others think. Actually, this issue has been already discussed in another place here on SE (as a sub-topic of a wider discussion), but I can't find it now.
Jul
19
comment Why is AllTrue much slower than VectorQ?
It is clear both from the absolute timings, and the complexity, that VectorQ[..., IntegerQ] has been specially overloaded on packed arrays to be constant time. In other words, the top-level evaluator doesn't actually evaluate IntegerQ on every element in a list here. But AllTrue has no choice, being more general function, and has a linear complexity, as it should.
Jul
19
comment Normal // Association // Dataset workaround for some user query operators
@Rojo Good point.
Jul
17
comment Defining a sequence slot programmatically
@TeakeNutma AFAIK its not. LetL also supports shared local variables in definitions, as well as macro-expands at definition time, which makes it zero overhead w.r.t. manually-written nested With in function definitions (these are related). Again AFAIK, Where does not have this functionality.
Jul
17
comment How to make use of Associations?
@YiWang All right, I will add some examples. It will have to wait a little, though, perhaps a day or two.
Jul
17
awarded  Guru
Jul
16
comment Implement settable properties
@Szabolcs This is basically the same idea as what I used here (although not using VG). Didn't suggest it here precisely because of the hanging UpValues problem. +1.
Jul
15
comment Combining key pivoting and lookup operators in Dataset
But what't wrong with your last method (last line)? Why are you not satisfied by it?
Jul
15
comment Normal // Association // Dataset workaround for some user query operators
@alancalvitti My advice to you is to work out this example without Dataset, on the level of pure associations and lists, to see what's going on. This is certainly a much better way to see what's happening, than trial and error with various commands.
Jul
15
comment Normal // Association // Dataset workaround for some user query operators
@alancalvitti Of course. I meant the structure without the Delete part: data[GroupBy[Key@"key1"]]. When we apply First, it removes the list around the value, and then Delete removes they key. Just call Normal on intermediate results and play with it to see what's going on.
Jul
15
comment Normal // Association // Dataset workaround for some user query operators
@alancalvitti Basically, without First, you get a list of all results with this key, as a value for the key in a new assoc. First and Last give the same result only when the keys are unique, because then all groups will be lists with a single element.