Re: RFC 110 (v3) counting matches

[email protected] (Bart Lateur)
Newsgroups perl.perl6.language.regex
Organization MediaMind
Message-ID <[email protected]>
On Tue, 29 Aug 2000 08:56:16 -0700, Nathan Wiger wrote:

>>     $count = () = getpwnam("tchrist");
>
>Hmmm. I agree a general purpose mechanism is good, but in this case we
>already have "scalar" so why not "list"?
>
>    $count = list getpwnam("tchrist");
>
>While I agree that /l is bad, I think going through the crap of "= () ="
>is even worse.

I was just thinking the same thing, on the proposed //t option which
would count the matches, same as:

	$count = () = /PATTERN/g;


With a keyword forcing a list context, this new option is unnecessary.
You could even build sequences:

	print scalar list /PATTERN/g;


More than one way to do things is nice, but you can overdo it. You'll
get a language where even experts don't even know half of the
possibilities. Ada or PL/1, anyone?

	<http://www.csc.liv.ac.uk/~frans/2CS45/intro/pl1.html>

	PL/1

	The language was intended to be a general purpose language
	suitable for all applications [...]. PL/1 also attempted to
	combine run-time efficiency with flexibility, however, the
	result was a very complex language. Consequently the language
	never lived up to its expectations.

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