From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110299 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeong Dal Newsgroups: gmane.comp.tex.context Subject: Re: question about vardef variables Date: Sun, 17 Jan 2021 21:53:10 +0900 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: multipart/mixed; boundary="===============6866383456258103254==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31163"; mail-complaints-to="usenet@ciao.gmane.io" To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 17 13:53:33 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l17Yj-000816-0e for gctc-ntg-context-518@m.gmane-mx.org; Sun, 17 Jan 2021 13:53:33 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 86BF21C1E37; Sun, 17 Jan 2021 13:53:20 +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 EyqnDQZUkwLY; Sun, 17 Jan 2021 13:53:19 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id ABFC41C1E38; Sun, 17 Jan 2021 13:53:19 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F0B161C1E37 for ; Sun, 17 Jan 2021 13:53:18 +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 a0lAKSWzlmbu for ; Sun, 17 Jan 2021 13:53:18 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=17.58.6.39; helo=pv50p00im-ztdg10011201.me.com; envelope-from=haksan@me.com; receiver= Original-Received: from pv50p00im-ztdg10011201.me.com (pv50p00im-ztdg10011201.me.com [17.58.6.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 10A891C1DCE for ; Sun, 17 Jan 2021 13:53:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1610887995; bh=KW6AeVsW8motS320WiwuyvU/hdzKWfsrMMIW3D27lkA=; h=From:Content-Type:Mime-Version:Subject:Date:To:Message-Id; b=TW3oP75lHEKRzgk82aeV9sxTB8NzbEQRrEB6KIaD/jfgS8EGYMbU0Mh/vnpTY1rj6 JcRuoXNxRhsr2hpaJOBQGpgfyLsWUvCTvtzcDDXLiUsDOQLkf9whnMX3vV417s1WiD gY6QQbBF+WnpnQ1C8HaM9RS5lpO7v/+85lWAcxoFJTZaI4bE9xDV3piLefgY/f1grV WncSyiesM6WLiwgCGx7oDm8aJELYWTIgxMxOK7J2lqj12j2XQdwQbBOLXsNg9hGkT/ uroPqnGkTEqu1h6+Nn5hGslJd7xgpqy/o1Kt+nZq7ZrFhA6dBqwXPEEVLZFqnLC6nd bZjy2wQeddW1g== Original-Received: from [10.0.1.6] (unknown [222.232.154.22]) by pv50p00im-ztdg10011201.me.com (Postfix) with ESMTPSA id C81672A025E for ; Sun, 17 Jan 2021 12:53:14 +0000 (UTC) In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2021-01-17_06:2021-01-15, 2021-01-17 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=866 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2101170081 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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.io gmane.comp.tex.context:110299 Archived-At: --===============6866383456258103254== Content-Type: multipart/alternative; boundary="Apple-Mail=_1FB62B53-3113-47D5-8A07-DBCE506684B6" --Apple-Mail=_1FB62B53-3113-47D5-8A07-DBCE506684B6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear Damien Thiriet, If you change =E2=80=98vardef=E2=80=99 to =E2=80=98def=E2=80=99, you = will get the figure. There is a difference between =E2=80=98vardef=E2=80=99 and =E2=80=98def=E2= =80=99. AFAIK, vardef returns the value of the last statement in the macro. Please see the examples in Metafun manual from page 32 ~ . I hope that you find your answer there. I am sorry that I am not good enough to explain the variables. Best regards, Dalyoung > 2021. 1. 17. =EC=98=A4=ED=9B=84 8:00, ntg-context-request@ntg.nl = =EC=9E=91=EC=84=B1: >=20 > \starttext > \startMPpage >=20 > vardef Test (expr ab,cd)=3D > %numeric ab; > %numeric cd; > draw unitsquare scaled 10 xshifted ab; > draw unitsquare scaled 10 yshifted cd; > enddef; >=20 > Test (50,100); > \stopMPpage > \stoptext --Apple-Mail=_1FB62B53-3113-47D5-8A07-DBCE506684B6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear Damien = Thiriet,

If you change =E2=80=98vardef=E2=80=99 = to =E2=80=98def=E2=80=99, you will get the figure.
There is a difference between =E2=80=98vardef=E2=80=99 = and =E2=80=98def=E2=80=99.
AFAIK, vardef returns the = value of the last statement in the macro.
Please see  the examples in Metafun manual from page 32 = ~ .
I hope that you find your answer = there.

I am = sorry that I am not good enough to explain the = variables.

Best regards,

Dalyoung

2021. 1. 17. =EC=98=A4=ED=9B=84 8:00, ntg-context-request@ntg.nl =EC=9E=91=EC=84=B1:

\starttext
\startMPpage

vardef Test (expr ab,cd)=3D
  %numeric ab;
  %numeric cd;
  draw unitsquare scaled 10 xshifted ab;
  draw unitsquare scaled 10 yshifted cd;
enddef;

Test (50,100);
\stopMPpage
\stoptext

= --Apple-Mail=_1FB62B53-3113-47D5-8A07-DBCE506684B6-- --===============6866383456258103254== 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 X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============6866383456258103254==--