develooper Front page | perl.perl6.internals | Postings from January 2002

Re: Question about "match" vtable method and regexes

Thread Previous
From:
David M. Lloyd
Date:
January 12, 2002 08:23
Subject:
Re: Question about "match" vtable method and regexes
Message ID:
Pine.LNX.4.43.0201121020480.2869-100000@homebody.freemm.org
On Sat, 12 Jan 2002, Dan Sugalski wrote:

> At 09:05 PM 1/11/2002 -0600, David M. Lloyd wrote:
> >I have a design question here.  Why did we take the approach of having a
> >match method on every single vtable, instead of having a vtable for
> >regular expressions, and have regex be an object (like Perl 5)?
>
> So we could do:
>
>    @results = @foo ^=~ /bar/;
>
> Basically to allow hypermatches.

Would that become something like this:

@results = @foo.match(qr/bar/);

where the 'match' method is called on the PerlArray object, or would it
be more like:

@results = map { $_.match(qr/bar/); } @foo;  # Forgive the mixed p5/p6

where the match method is called on each element of @foo?

- D

<dmlloyd@tds.net>


Thread Previous


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