This is useful if you want to output your group elements like this:
@shirts.style@ - choose
<if @shirts.groupnum_last_p@ false>, </if>
<else>, or </if>
While doing this, I found an undocumented feature, namely the pseudocolumn 'groupnum', which will return 1 for the first row inside the group tag, then 2, 3, etc.
I also found out, however, that the 'groupnum' pseudocolumn doesn't work properly inside nested group tags. So I fixed that problem.
But it's nearly impossible to get the groupnum_last_p feature to work propely inside nested group tags, so I left that as a documented 'feature'.
It'll be committed to the 4.6 branch along with our other changes, as well as workflow and the new and improved bug-tracker/ticket-tracker.