On Mon, Jun 21, 2010 at 10:47, Smylers <smyl...@stripey.com> wrote: > Larry Wall writes: > > > On Fri, Jun 18, 2010 at 11:21:52AM +0200, Jan Ingvoldstad wrote: > > > > : On Fri, Jun 18, 2010 at 11:15, Smylers <smyl...@stripey.com> wrote: > > : > > : > For the benefit of Perl 5 programmers used to string reverse it > > : > would be nice to have a warning if reverse is invoked with exactly > > : > one string argument (but not with an array which happens to > > : > contain a string as its only element). > > : > > : Perhaps if one uses a "use P5warnings" or something? > > : > > : Such warnings can become quite awful as Perl 6 grows and matures. > > I was only thinking about that specific warning, not generally warnings > that might be of use to Perl 5 programmers. And I don't see how warning > about calling reverse on a scalar would be awful. > > It isn't something that makes sense to do (it's a no-op), and it isn't > just former Perl 5 programmers who might make that mistake; anybody who > does could be warned about it. >
And that's my beef, really: adding warnings that are useful because of the language itself is quite unproblematic, but adding warnings for the sake of those who move from other languages -- even within the same family -- /can/ become awful. They don't necessarily have to be, but I would advise utmost caution. Also, it's important that there is consistency and consecution in warnings. As pmichaud++ mentions in a followup response, there are several other cases where warnings are not issued. A rational consequence of adding a warning for .reverse used on string, is to add a warning for other cases where it does not make sense (but which may come as a surprise), and equally for the other cases (see pmichaud's list) where built-in methods may be invoked by a similar misunderstanding. Anyway, these are merely my personal opinions, I like to express them from time to time, but I don't call the shots any more than you do! -- A sextuple-acrostic post by Jan ;)