Hacker News new | past | comments | ask | show | jobs | submit login
Perl 6 new regexp rules (wikipedia.org)
29 points by soundsop on June 8, 2009 | hide | past | favorite | 4 comments



So apparently Perl 6's regexes are not so much traditional regexes as a compact and efficient syntax for creating parsers and defining grammars... that sounds incredibly useful. I assume other more traditional Perlisms like implicit variable names are coming along for the ride too, though - if they weren't, I'd definitely be more interested in Perl 6.


I'm not sure what you mean by "implicit variable names". If it's that you don't need to declare variables before you use them, use can use 'use strict' to avoid that. If you're referring to how things like cmp takes a block with $a and $b variables, it saves you having to extract values from arguments for this block which should be really short.


How to make a RPN calculator using the regexp rules:

http://daniel.carrera.bz/2009/06/rpn-calculator-in-perl-6/


The WP article title is "Perl 6 rules". It's just as well Larry Wall decided to call the new feature "rules" rather than, say, "sucks"...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: