[metapost] boxit and grouping
Daniel H. Luecking
luecking at uark.edu
Thu May 26 19:33:26 CEST 2005
On Wed, 25 May 2005, Ovidiu Gheorghies wrote:
> Hi.
>
> I try to compile the code
>
> boxjoin(a.se=b.nw; a.ne=b.nw);
> boxit.aaa(btex A etex);
> boxit.bbb(btex B etex);
> aaa.nw = (30,30);
> drawboxed(aaa, bbb);
>
> begingroup
> save aaa, bbb, a, b;
> boxjoin(a.se=b.nw; a.ne=b.nw);
> boxit.aaa(btex A etex); % line 71
> boxit.bbb(btex B etex);
> aaa.nw = (50,50);
> drawboxed(aaa, bbb);
> endgroup;
Saving aaa does not make x.aaa undefined. You have to save x. The error
(after correcting the suffixes in the boxjoin commands) comes from the
code in the boxit command. Among other things, there is an equation
pic_.aaa = nullpicture;
and there may be others.
The error message even illustrates this:
> ! Redundant or inconsistent equation.
> <to be read again>
> ;
> beginbox_->...:=(EXPR1);pic_(SUFFIX2)=nullpicture;
Note the "pic_(suffix2)=nullpicture;"
Actually, it might be better if that "=" were to be a ":=" in boxes.mp,
but then one would lose error messages for accidental reuse of suffixes.
If you tried "save pic_;" this error would go away (and the next one, if
any, would be revealed). Perhaps a "boxsave" command could be defined
that collected all these, but that might adversely affect previously
defined boxes.
Dan
--
Dan Luecking
Dept. of Mathematical Sciences
University of Arkansas
Fayetteville, AR 72101
More information about the metapost
mailing list