Skip to content

Commit

Permalink
generalize IsIndex[]
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Apr 19, 2015
1 parent bb7db3f commit 8da3810
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions meta/Parameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@
IsIndex[i_?NumberQ] := True;
IsIndex[i_ /; MemberQ[sarahIndices,i]] := True;
IsIndex[_] := False;
IsIndex[indices_List] := And @@ (IsIndex /@ indices);
IsIndex[indices__] := IsIndex[{indices}];

GetIndices[parameter_[indices__] /; And @@ (IsIndex /@ {indices})] := {indices};
GetIndices[parameter_] := {};
Expand Down

0 comments on commit 8da3810

Please sign in to comment.