11,169 reputation
12153
bio website
location
age 28
visits member for 2 years, 4 months
seen Aug 29 at 19:41

Jan
21
comment Nested Sums to multiple sum
Sum[f[y] Sum[g[x], x], y] //. Sum[a_ Sum[b_, x___], y___] :> Sum[a b, x, y] Will do what you are asking, now comes the question of when you can actually do this manipulation which is not addressed.
Jan
21
revised Fitting fractional complex data with NonlinearModelfit
added 20 characters in body
Jan
21
answered Fitting fractional complex data with NonlinearModelfit
Jan
21
comment How to make MousePosition more reliable
Easily reproduced when screen magnification is anything except 100%. Windows 7, Mma 9, Intel HD 4000.
Jan
19
answered Efficient circular buffer?
Jan
18
answered How to systematically classify Mathematica expressions?
Jan
17
revised Pattern matching a pattern with patterns
added 38 characters in body
Jan
16
accepted Pattern matching a pattern with patterns
Jan
16
comment Pattern matching a pattern with patterns
I have submitted an answer based on your method which solves my problems an allows the definition of a pattern for patterns without introducing a new function to handle comparison. I feel it's bascially a small rewrite of your method (at least your input in chat), so if you would like to include it in your answer I'll delete mine.
Jan
16
answered Pattern matching a pattern with patterns
Jan
16
comment Pattern matching a pattern with patterns
The possible duplicate is not relevant to this. The question there was to for instance determine that a_Integer and b_Integer span the same space. Here I would like to for instance have a pattern that spiritually reads (a|b)_(Integer|List) So I have a pattern that I want to use on the structure of a different pattern. That being said. I do belive that you have a real solution in injecting Verbatim around pattern components rather than my attempt at removing and checking these components.
Jan
16
comment Pattern matching a pattern with patterns
@LeonidShifrin I disagree. You seemed to interpret my question correctly, only you didn't fully answer it and you had an initial error which prevented me from getting your method to work, so I posted my own. Mr. Wizard did misinterpret the question, however he seemed to have skipped the part of the question that said letting {f,x,y,g,h} take arbitrary values, and attempted to answer the question ignoring this part even after some effort on my part to clarify this for him. Having one answer that misinterprets the question is hardly makes it vague. I have attempted to clarify by restructuring.
Jan
16
revised Pattern matching a pattern with patterns
added 1021 characters in body
Jan
16
comment Pattern matching a pattern with patterns
@Mr.Wizard I'm using my "patterns for patterns" in things such as Cases, however I wouldn't call that transformations using the patterns. The question is really just about using pattern matching to match things that are themselves patterns.
Jan
16
comment Pattern matching a pattern with patterns
@Mr.Wizard in the 3'rd codebox. I write MatchQ[b, (a /. {HoldPattern -> hp_,...} /. {f -> f_,...}) /; And[hp === HoldPattern,...]] Now the "f-> f_" replaces the literal f with a pattern. The method goes, 1: break down all patterns, 2: inject new patterns; 3: Verify that all the structure of the broken down patterns is still correct.
Jan
16
comment Pattern matching a pattern with patterns
@Mr.Wizard I substitute the literals for patterns after "breaking apart" other patterns by switching out the heads Pattern, Blank and such.
Jan
16
revised Pattern matching a pattern with patterns
deleted 49 characters in body
Jan
16
comment Pattern matching a pattern with patterns
@LeonidShifrin My clearification has nothing to do with types, I just chose those, since they are the type of structure you will typically see in a Pattern. I'm editing to remove the unwanted connection.
Jan
16
comment Pattern matching a pattern with patterns
I have a problem with the serialization. It'll give the same for eg. a[b,c] and a[b@c], so your solution gives true when testing with a = HoldPattern[g[x_@y_, _, {1, 2}, q : {g_, h_}]] :> g[x] + h[y] and the same b.
Jan
16
revised Pattern matching a pattern with patterns
added 852 characters in body