in reply to Parsing with Perl 6
The only thing I regret is that matching non greediness
has not been
made the default. Larry is discussing this
in perl6-language.
His concern is that greediness is disconcerting for
beginners but he laters goes on saying that non greediness
is too. Strangely his favorite argument "Huffman Coding"
is not invoked here. Personally, I add the "?" modifier
by default and supress it when it would break my regexep...
like in the exemple given by Larry
my ($num) = /(\d*)/; # greediness needed
my ($num) = /(\d*)/; # greediness needed
So, because in my use, it is prevalent, I think that non greediness should be made the default but I have not checked other people code to see if they use non greediness more than greediness. Also I don't know if changing the default would affect the ratio of greediness/non greediness usage claimed to be 10/1 for perl 5.8 in an answer to this nodelet. Anyway, this ratio seems to show that criteria of Huffman coding would lead to a different grammar decision choice for me than to most of people. Also, I don't think that new feature introduced in perl6 regexp would change this pattern.
-- stefp -- check out TeXmacs wiki
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl6: too bad non-greediness is not made the default
by Aristotle (Chancellor) on Jul 05, 2002 at 14:37 UTC | |
by stefp (Vicar) on Jul 05, 2002 at 15:55 UTC | |
by Aristotle (Chancellor) on Jul 06, 2002 at 01:57 UTC | |
Re: Perl6: too bad non-greediness is not made the default
by Juerd (Abbot) on Jul 06, 2002 at 14:22 UTC | |
by stefp (Vicar) on Jul 06, 2002 at 15:46 UTC | |
Re: Perl6: too bad non-greediness is not made the default
by Anonymous Monk on Jul 05, 2002 at 20:00 UTC | |
by Anonymous Monk on Jul 06, 2002 at 13:07 UTC |
In Section
Meditations