Currently we expand subquery column lists -- SELECT t.(SELECT ...) -- at the same time we format the SQL output. The ad hoc macro expansion for SIMULATE <compound expression> FROM MODELS OF p that I added last week happens before that, but for SIMULATE t.(<subquery>) FROM MODELS OF p to work, we need the macro expander to know the list of variables produced by first. So the easiest way to accomplish that will be to do things in three stages:
Expand subquery column lists.
Expand compound expression SIMULATE into SELECT of primitive expression SIMULATE.
Currently we expand subquery column lists -- first. So the easiest way to accomplish that will be to do things in three stages:
SELECT t.(SELECT ...)
-- at the same time we format the SQL output. The ad hoc macro expansion forSIMULATE <compound expression> FROM MODELS OF p
that I added last week happens before that, but forSIMULATE t.(<subquery>) FROM MODELS OF p
to work, we need the macro expander to know the list of variables produced bySIMULATE
intoSELECT
of primitive expressionSIMULATE
.