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

[email protected] (Nathan Wiger)
Newsgroups perl.perl6.language.regex
Message-ID <[email protected]>
Nathan Torkington wrote:
> 
> 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?

Easy: We'll just use lazy evaluation or some other magic. 

*snicker* :-)

Honestly, not sure. Although, there are two things I'd say about it:

   1. I don't think it's a showstopper for this RFC, since the
      feature you are addressing is actually a new piece of
      functionality.

   2. I don't think it's even closely tied to this RFC itself.

Not being able to tell an empty @array apart from no arguments is a
significant problem right now in Perl. I've always viewed it as such. It
would be really nice if we were able to tell we got a null @array
argument somehow, but I'm not sure how. Sounds like an RFC... ;-)

-Nate
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.