Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-25 Thread Nathan Wiger
Nathan Torkington wrote: > > $foo->name . " says " . $bar->text . " hello to " . $baz->actor > > which isn't a win! You'll probably like RFC 103 then. It addresses this very thing. I just didn't stop to think that m// was just a fancy qq//. -Nate

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-25 Thread Nathan Torkington
Tom Christiansen writes: > I'm just a bit concerned with the general notion that functions would under > some circumstances trigger in qq guys. It's a bit odd to explain that > things like abs() for $n+3 won't work, but $o->foo() would. Then again, > it's already curious with $a[$n+3]. :-) Var

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-25 Thread Tom Christiansen
>Solve the larger problem: permit method calls in qq() strings. You mean outside of @{[ ... ]}, eh? :=}, I think Larry *might* have said something about making this work. I'm just a bit concerned with the general notion that functions would under some circumstances trigger in qq guys. It's a b

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-25 Thread Nathan Torkington
Nathan Wiger writes: > But one thing that would be cool is supporting full functions in the > left side of a pattern: > >$string =~ m/$r->getpattern/ie; > > Now that would be cool. Solve the larger problem: permit method calls in qq() strings. Nat

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-24 Thread Nathan Wiger
> > eq and ne are far more confusing. > > Hm. I've never had problems with this, although it does confuse me to go > back to the shell's [ ] (aka test) and have them be backwards. Yeah, I've got them finally sorted out, it only took me about 5 years... ;-P > >if ( $x == m/stuff/ ) { ... } >

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-24 Thread Nathan Wiger
Nathan Torkington wrote: > > Nathan Wiger writes: > >$x =~ /a/; # $x is roughly equivalent to a > > I've been going at high speed through this thread, but has > anyone mentioned: > > m{$foo}{^baz.*bar$}i > s{$foo}{(\w+) \1}{$1}g > > With the first part of m{} and s{} containing an ex

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-24 Thread Nathan Torkington
Nathan Wiger writes: >$x =~ /a/; # $x is roughly equivalent to a I've been going at high speed through this thread, but has anyone mentioned: m{$foo}{^baz.*bar$}i s{$foo}{(\w+) \1}{$1}g With the first part of m{} and s{} containing an expression. We lose !~ there, though. Thoughts o

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-24 Thread Steve Fink
Nathan Wiger wrote: > > > : =~ has no real world equivalent, and in fact I don't know how to > > : pronounce it in English so that $x =~ /a/ makes sense. > > > > Yes, that's all pretty much on the mark. > > Not true, IMO. In math, =~ is used to indicate "rough equivalence". > (Actually, the ~ go

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-24 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Mark-Jason Dominus writes: > : It may turn out that the new notation really does have exactly the > : same ambiguities, but that's not clear to me now. All I said was that > : I would like to see some discussion of it. > > Operator vs term processing wou

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Nathan Wiger
> : =~ has no real world equivalent, and in fact I don't know how to > : pronounce it in English so that $x =~ /a/ makes sense. > > Yes, that's all pretty much on the mark. Not true, IMO. In math, =~ is used to indicate "rough equivalence". (Actually, the ~ goes on top of the =, but this is a mi

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Damian Conway
> The mythical (and insistent) 'in' operator to rescue? I don't think so. "In" doesn't mean "matches". >$pattern in @expr any(@expr) =~ $pattern all(@expr) =~ $pattern >@pattern in $expr $expr =~ any(@pattern) $expr =~ all(@pattern) >@pattern in @expr any(@expr) =~

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Jarkko Hietaniemi
> Collected ideas (mostly not my own): > > EXPR /pattern/ > EXPR m/pattern/ > /pattern/ EXPR > m(EXPR)/pattern/ > /pattern/->(EXPR) > EXPR<-/pattern/ > EXPR<=/pattern/ > EXPR ~ /pattern/ > match(/pattern/, EXPR) > EXPR ? /pattern/ The mythical (and insistent) 'in' operator to rescue? $p

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Tom Christiansen
>But I agree that such examples would certainly make a better argument. >The only concrete thing I can come up with is that I and several other >perl coders I know had a lot of trouble remembering the =~ symbol. I've >been a very frequent perl user for about 8 years, and after I didn't use >perl f

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Steve Fink
Larry Wall wrote: > > The problem here is that I think =~ does one thing right--it brings the > "topic" out front. Hiding the variable to be modified clear out at the > end of a big regex is not going to be a winner. It's bad enough that > the /x modifier comes at the end. > > More generally,

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Larry Wall
Mark-Jason Dominus writes: : It may turn out that the new notation really does have exactly the : same ambiguities, but that's not clear to me now. All I said was that : I would like to see some discussion of it. Operator vs term processing would presumably treat any initial / as it does now (in

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Mark-Jason Dominus
> I'm not concerned about / being mistaken for division, since that > ambiguity already exists with bare /pat/ matches. Yes, but the current ambiguity is resolved from context in a rather complicated way. Nevertheless it turns out that Perl does the right thing in most cases. You are proposin

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Larry Wall
Steve Fink writes: : Despite all that, I don't have strong feelings about this RFC. I just : thought it would be an interesting idea to bring to Larry's eyes. Well, the fact is, I've been thinking about possible ways to get rid of =~ for some time now, so I certainly don't mind brainstorming in t

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Steve Fink
Mark-Jason Dominus wrote: > > It seems to me that there are at least two important things missing > from this proposal. > > 1. There is no substantive rationale presented for why the change >would be desirable. > > The only reasons you put forth are: > > * The syntax is ugly and unintuit

Re: RFC 138 (v1) Eliminate =~ operator.

2000-08-23 Thread Mark-Jason Dominus
It seems to me that there are at least two important things missing from this proposal. 1. There is no substantive rationale presented for why the change would be desirable. The only reasons you put forth are: * The syntax is ugly and unintuitive. Ugliness is a matter of opinion, and I d