Re: RFC 164 (v1) Replace =~, !~, m//, and s/// with match() and subst()

[email protected] (Nathan Torkington)
Newsgroups perl.perl6.language.regex
Message-ID <[email protected]>
Perl6 RFC Librarian writes:
>    match;                  # all defaults (pattern is /\w+/?)
>    match /pat/;            # match $_
>    match /pat/, $str;      # match $str
>    match /pat/, @strs;     # match any of @strs

When I was thinking about this very topic yesterday and today, I
came up with this problem:

  @strs = ();
  match /pat/, @strs;	# surprise!  I'm matching on $_

That is, how do you tell an empty array from no arguments?  I have
a horrible suspicion everyone is going to reach for lazy evaluation
and other magic.

Nat
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.