janitor048
Reputation
226
Next privilege 250 Rep.
 Jan28 awarded Notable Question Jul2 awarded Curious Jan16 awarded Popular Question Apr19 awarded Yearling Oct30 comment How to protect pattern or subexpression when distributing / expanding expression? Thanks, I didn't think of substituting the (1-x) term with its HoldForm variant.. Oct30 accepted How to protect pattern or subexpression when distributing / expanding expression? Oct30 comment How to protect pattern or subexpression when distributing / expanding expression? Yes, but for an already existing expression (that is somewhat more complicated than my example) - how do I tell Mathematica to hold all occurrences of (1-x)? Oct30 asked How to protect pattern or subexpression when distributing / expanding expression? Oct25 accepted How to mix Unevaluated property of function arguments with expression assignments? Oct24 comment How to mix Unevaluated property of function arguments with expression assignments? BTW: If anyone can think of a better title for this question, suggestions or edits would be highly welcome. I just don't really know how to put this problem into a concise title.. Oct24 asked How to mix Unevaluated property of function arguments with expression assignments? Oct23 comment How to distribute a generic function of two arguments (without evaluating the arguments) The Unevaluated prefix is what I was looking for. Cool. Thanks! Oct23 comment How to distribute a generic function of two arguments (without evaluating the arguments) Yep, I'm employing Mr. Wizards approach now as it allows to only temporarily hold f and later proceed with the normal f. But I will definitely keep in mind for later uses that one can permanently set a HoldAll attribute to generic functions. Thanks again. Oct23 accepted How to distribute a generic function of two arguments (without evaluating the arguments) Oct23 revised How to distribute a generic function of two arguments (without evaluating the arguments) Make title a bit more precise. Oct23 comment How to distribute a generic function of two arguments (without evaluating the arguments) Because in the next step the arguments of f need to be checked in some sort of pattern matching. More explicitly, f is the f from the answer by celtschk to this question mathematica.stackexchange.com/questions/13320/… Oct23 comment How to distribute a generic function of two arguments (without evaluating the arguments) Ok, the Hold-stuff is what I was missing. Thanks. One thing though. I need to set the HoldAll, Distribute and then clear the HoldAll for further evaluation. Is there a way to do this in one go? Or to set HoldAll temporary? Oct23 asked How to distribute a generic function of two arguments (without evaluating the arguments) Oct22 comment How to pull scalars out of a function that should act on lists? What your pattern does not handle is something like f[a vec1, b vec2 + c vec3]. Is there any way to distribute f prior to evaluating the components of the vectors? Oct22 comment How to pull scalars out of a function that should act on lists? This is indeed some magic function :-) Thanks a lot! I think to the question as asked here, the answer by celtschk is probably the best suited answer. But I am really considering whether using a data structure Vector as you propose it, would actually be beneficial for the real problem I am after. I'll do some testing..