Linked Questions

82
votes
1answer
2k views

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 ...
31
votes
2answers
2k views

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 ...
7
votes
2answers
389 views

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 ...
5
votes
3answers
735 views

Functions with both optional arguments and options [duplicate]

I have the following codes: ...
9
votes
1answer
201 views

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 ...
14
votes
1answer
131 views

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 ...
7
votes
1answer
114 views

Basic misunderstanding of Begin [duplicate]

In a notebook with a new kernel, execute the following in an Input cell: ...
7
votes
2answers
95 views

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: ...
4
votes
0answers
84 views

`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:{___}, {}]] ...
1
vote
0answers
41 views

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

I want to define some function that I can do something for the troubleshooting purpose. ...