It'd be better to have separate functions for "reverse string" and "reverse list".
FWIW this is exactly what Perl 6 has: reverse for lists and flip for strings. (And invert for hashes, which returns a list of value => key pairs).
In reply to Re^4: Why does reverse in list context operate on () instead of @_ or @ARGV (warning)
by moritz
in thread Why does reverse in list context operate on () instead of @_ or @ARGV
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |