Can we return a
picture from a
vardef macros? And how to call the return value? Google said "the last statement has no semicolon; its value is returned by the function". My purpose is to repeat using the path or picture. Followed is a small code. But it failed. Maybe I misunderstood something. Please note that the returned path or picture might not need to be drawn out. It might be used to help to construct something else, e.g., help to find intersection point.
vardef foo (expr from, to) = path p; p = from -- to enddef; beginfig(1) path p; pair A, B; A = (0,0); B = (1,1); p = foo (A, B); draw p; endfig;