From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/102927 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: ! Declared variable conflicts with previous vardef [Metapost] Date: Thu, 3 Jan 2019 11:31:48 +0100 Message-ID: References: <20190102231156.34790845@zoo> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4215423818920561373==" X-Trace: blaine.gmane.org 1546511436 26293 195.159.176.226 (3 Jan 2019 10:30:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 Jan 2019 10:30:36 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 03 11:30:32 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gf0Gm-0006kT-8Y for gctc-ntg-context-518@m.gmane.org; Thu, 03 Jan 2019 11:30:32 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A98B8BB72F; Thu, 3 Jan 2019 11:32:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u4Edywr6RSev; Thu, 3 Jan 2019 11:32:20 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E87DFBC0BC; Thu, 3 Jan 2019 11:32:20 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 75CE4BC0BC for ; Thu, 3 Jan 2019 11:32:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BrRtBHmh7DnV for ; Thu, 3 Jan 2019 11:32:18 +0100 (CET) Original-Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id AA5F3BB72F for ; Thu, 3 Jan 2019 11:32:18 +0100 (CET) Original-Received: by mail-wr1-f47.google.com with SMTP id c14so33152314wrr.0 for ; Thu, 03 Jan 2019 02:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=SFAGW9zHDKViL3WHaIdK0vlqrbHlLPaXjsND3/mSDZ8=; b=fAOKgvJtMqKgrBgE/utqpHdemSWzkiclPb9+d0C6zfHXPfta/oRt5JIy7mQicckijq 91/jDTkJeMTMPWCveglHglmNOZXHKaUXdGdsiV02ykqHyL69Y86sD+WYwm7+V7IV3/5N VS4QLO8gyJ7LnEAtvlwVzhZZiKiS9q7T1t6az3JtV4Uz1vlTh8qRHA6VfguiNYwqyvsY oRxwQ2A+j8mFZQ2QITXyH2zaVM61UWdKireAyf3twV4q43j6xPOR7EEjPEcbv/69cQFN fkE/gOtIJbBWA7YuAAOCLBXRNqiEB9Bwx5NaUcAC2LIOmL0vs0YB7pn53IvosVv/a3eZ YRuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=SFAGW9zHDKViL3WHaIdK0vlqrbHlLPaXjsND3/mSDZ8=; b=iLol5Zz6Ij7Va2XS7ODnlO3EXrk842S5W1qsKjauhzV15DDwZgh6d4ppEz1UT0g5l0 2EfCysz39zZqebqd8Ny35UkpH3a6ypZf/erU7zR3djLGii9vZyCdMSjrlXeeVQrjzW77 Mv9N8bnd7CA6mtJhCovYQSETGxgVMlthzVWLDO3OCXnXC552sAM9EMK/UgbJgM8WqRvH q6g95TDMaFMPs503wPTGJ8XCIVty2AZLPnyKO6bfEXYbWP6iPEzoGsctp35RwEABlAQr tm3RgyAknwWkrCpK0Pow2rg6WFnVQE3fV9Az/M2onf8bmrBK5DLdv9fz2LUKFxhoSGCY irPA== X-Gm-Message-State: AJcUukcZEdartR7jIDSkWuW8DN1764dES4v220YsOvfLJMk0u/t9XU/x jvQbXJrmV9JoU4T1NOGHfdjjvPYFgZQjIHbODUunhuvO X-Google-Smtp-Source: ALg8bN7DBvjnFj/s6fAMfnjc1/E7ag+RmD13cVAeQraGpwgKK5AlEFWE8F2k3IqoyDxm6sucqbqlJ2e8kRdmE1YPkxg= X-Received: by 2002:a5d:6b81:: with SMTP id n1mr43903156wrx.149.1546511538013; Thu, 03 Jan 2019 02:32:18 -0800 (PST) In-Reply-To: <20190102231156.34790845@zoo> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.20 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:102927 Archived-At: --===============4215423818920561373== Content-Type: multipart/alternative; boundary="000000000000dd4d21057e8b4612" --000000000000dd4d21057e8b4612 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 :=3D poin= t 3.6 of p ;) \starttext \startMPpage[offset=3D2pt] path p, q, r, b ; pair z ; p :=3D unitsquare scaled 4cm ; * z :=3D point 3.6 of p ;* q :=3D z--urcorner p ; r :=3D z--urcorner p-- reverse bottomboundary p--cycle ; b :=3D reverse bottomboundary p ; %r :=3D 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=3D2pt] defaultfont :=3D "texgyrepagella-regular*default" ; defaultscale :=3D0.8 ; path p, q, r, b ;* pair z[];* p :=3D unitsquare xyscaled (9cm,5cm) ; z[0] =3D (2cm,0cm) ; z[1] =3D (2cm,2cm) ; z[2] =3D (0cm,2cm) ; q :=3D llcorner p--z[0]--z[1]--z[2]--cycle ; r :=3D unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ; b :=3D z[2]--z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--z[0]--llcorn= er 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 =C3=A0 07:12, Alan Braslau = a =C3=A9crit : > On Thu, 3 Jan 2019 16:22:06 +1300 (UTC) > Henri Menke wrote: > > > z is a MetaPost intrinsic, something along the lines of > > > > vardef z@#=3D(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 > > _________________________________________________________________________= __________ --000000000000dd4d21057e8b4612 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
It is true that Alan has already answered this question but I was misled b= ecause the file that I compiled without problem is this one, even leaving p= air z[ ] (I can think that it is because of this in= struction=C2=A0=C2=A0 z :=3D point 3.6 of p ;)

\starttext
\startMPpage[offset=3D2pt]
=C2=A0=C2=A0=C2=A0=C2=A0 pat= h p, q, r, b ; pair z ;
=C2=A0=C2=A0=C2=A0=C2=A0 p :=3D unitsquare scale= d 4cm ;
=C2=A0=C2=A0=C2=A0=C2=A0 z :=3D point 3.6 of p ;
=C2= =A0=C2=A0=C2=A0=C2=A0 q :=3D z--urcorner p ;
=C2=A0=C2=A0=C2=A0=C2=A0 r = :=3D z--urcorner p-- reverse bottomboundary p--cycle ;
=C2=A0=C2=A0=C2= =A0=C2=A0 b :=3D reverse bottomboundary p ;
=C2=A0=C2=A0=C2=A0=C2=A0 %r= :=3D q -- reverse bottomboundary p -- cycle ; definition of Hans
=C2=A0= =C2=A0=C2=A0=C2=A0 draw b--q withpen pencircle scaled 1mm withcolor red ;=C2=A0=C2=A0=C2=A0=C2=A0 draw p ;
=C2=A0=C2=A0=C2=A0=C2=A0 draw r numb= erstriped (.25,10,5) withcolor magenta ;
=C2=A0=C2=A0=C2=A0=C2=A0 label.= llft("B", p) ;
=C2=A0=C2=A0=C2=A0=C2=A0 label.lrt("C"= ;, p) ;
=C2=A0=C2=A0=C2=A0=C2=A0 label.ulft("A", p) ;
=C2= =A0=C2=A0=C2=A0=C2=A0 label.urt("D", p) ;
=C2=A0=C2=A0=C2=A0= =C2=A0 label.lft("M", p) ;
\stopMPpage
\startMPpage[offset= =3D2pt]
=C2=A0 defaultfont :=3D "texgyrepagella-regular*default&quo= t; ;
=C2=A0 defaultscale :=3D0.8 ;
=C2=A0 path p, q, r, b ; pair z= [];
=C2=A0 p=C2=A0 :=3D unitsquare xyscaled (9cm,5cm) ;
=C2=A0 z[= 0] =3D (2cm,0cm) ;
=C2=A0 z[1] =3D (2cm,2cm) ;
=C2=A0 z[2] =3D (0cm,2= cm) ;
=C2=A0 q :=3D llcorner p--z[0]--z[1]--z[2]--cycle ;
=C2=A0 r := =3D unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ;
=C2=A0 b :=3D z[2]-= -z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--z[0]--llcorner p--cycle ;<= br>=C2=A0 draw p ;
=C2=A0 draw b numberstriped (.25,15,5) withcolor mage= nta ;
=C2=A0 label.llft("A", p) ;
=C2=A0 label.lrt("D&= quot;, p) ;
=C2=A0 label.ulft("C", p) ;
=C2=A0 label.urt(&q= uot;B", p) ;
=C2=A0 label.lft("M", z[2]) ;
=C2=A0 labe= l.ulft("N", z[1]) ;
=C2=A0 label.bot("P", z[0]) ;=C2=A0 label.top("J", ulcorner r) ;
=C2=A0 label.rt("I&q= uot;, lrcorner r) ;
=C2=A0 label.bot(btex $x$ etex,(llcorner p+z[0])/2);=
=C2=A0 label.lft(btex $x$ etex,(llcorner p+z[2])/2);
\stopMPpage
= =C2=A0=C2=A0
\stoptext

Le=C2=A0jeu. 3 janv. 2019 =C3=A0= =C2=A007:12, Alan Braslau <b= raslau.list@comcast.net> a =C3=A9crit=C2=A0:
On Thu, 3 Jan 2019 16:22:06 +1300 (UTC)=
Henri Menke <h= enrimenke@gmail.com> wrote:

> z is a MetaPost intrinsic, something along the lines of
>
>=C2=A0 =C2=A0 =C2=A0vardef z@#=3D(x@#,y@#) enddef;
>
> so you can't use the same name for a pair.=C2=A0 Actually you can = simply
> delete the declaration
>
>=C2=A0 =C2=A0 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 t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--000000000000dd4d21057e8b4612-- --===============4215423818920561373== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============4215423818920561373==--