[metapost] boxit and grouping

Ovidiu Gheorghies ogh at info.uaic.ro
Thu May 26 16:55:13 CEST 2005


Ok, I updated the equations, but the problem persits.

  boxjoin(a.se=b.ne; a.sw=b.nw);
  boxit.testA(btex A etex);
  boxit.testB(btex B etex);
  testA.nw = (30,30);
  drawboxed(testA, testB);

    begingroup;
      save testA, testB, a, b;
      boxjoin(a.se=b.ne; a.sw=b.nw);
      boxit.testA(btex A etex); %line "71"
      boxit.testB(btex B etex);
      testA.nw = (30,30);
      drawboxed(testA, testB);
    endgroup;

The purpose of the ``save'' instruction is  to allow for the redefinition 
of variabiles (suffixes included), isn't it? Below it's a similar example 
made by me, which works:

vardef foo@#=
  numeric @#bar;
enddef;

  foo.test;
  test.bar = 3;
  begingroup;
        % this is different from the first foo
    foo.test;
    test.bar = 4; % this works
  endgroup;

More elaborate examples which make use of generic_declare, as
in boxes.mp, also work.


On Thu, 26 May 2005, L. Nobre G. wrote:

> On 5/25/05, Ovidiu Gheorghies <ogh at info.uaic.ro> wrote:
> > Hi.
> > 
> > I try to compile the code
> > 
> >   boxjoin(a.se=b.nw; a.ne=b.nw);
> 
> b.nw can't be a.se and a.ne at the same time.
> Probably you wanted to write
> 
> boxjoin(a.se=b.sw,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;
> 
> Can one save sufixes (aaa and bbb)?
> 
> Greetings
> -- 
> L. Nobre G. - http://matagalatlante.org
> 
> "La idea de escalar en solo integral esta pared de quinientos metros es 
> sobrecogedora; internarse en una ruta desconocida sin aseguramiento es
> imposible,
> no se puede prever nada; es una irresponsabilidad. Si se parte un unico agarre 
> o apoyo es suficiente... 
> Todo el mundo lo dice: no debe correrse un riesgo de este calibre... 
> Pero precisamente lo inimaginable posee el increible estimulo de explorar 
> los limites psicologicos e incrementarlos mediante el ejercicio de la voluntad".
>                                                                       
>                           Much Mayr
> 
> _______________________________________________
> metapost mailing list
> http://tug.org/mailman/listinfo/metapost
> 



More information about the metapost mailing list