From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: ! Declared variable conflicts with previous vardef [Metapost]
Date: Thu, 3 Jan 2019 11:31:48 +0100 [thread overview]
Message-ID: <CACyK-erwPpW2GEa+NQXT8VLc4UFA3EPG+DJ6AmzuqpJadH-ENQ@mail.gmail.com> (raw)
In-Reply-To: <20190102231156.34790845@zoo>
[-- Attachment #1.1: Type: text/plain, Size: 2734 bytes --]
Hi,
It is true that Alan has already answered this question but I was misled
because the file that I compiled without problem is this one, even leaving
pair z[ ] (I can think that it is because of this instruction z := point
3.6 of p ;)
\starttext
\startMPpage[offset=2pt]
path p, q, r, b ; pair z ;
p := unitsquare scaled 4cm ;
* z := point 3.6 of p ;*
q := z--urcorner p ;
r := z--urcorner p-- reverse bottomboundary p--cycle ;
b := reverse bottomboundary p ;
%r := q -- reverse bottomboundary p -- cycle ; definition of Hans
draw b--q withpen pencircle scaled 1mm withcolor red ;
draw p ;
draw r numberstriped (.25,10,5) withcolor magenta ;
label.llft("B", p) ;
label.lrt("C", p) ;
label.ulft("A", p) ;
label.urt("D", p) ;
label.lft("M", p) ;
\stopMPpage
\startMPpage[offset=2pt]
defaultfont := "texgyrepagella-regular*default" ;
defaultscale :=0.8 ;
path p, q, r, b ;* pair z[];*
p := unitsquare xyscaled (9cm,5cm) ;
z[0] = (2cm,0cm) ;
z[1] = (2cm,2cm) ;
z[2] = (0cm,2cm) ;
q := llcorner p--z[0]--z[1]--z[2]--cycle ;
r := unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ;
b := z[2]--z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--z[0]--llcorner
p--cycle ;
draw p ;
draw b numberstriped (.25,15,5) withcolor magenta ;
label.llft("A", p) ;
label.lrt("D", p) ;
label.ulft("C", p) ;
label.urt("B", p) ;
label.lft("M", z[2]) ;
label.ulft("N", z[1]) ;
label.bot("P", z[0]) ;
label.top("J", ulcorner r) ;
label.rt("I", lrcorner r) ;
label.bot(btex $x$ etex,(llcorner p+z[0])/2);
label.lft(btex $x$ etex,(llcorner p+z[2])/2);
\stopMPpage
\stoptext
Le jeu. 3 janv. 2019 à 07:12, Alan Braslau <braslau.list@comcast.net> a
écrit :
> On Thu, 3 Jan 2019 16:22:06 +1300 (UTC)
> Henri Menke <henrimenke@gmail.com> wrote:
>
> > z is a MetaPost intrinsic, something along the lines of
> >
> > vardef z@#=(x@#,y@#) enddef;
> >
> > so you can't use the same name for a pair. Actually you can simply
> > delete the declaration
> >
> > pair z[];
>
> I had already told Fabrice this a couple of days ago...
>
> Alan
>
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 4495 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2019-01-03 10:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 1:43 Fabrice Couvreur
2019-01-03 3:22 ` Henri Menke
2019-01-03 6:11 ` Alan Braslau
2019-01-03 10:31 ` Fabrice Couvreur [this message]
2019-01-03 11:03 ` Taco Hoekwater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACyK-erwPpW2GEa+NQXT8VLc4UFA3EPG+DJ6AmzuqpJadH-ENQ@mail.gmail.com \
--to=fabrice1.couvreur@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).