Linked Questions
18 questions linked to/from How to avoid collision between optional arguments and options
8
votes
3answers
2k views
4
votes
2answers
98 views
How to prevent an Optional parameter from taking an OptionsPattern parameter without multiple function definitions? [duplicate]
I have function the needs to enable some Optional parameters and an OptionsPattern. The issue I am facing is that the options ...
2
votes
1answer
84 views
Issue using optional argument before options [duplicate]
I have a problem using optional arguments before an OptionsPattern:
...
563
votes
19answers
142k views
Where can I find examples of good Mathematica programming practice?
I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
79
votes
4answers
5k views
Using a PatternTest versus a Condition for pattern matching
My last question to the site resulted in several answers that involve using pattern matching in Mathematica, a feature I wasn't very familiar with at the time. I am currently reading Mathematica ...
39
votes
4answers
4k views
Can a function be made to accept a variable amount of inputs?
I have a function that takes two inputs and processes them for a single output. What I need is one that can take a varying number of inputs. and process them to a single output. Is this possible in ...
29
votes
1answer
679 views
Why doesn't PatternTest work with Composition?
While playing around with the solutions to this question, I've found some very strange behaviour:
...
12
votes
4answers
354 views
Is it possible to separately call the default value of a variable which isn't at the end of the sequence?
After reading this post I recalled an old question I once met. We know that we can set default values for variables of a function:
...
8
votes
2answers
294 views
Weird behavior of conditions when using OptionsPattern and OptionValue
I'm trying to define a function that is evaluated differently depending on its
options. This code
...
9
votes
1answer
790 views
7
votes
2answers
2k views
How to translate and scale an image via ImageTransformation
Is there a way to translate and scale a 2D image simply by using ImageTransformation[] and TransformationFunction[]?
I know how ...
8
votes
1answer
261 views
Attributes with Pattern test
Probably this question has no application but it helps understand basic issues about Attributes and functions.
I was writing a piece of code where I accidently ...
12
votes
1answer
255 views
Practice notebook for Pure Functions & Rules-Patterns
Are there practice notebooks or exercises for practising using pure functions and rule-patterns?
I've completed "An Elementary Introduction to the Wolfram Language" and "Fast Introduction for ...
7
votes
1answer
245 views
How can a function know in which function it was evaluated?
Hello my second question here might be very hard.
I am asking for something "magical", if i define a function g and i call it inside a function f, how can g have information about the outer function ...
10
votes
1answer
113 views
Except @ OptionsPattern[] affects OptionValue
The background
This example works as expected, small function with a special case rule:
...