"Alternatiivsed mustrid Mathematica 5" kood
Kristjan Kannike, 2005

Alternatives[patterns__] := 
        With[{list = List[patterns]}, 
          Fold[#1 | #2  &, First[list],  Rest[list]]];

alternatives[patterns__] := 
        With[{list = List[patterns]}, 
          Fold[#1 | #2 &, First[list], Rest[list]]];

alt = alternatives[a, b, c]

Alt = Alternatives[a, b, c]

a + b + c /. alt -> 3

a + b + c /. Alt -> 3