ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* METAPOST vardef returning multiple and non-numeric types as a single answer?
@ 2020-03-15 10:22 Gerben Wierda
  2020-03-16  8:31 ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Gerben Wierda @ 2020-03-15 10:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 784 bytes --]

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 <https://tex.stackexchange.com/questions/448740/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 = Foo( 2, 4);


[-- Attachment #1.2: Type: text/html, Size: 11438 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-16  9:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-15 10:22 METAPOST vardef returning multiple and non-numeric types as a single answer? Gerben Wierda
2020-03-16  8:31 ` Taco Hoekwater
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

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).