503 views

Why can't I inject expressions in Compile using (only) With

Generally speaking, With can be used to inject into arbitrarily held expressions, for example: ...
2k views

Splicing a list of arguments into a function with Sequence

Not sure if this has been asked, but I have a fairly simple operation that I don't know the syntax for. Say I have an array with some values, and a function f that accepts an arbitrary number of ...
199 views

Operations on expressions within Hold

I want to convert {Hold[1 + 2], Hold[3 + 4], Hold[5*6]} into Hold[{1 + 2, 3 + 4, 5*6}]. I have tried ...
150 views

HoldFirst and Hold expression as argument

I store a reference to the association in a held expression in a variable: a=<||>; b=Hold[a]; And in the code, I want to do manipulations with the original ...
1k views

How to inject an evaluated expression into a held expression? [duplicate]

I know that there are methods to structurally manipulate held expressions (discussed e.g. here), but I failed to apply those for this particular problem: ...
4k views

Function in Table

I need a table with the elements made of pure functions and list elements. This is a simplified example: I need a list as: ...
7k views

How to completely delete the head of a function expression

Is there any way to completely remove the head of an expression function? For example, how would I remove the head Cos from ...
113 views

How to get LogPlot to accept a Sequence for its Min/Max Limits [duplicate]

If you use Plot like this, Plot[Sin[x], {x, 1, 5}] it produces the correct Sin graph ...
190 views

How can I use sequence in plotting domain?

I would like to plot a function but have a domain defined elsewhere as follows: xrange = Sequence[0, 2π]; Plot[Sin[x], {x, xrange}] However, this doesn't work ...
917 views

Generating assignments and transforming code inside held forms when generating code

I have been playing with slightly above trivial code manipulations in Mathematica. I thought Mathematica would be great for this kind of work because of rule replacement and expression manipulation, ...
325 views

Generate assignment code to symbols from string

I want the function to take in string, then assign a value to its corresponding symbol. An implementation using ToExpression is ...
180 views

Syntactic Sugar for TestReports

Seems to me that VerificationTests are a bit verbose: ...
844 views

How to properly inject iterators into table? [duplicate]

Goofing off on a prior question, I was fiddling with other methods, which led me to the need to inject a constructed set of iterators into a table construct. Now, ...