Linked Questions

83 votes
1 answer

Incompatible Changes since Mathematica Version 7?

There is documentation of the incompatible changes made to Mathematica with each major release: Incompatible Changes since Mathematica Version 1 Unfortunately that documentation simply stopped ...
Mr.Wizard's user avatar
  • 272k
37 votes
3 answers

How to Combine Pattern Constraints and Default Values for Function Arguments?

EDIT: As several respondents have noted in the answers and comments below, the original example had a default value that would never be used because of the way patterns and default values are ...
StackExchanger's user avatar
11 votes
3 answers

Functions with both optional arguments and options [duplicate]

I have the following codes: ...
Physicist's user avatar
  • 987
9 votes
2 answers

Is it possible to use PatternTest and Optional value on one Pattern simultaneously? [duplicate]

Possible Duplicate: How to Combine Pattern Constraints and Default Values for Function Arguments First a simple example: define a function "add" with two arguments, and its second argument should ...
ywdr1987's user avatar
  • 135
10 votes
1 answer

Optional pattern behaves differently in version 8, 9, and 10+

We recently ran into an issue when testing Rubi on older versions. It boils down to this simple example which I didn't dare to simplify further as I cannot test it in versions < 10 ...
halirutan's user avatar
  • 113k
14 votes
1 answer

What changes were made to core functions during the 10.x series?

I am looking for a list of changes to how core functions work (documented or undocumented), which happened during the 10.x series, along with the version in which the change happened. Uses for this ...
Szabolcs's user avatar
  • 235k
7 votes
1 answer

Basic misunderstanding of Begin [duplicate]

In a notebook with a new kernel, execute the following in an Input cell: ...
Alan's user avatar
  • 13.7k
8 votes
2 answers

How to write a `HeldOptional` variant of `Optional` that does not evaluate its second argument?

How to specify optional arguments that take functional values made me wonder: Can we come up with a variant of Optional that allows to do the following: ...
masterxilo's user avatar
  • 5,739
2 votes
2 answers

How to split the expressions into four parts include the coefficients of Sin[x], Cos[x], and Exp[x], respectively?

Given three expressiones as ...
tanghe2014's user avatar
3 votes
2 answers

Setting nested optional argument with a default when unpacking from a given Head

I have a head that holds a single argument, and I want to unpack the value inside it while also assigning a symbol to the value itself, for example: ...
Joe Bentley's user avatar
4 votes
0 answers

`Optional` with non-empty list requires PatternTest/Condition?

Arbitrary lists are easy to use with Optional: a[0]~MatchQ~a[0, Optional[x_List, {}]] a[0]~MatchQ~a[0, Optional[x:{___}, {}]] ...
masterxilo's user avatar
  • 5,739
1 vote
0 answers

How to define function that variable is optional? [closed]

I want to define some function that I can do something for the troubleshooting purpose. ...
Saesun Kim's user avatar
  • 1,810