On Wed, 2005-11-02 at 09:03 -0500, Rob Kinyon wrote: > I think the difference comes from the Principle of Least Surprise. The > various operators being discussed in this thread are all operators > which are in languages that have common use - C, C++, Java, the .Net > stack, etc. Regexen and the various built-ins are generally considered > to be Perl-specific, so if they're weird, this is just a Perl-ism. The > PoLS doesn't apply. > > Yes, from a consistency point of view, ALL operators should default to > $_ or some other sensible item ($*STDIN for <>, etc). However, the > PoLS does need to guide our decisions.
I think the PoLS should be applied firstmost and foremost to a person who is learning the language without any preconceptions of how previous languages work. The logical building blocks of how the language works should build on each other; the fewer exceptions relative to *those foundations* the better. Specifically, catering for the preconceptions of how the language behaves as a whole to those trained in lower order languages like you mention (though is .net a language?) should probably be avoided. That being said, there are probably other more pressing reasons that ops should not accept $_ as default; I would guess, for a start, it makes determining semantics very difficult. Does ++; mean &postfix:<++> or &prefix:<++> ? Sam.