Re^4: Smart match in p5
by xmath (Hermit) on Mar 14, 2005 at 16:05 UTC
|
print $fh ~~EXPR;
| [reply] [d/l] |
|
|
Double ~ is already extremely rare currently, and using ~~ such that it's parsed differently with my patch applied seems only possible in contrieved situations.
Based on what analysis? Is this just your opinion based on your experience or is it actually backed up a sampling of Perl modules from CPAN?
My point here is that i think this all is an interesting and clever idea that should go through the acceptance process, but that IMO you will need better evidence than that which you and Juerd have provided so far. Anyway.... I actually agree that this will probably prove to be a very rare construct, but you should have some solid numbers to back it up. Anyway, i hope you try to get this into blead, i think it would be nice.
| [reply] |
|
|
or is it actually backed up a sampling of Perl modules from CPAN?
CPAN is not a good source of information, as ~~ (as short form of "scalar") is used mostly in one liners. That use is still valid, except with the weird print syntax. But ~~ was never meant like this anyway. ~ Just happens to be a reversible operation that works losslessly on both strings and numbers.
| [reply] |
|
|
|
|
|
|
|
CPAN is irrelevant when it comes to getting an estimate. Sure, if it breaks a gazillion CPAN modules, it'll break a lot. But the fast majority of Perl code out there isn't on CPAN, and isn't written by people keeping in touch with Perl development, or the Perl community.
The fast majority of Perl code is written by anonymous coders. Good coders, bad coders, coders who know a lot of Perl, coders who use a subset, coders who code by example. It's even unknown on which systems perl runs on - so anything estimate on how many programs it will break is just guesswork.
| [reply] |
|
|
|
|
Re^4: Smart match in p5
by Juerd (Abbot) on Mar 14, 2005 at 15:50 UTC
|
IMO a crucial issue to get this into play is to find out how many scripts it breaks. You should have a good estimate of that before proposing it.
Do I have statistics? Do you? Does anyone?
All we can reasonably test with is CPAN modules, our own scripts and perl's test suite. I know nothing in my repository would break except one throwaway script that uses Switch.pm for given/when.
| [reply] |
|
|
All we can reasonably test with is CPAN modules, our own scripts and perl's test suite.
Well then if you count how many break you have some statistics dont you?
| [reply] |
|
|
| [reply] |