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

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to