Re: copying and s/// (was Re: Overlapping RFCs 135 138 164)

2000-08-30 Thread Tom Christiansen

Uri Guttman wrote:
 
   TC ($this = $that) =~ s/foo/bar/;
   TC for (@these = @those) { s/foo/bar/ }
 
   TC You can't really do those in one step without it.

RFC 164 v2 has a new syntax that lets you do the above or, if you want:

   $this = s/foo/bar/, $that;
   @these = s/foo/bar/, @those;

Those really aren't any more obvious to the reader than what we
already have.  Less so, in fact, since you can understand what the
current ones are doing based on simple operators and precedences.

--tom



Overlapping RFCs 135 138 164

2000-08-29 Thread Mark-Jason Dominus


RFC135: Require explicit m on matches, even with ?? and // as delimiters.

C?...? and C/.../ are what makes Perl hard to tokenize.
Requiring them to be written Cm?...? and Cm/.../ would
solve this.

(Nathan Torkington)

RFC138: Eliminate =~ operator.

Replace EXPR =~ m/.../ with m/.../ EXPR, and similarly for
s/// and tr///. Force an explicit dereference when using
qr/.../. Disallow the implicit treatment of a string as a
regular expression to match against.

(Steve Fink)

RFC164: Replace =~, !~, m//, and s/// with match() and subst()

Several people (including Larry) have expressed a desire to
get rid of C=~ and C!~. This RFC proposes a way to replace
Cm// and Cs/// with two new builtins, Cmatch() and
Csubst().

(Nathan Widger)


I would like to see these three RFCs merged into one if this is
appropriate.  I am calling on the three authors to discuss in private
email how this may be done.  I hope that the discussion will result in
the withdrawal at least two of the three RFCs, and that this private
discussion produces a new RFC.  The new RFC should discuss the points
raised by all three existing RFCs, should investigate several
solutions in parallel, and should compare them with one another and
contrast the benefits and drawbacks of each one.





Mark-Jason Dominus   [EMAIL PROTECTED]
I am boycotting Amazon. See http://www.plover.com/~mjd/amazon.html for details.




Re: Overlapping RFCs 135 138 164

2000-08-29 Thread Nathan Wiger

Mark-Jason Dominus wrote:
 
 RFC135: Require explicit m on matches, even with ?? and // as delimiters.

This one is along a different line from these two:

 RFC138: Eliminate =~ operator.
 
 RFC164: Replace =~, !~, m//, and s/// with match() and subst()

Which I could see unifying. I'd ask people to wait until v2 of RFC 164
comes up. It may well include everything from RFC 138 already.

-Nate



Re: Overlapping RFCs 135 138 164

2000-08-29 Thread Tom Christiansen

($foo = $bar) =~ s/x/y/; will never make much sense to me. 

What about these, which are much the same thing in that they all
use the lvaluability of assignment:

chomp($line = STDIN);
($foo = $bar) += 10;
($foo += 3) *= 2;
func($diddle_me = $protect_me);
$n = select($rout=$rin, $wout=$win, $eout=$ein, 2.5);

--tom



Re: Overlapping RFCs 135 138 164

2000-08-29 Thread Tom Christiansen

What about these, which are much the same thing in that they all
use the lvaluability of assignment:

And don't forget:

for (@new = @old) { s/foo/bar/ } 

--tom