My knowledge of MetaPost falls short. I hope someone will be able to help me with the following problem:

This is a macro along the line of the mode_def definition (see the MetaFont book, Appendix B).

def count_ suffix $ =
$ := incr counter_;
countnames_[$] := str$;
enddef;

called from some other macro, abbreviated:

def defineCount(expr xyz) suffix name =
begingroup
% among other statements
count_ name;
endgroup;

The problem is that I would like to modify the contents of 'name' before it is used in 'count'.
I tried several solutions as for example:
save name; string newname; newname := str name & "extension";
count_ newname;
but then newname is not accepted. The error message is:
>> unknown string newname
! Equation cannot be performed (unknown string=numeric).
and occurs
count_->(SUFFIX0):=incr.counter_;
                                    countnames_[(SUFFIX0)]:=str(SUFFI...

Directly changing name (because assignment to a suffix is possible):
name := str name & "extension";
gives a similar error.

Nor did encapsulating of 'defineCount' with an outer calling macro where the extension as added work for me. 

Hans van der Meer