Pondering parameterized operators

2003-09-26 Thread Austin Hastings
So I sit here and think for a minute about how nice it will be in P6 to be able to define operator infix:eqi($str1, $str2) {...} for doing if ($1 eqi "last") and I think about the whole 'C' string library. Which dredges up my old questions about parameterized operators: How can I convenie

Re: Pondering parameterized operators

2003-09-26 Thread Dan Sugalski
On Fri, 26 Sep 2003, Austin Hastings wrote: > How can I conveniently pass an extra parameter to a historically binary > operator? If it's one of the 'base' binary operators (addition, subtraction, and whatnot) you don't. Dan

Re: Pondering parameterized operators

2003-09-26 Thread Luke Palmer
Austin Hastings writes: > How can I conveniently pass an extra parameter to a historically binary > operator? I see a few possibilities. The first, call it like a function: if infix:eqn("Dough", "Douglas", n => 4) {...} Or, you could use the adverbial modifier C (well, not officially yet, b

Re: Pondering parameterized operators

2003-09-26 Thread Dave Whipp
"Austin Hastings" <[EMAIL PROTECTED]> wrote > if ("Dough" eqn(4) "Douglas") ... I wonder if the . operator is available here: if "Dough" eq.n(4) "Douglas" { ... } that makes it intuitive how to define new equality "methods". One thing of concern is that we'd need whitespace rules to disambig

Re: Autovivification (was Re: E6: assume nothing)

2003-09-26 Thread Paul Hodges
--- Larry Wall <[EMAIL PROTECTED]> wrote: > On Mon, Sep 08, 2003 at 11:18:12AM +0200, Paul Johnson wrote: > : By the way, I trust this will be addressed (if it hasn't been > : already): > : > : perl5 -le 'print "gah!" if exists $a{b}{c}; print "phooey!" > : if exists $a{b}' > : > : perlfunc say