* metafont suffix problem
@ 2007-06-26 20:35 Hans van der Meer
0 siblings, 0 replies; only message in thread
From: Hans van der Meer @ 2007-06-26 20:35 UTC (permalink / raw)
To: NTG ConTeXt
[-- Attachment #1.1: Type: text/plain, Size: 1169 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 2823 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-06-26 20:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-26 20:35 metafont suffix problem Hans van der Meer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).