59,017 reputation
6175266
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 38
visits member for 2 years, 9 months
seen 10 hours ago

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


20h
comment Graph: PropertyValue changes and Dynamic
@CharlesP. Charles, thanks for the correction. I wasn't entirely sure. I will delete come of my incorrect comments soon. And I was sure that whatever the design was, you had good reasons for that. But does that mean that change of property value, in a Graph, constructs a new Graph, like e.g. when we add a key-value pair to an Association? B.t.w., great to see you here! I should've made some incorrect and provocative remark on Graph-s earlier, to drag you to this site :)
2d
comment Graph: PropertyValue changes and Dynamic
I totally agree. To my mind, this shows the limitations of the current model of the language, where the core is not cleanly separated from the rest, and where the rest can't be implemented using the core, but requires adding more C code for every new piece where performance is important. This certainly adds complexity to the language, and is perhaps on of its most fundamental problems, that eventually needs to be solved, for the language to successfully evolve.
2d
comment Programmatic formatting for Mathematica code - possible?
@LiamWilliam Thanks. I wanted to construct the formatter on a box level, and I wanted to avoid \[IndentingNewLines], which is one reason why I went with the design described here. I also wanted maximal flexibility to be able to override rules and add more specific formatting rules - for which my approach also seems quite fit. I'll have a closer look at your answer at some later point, thanks for the ref.
2d
comment Graph: PropertyValue changes and Dynamic
Not by far being en expert in Graph-related stuff, one thing that came to mind is that Graph is a departure from usual Mathematica strategy for objects in that it is a mutable object. And mutation via property changes is a different mechanism than via variable changes etc. I'd just think that the integration of Graphs with Dynamic (concerning their internal state) is probably not as tight as it is between Dynamic and the core language. At least, this behavior doesn't come as a surprise for me, rather I'd be surprised if it worked flawlessly.
Oct
20
comment Unprotect fails the first time, works on second pass
As a general comment, I would much rather use UpValues on customHead, than add a DownValue to Plus, which is generally a pretty error-prone operation and should be avoided when possible.
Oct
20
awarded  Enlightened
Oct
20
awarded  Nice Answer
Oct
20
awarded  Nice Answer
Oct
19
awarded  Enlightened
Oct
19
awarded  Favorite Question
Oct
19
awarded  Nice Answer
Oct
19
awarded  Good Answer
Oct
19
comment To UpSet or not to UpSet when using MakeBoxes
One observation here which I find interesting is that MakeBoxes is HoldAllComplete. This should mean that it doesn't perform any UpValue search. Yet, UpValue-based definitions do work with it. There must be something rather interesting going on there, but I never had the energy to investigate deeper.
Oct
19
awarded  Good Question
Oct
19
comment Is there a way to stop Export if the file size is too big?
The only reliable way I can suggest is to write your own exporter, which would export in chunks. In such a case, you will be able to inject such constraint into the logic of your exporter. It might be not as hard as it may sound, since in many cases you can use ExportString to export individual chunks (e.g. this is the case for CSV).
Oct
19
comment Metaprogramming in Mathematica
@Reb.Cabin In fact, I wanted to do the same, in the sense of reading Lisp books / learning that stuff, and then trying to get some of that into Mathematica. But I agree, that's a lot of work. Still, I'd really like to do that, at least in part, when I get more time on my hands. For instance, I've written some preliminary code for custom code loader in Mathematica, which would have a real read time, making real read-time macros possible. But serious work in any of those directions requires much more time than I currently have.
Oct
18
answered using memoization with conditional statement
Oct
18
comment DownValue assignment using Apply
+1. I think I will point to a similar discussion I had in my post answering this question.
Oct
17
comment Detect Messages within an expression without losing the return value?
@becko See my edit.
Oct
17
revised Detect Messages within an expression without losing the return value?
Added an alternative version to address the request in comments