ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
Re: Lvalue Str::words iterator
by Juerd other posts by this author
Jun 15 2005 12:46PM messages near this date
Re: Lvalue Str::words iterator | Re: Lvalue Str::words iterator
Ingo Blechschmidt skribis 2005-06-15 21:35 (+0200):
>  So maybe we should allow words() (or however we'll end up calling it) to
>  take an optional parameter specifying what's considered a wordchar,
>  with a default of rx/\w+/:

Then isn't making \w+ the default for match much easier?

(Although I still want m// to correspond to .m and s/// to .s, not m//
to .match and s/// to .subst.)

I think this is so often used that the default isn't even as insane as
it may appear at first sight.

>    say "foo bar baz".words()           .join(":");    # same as

    say "foo bar baz".match

>    say "foo bar baz".words(rx/\w+/)    .join(":");    # "foo:bar:baz"

    say "foo bar baz".match(/\w+/)

rx is optional, as bare // does rx// in Rule context, not m//.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html
Thread:
Ingo Blechschmidt
Juerd
Ingo Blechschmidt
Juerd
Larry Wall
Ingo Blechschmidt
Juerd

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved