Heh, I remember doing the reverse of this in EB. During a siege, build ram after ram until every infantry unit, archer or otherwise, has one. When the enemy sallies, use the rams to form a pocket sealed on one side by melee infantry with archers inside, like this:

_____Gates_____



____RRRRRRR____
____RAAAAR_____
____RAAAAR_____
____RAAAAR_____
____RIIIIIIIIR____

The AI wastes so much time going around that the archers will wipe out most of them before melee ever begins.