develooper Front page | perl.perl6.language.regex | Postings from August 2000

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

From:
Nathan Wiger
Date:
August 27, 2000 18:56
Subject:
Re: RFC 164 (v1) Replace =~, !~, m//, and s/// with match() and subst()
Message ID:
39A9C478.D08285DA@wiger.org
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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About