Timeline for Is it possible to get the order of inputs when "overloading" an orderless function?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 14, 2012 at 7:02 | comment | added | Leonid Shifrin |
@jVincent Yes you are right, but this is rather subtle. The value of the $stack was cached and not re-computed as it should've been. Fixed now - I added the Update statements in appropriate places.
|
|
May 14, 2012 at 7:00 | history | edited | Leonid Shifrin | CC BY-SA 3.0 |
Fixed improper behavior by adding Update statements
|
May 13, 2012 at 22:06 | comment | added | jVincent | I seem to be having some problems implementing this, and having removed any packages and additions, it seems to not work no my 8.0.4 installation. The problem seems to reside in the down-values for matrix never being called in the function pattern. Any clues as to what might be wrong, or where I should look for potential packages. Note, it works fine for matrix["a"] c matrix["b"] or similar , just not a c b as you showed. Also seems to work fine if a=matrix[""] is replaced with a:=matrix[""]. | |
May 11, 2012 at 21:24 | comment | added | Leonid Shifrin |
@jVincent I wasn't able to break this with a few tests, but I think it should be possible, and I did not try hard enough. For one thing, all code inside Times will be executed twice, and so if it contains side effects, those would also happen twice. But I think one can probably break this even more severely. For symbolic expressions, though, it may be ok.
|
|
May 11, 2012 at 21:17 | comment | added | jVincent | Really really cool. I never looked at Stack[] before, but was hoping something like this would be possible. Now comes the follow up question, how do you break it, or really when does this go horribly wrong? | |
May 11, 2012 at 21:16 | comment | added | Leonid Shifrin | @Mr.Wizard Well, thanks, but I am not really sure that actually using this code is a good idea. It may not be robust enough. I just like this direction of thought. | |
May 11, 2012 at 21:14 | comment | added | Mr.Wizard | I tried to put something like this together and failed. Once again you prove your mastery. :-) | |
May 11, 2012 at 21:14 | vote | accept | jVincent | ||
May 11, 2012 at 19:44 | history | answered | Leonid Shifrin | CC BY-SA 3.0 |