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 be Positive and have a default value 1.
addv1[x_, (y_:1)?Positive] := x + y; addv2[x_,y?Positive:1] := x + y;
these two just don't work as expected.
So is it impossible to use
Optional value on one
Pattern simultaneously, considering the probability of its default value conflicting with its pattern test?