1.24 pattern example 19

replaces a whole expression by default. In Maple, this is easier to do it without pattern, like this

restart; 
expr:=f(1, 2, z); 
e:=map(X->`if`(X::integer,"int",X),[op(expr)]); 
f(op(e)) 
 
    f("int", "int", z)
 

In Mathematica, a pattern works easier

Replace[f[1, 2, z], _Integer :> "int", {1}] 
 
   f["int", "int", z]
 

The main issue is that it is hard to match a sequence in Maple. For example, in Mathematica this works

f[1, 2, z] /. f[x___] :> x 
 
        Sequence[1, 2, z]
 

But in Maple

expr:=f(1, 2, z); 
patmatch(expr, f(x::anything)) 
 
      false
 

So pattern matching does work to match sequence of arguments.