Description
I am seeing rule section matching and evaluation performed on a left-hand-side pattern in a SetDelayed operation when the LHS contains a Condition.
This does not appear to be happening in WMA.
How to Reproduce and Output Given
In[1]:= dateQ[any___] := False (* fallthrough *)
In[2]:= dateQ[y_, m_, d_, Julian]/; 1 <= m <= 3 := 1 <= d <= {31, 28, 31}[[m]]]
SetDelayed::write: Tag False in False /; 1 ≤ m ≤ 3 is Protected.
Out[3]= $Failed
Expected behavior
No error
Additional context
I note that Condition has attribute HoldRest so dateQ[y_, m_, d_, Julian] is subject to rule replacement. But is it?
Should any expression with y_, m_ (or more generally any Pattern expression) get considered as a placeholder or a variable in substitutions?
This one bug prevents us from loading Calendar.m
Description
I am seeing rule section matching and evaluation performed on a left-hand-side pattern in a
SetDelayedoperation when the LHS contains aCondition.This does not appear to be happening in WMA.
How to Reproduce and Output Given
Expected behavior
No error
Additional context
I note that
Conditionhas attributeHoldRestsodateQ[y_, m_, d_, Julian]is subject to rule replacement. But is it?Should any expression with
y_,m_(or more generally any Pattern expression) get considered as a placeholder or a variable in substitutions?This one bug prevents us from loading Calendar.m