using Symata [2x + 1, 2 * x + 1, 2 * 3, Cos(x) * Sin(x)] # a = 1 b = 2 [a,b] [a,b,c] [ a c + d "cat" Expand((x+y)^2) ] f(x) e1 = (1,2,a+b) e2 = (1, 2, a+b) e3 = begin 1; 2; a+b end e1 == e2 == e3 f % list f % [a,b,c] x .% y f .% g(1,2) [Rule(a,b), a => b , a ⇒ b] [RuleDelayed(a,b), a .> b] [a, x^2, b^3, (a+b)^3] ./ ( x_^n_ => g([n],x)) f(x_, y__) := [x,[y]] f(1,2,3,4) [ MatchQ([a, a, b, (a + b)^3, c, c, c], [a..., b, _^3... , c...]) MatchQ([a, a, (a + b)^3, c, c, c], [a..., b, _^3... , c...]) ] ClearAll(f) f(x_...) := x f(3,3,3,3) [ MatchQ([1,2,3], [Repeated(_Integer,2)]) MatchQ([1,2,3], [Repeated(_Integer,3)]) ] MatchQ([], [RepeatedNull(_Integer)]) ClearAll(f, a, b) f(x_, y_:a, z_:b) := [x,y,z] [ f(1) == [1,a,b] f(1,2) == [1,2,b] f(1,2,3) == [1,2,3] ] ClearAll(g,a,b) b^b ./ (a::(_^_) => g(a)) countprimes = Count(_`PrimeQ`) # We use the curried form of Count countprimes(Range(100)) p = _`J( x -> -1 < x < 1 )` [ MatchQ(0, p), MatchQ(.5, p), MatchQ(-1/2, p), MatchQ(-1, p) ] ClearAll(f) f(x_, x_ | y_String) := [x, y] [ f(2,2) , f(2,"cat"), f(2, 3)] [ MatchQ( -2 , Condition(x_ , x < 0)) MatchQ( 2 , Condition(x_ , x < 0)) ] ClearAll(y) ReplaceAll([1, 2, 3, "cat"], x_Integer => Condition(y, x > 2)) ClearAll(f) f(x_) := Condition(x^2, x > 3) [f(2), f(4)] VersionInfo() InputForm(Now())