From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106523 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gerben Wierda Newsgroups: gmane.comp.tex.context Subject: METAPOST vardef returning multiple and non-numeric types as a single answer? Date: Sun, 15 Mar 2020 11:22:25 +0100 Message-ID: <1AFD4799-65FF-4574-A9B5-40BA3C532955@rna.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="===============6732728356610351921==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="28976"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 15 11:23:15 2020 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 1jDQQM-0007Q4-EF for gctc-ntg-context-518@m.gmane-mx.org; Sun, 15 Mar 2020 11:23:14 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7E2461824F6; Sun, 15 Mar 2020 11:22:31 +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 aQUapiGvRIM4; Sun, 15 Mar 2020 11:22:29 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 916CA182937; Sun, 15 Mar 2020 11:22:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 318151824F6 for ; Sun, 15 Mar 2020 11:22:28 +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 dWuSnA39jc6z for ; Sun, 15 Mar 2020 11:22:27 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 399FD182359 for ; Sun, 15 Mar 2020 11:22:27 +0100 (CET) Original-Received: from hermione.rna.nl (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id EFA2735C5842 for ; Sun, 15 Mar 2020 11:22:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1584267745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=TdhGEcjWtuWc1pCMYbhdLYzYddcdXIifvenb0DXVkFY=; b=P/jpdqWXTzixhWgBkXu/bB7U4C/UD7JYCxnUV0+f8J2LjEzlFEejsL7YiJAX01rJHpWIw8 GhrtQqLD42Lqz4Zrt7t0xxLbBDkoPxLGszV66jgisKVfAUN5AKLLAoKVYAM39NFD4si1du qcEmZIcj+LWw+26qb7JDrvWt9M2maQIm1VtnTEvvXOXUmjD9NzCxfckuE64OKCs5Kg9hU5 yVPW8iegoAexs14qwmxiRSiCr0PDpzEVQ5xbvmEFUjFwAlG6e+Hsu2j5Of56fAZ4B7d+qQ RuLL0oHQksRTC2VAzcKeWQfw6PPdNypEuE8kbIKQ8dUijVHHkrxdmj/C+7ztxw== X-Mailer: Apple Mail (2.3445.104.11) 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:106523 Archived-At: --===============6732728356610351921== Content-Type: multipart/alternative; boundary="Apple-Mail=_A9A811C7-C606-4D64-8925-1AB3403FD7B8" --Apple-Mail=_A9A811C7-C606-4D64-8925-1AB3403FD7B8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I would like a vardef macro to return the pair of a picture and a = bounding box. I don't want to use the setbound operator, because as soon = as I do that, I cannot access the components of the picture anymore with = pathpart. I found metapost vardef returning multiple values = on StackExchange but that is about returning multiple = values of the same numeric type. Is it possible to have vardef return a = set of (picture, path) or (picture, picture) in some way? If not, I need = to make two vardef macros for each result type. I tried many things, amongst which: vardef Foo( expr w, h) % define pic pic end group,begingroup % define pic pic endif picture foo[]; foo =3D Foo( 2, 4); --Apple-Mail=_A9A811C7-C606-4D64-8925-1AB3403FD7B8 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

I = would like a vardef macro to return the pair of a picture and = a bounding box. I don't want to use the setbound operator, = because as soon as I do that, I cannot access the components of the = picture anymore with pathpart.

I found metapost vardef returning multiple values on = StackExchange but that is about returning multiple values of the = same numeric type. Is it possible to have vardef return a set of = (picture, path) or (picture, picture) in some way? If not, I need to = make two vardef macros for each result type.

I tried many things, amongst = which:

vardef Foo( expr w, h)
% define =
pic
pic
end group,begingroup
% define =
pic
pic
endif

picture foo[]; foo =3D Foo( 2, 4);

= --Apple-Mail=_A9A811C7-C606-4D64-8925-1AB3403FD7B8-- --===============6732728356610351921== 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== --===============6732728356610351921==--