Nice. You've managed to be fundamentally a lot terser than my version, probably by not generalizing so much. Yours can still be golfed down a good bit by using the usual dirty tricks, of course (like, using the trinary ?: operator instead of regular if/elsif/else blocks), but it's already about half as long as mine and probably more portable to boot :-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |