User blog comment:Wythagoras/Dollar Function: new version/@comment-25418284-20131023195019

I think it would be easier to model the syntax using trees (hydras, if you will) and expressing these operations in terms of chopping and appending nodes.