Randal L. Schwartz writes:
"Smylers" == Smylers <[EMAIL PROTECTED]> writes:
Smylers> No: no aliases. Perl does not have a tradition of these,
except "for"/"foreach". :)
I don't reckon one instance is enough to be labelled a tradition!
(Um ... actually I forgot about that one. But if I had considered it I
still wouldn't've considered it to be a tradition. Honest.)
Tradition is not the issue, especially as Perl 5 did not have macros, so
there was no "clean" way to write aliases (you had to muck with globs to
directly munge the symbol table). Still, look at the aliases provided in
the standard modules:
English.pm - this is nothing BUT aliases
File::Copy - mv, cp
File::Compare - cmp
Cwd - cwd
IO::Handle - gets
"grep" is part of Perl 6's Unix legacy, just as "." is part of its
"modern high level language" legacy or "-e" is part of its shell legacy.
These things are good ideas that stuck, and as "grep" is now a verb in
many sub-jargons, it makes sense to provide it as an alias for whatever
new-fangled term we decide is required to convince newbies to use it (by
the way, newbies don't use grep because list transforms confuse and
intimidate, not because of the name).
Should it come with a tag? Maybe (in fact, I think all of the -X tests
should, now that we've decided that we want to keep -Inf as an error).
In general, we should probably have a tree of such tags that different
modules can use as they see fit. For example:
:compat - pull in all compatibility aliases
:language<perl5> - Perl 5 compat aliases
:os - pull in all OS-specific aliases
:os<posix> - pull in all POSIX aliases
:os<windows> - pull in all Windows aliases
:language<...> - (e.g. python or c++) language aliases
Almost all modules would do nothing at all with these, and most that do
anything would stop at :compat, but a few (filesystem-related modules,
list manipulation, etc) would dip down into the lower levels.
In this way, there is uniformity of expectations. You can always use
:compat if you want a full-tilt namespace, and it should work, but if
you want P5 compat, you can just use :perl5 and get what you expect (in
terms of names, not grammar).