From: Taco Hoekwater <taco@elvenkind.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: METAPOST vardef returning multiple and non-numeric types as a single answer?
Date: Mon, 16 Mar 2020 09:31:27 +0100 [thread overview]
Message-ID: <9CC17BDA-18C9-431B-ABAE-0B018CDF054F@elvenkind.com> (raw)
In-Reply-To: <1AFD4799-65FF-4574-A9B5-40BA3C532955@rna.nl>
> On 15 Mar 2020, at 11:22, Gerben Wierda <gerben.wierda@rna.nl> wrote:
>
> 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.
Sure, using that same endgroup,begingroup trick. But since there is no multi-assignment in metapost that doesn’t you help much.
Either two separate vardefs or passing the to-be-assigned variable(s) as an extra argument(s) are generally more practical.
Best wishes,
Taco
___________________________________________________________________________________
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:[~2020-03-16 8:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-15 10:22 Gerben Wierda
2020-03-16 8:31 ` Taco Hoekwater [this message]
2020-03-16 8:53 ` Gerben Wierda
2020-03-16 9:10 ` Taco Hoekwater
2020-03-16 9:23 ` Taco Hoekwater
2020-03-16 9:38 ` Hans Hagen
2020-03-16 9:52 ` Gerben Wierda
2020-03-16 9:48 ` Gerben Wierda
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=9CC17BDA-18C9-431B-ABAE-0B018CDF054F@elvenkind.com \
--to=taco@elvenkind.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).