develooper Front page | perl.perl6.language | Postings from April 2001

YAYAYA string concat proposal

Thread Previous
From:
Garrett Goebel
Date:
April 25, 2001 08:41
Subject:
YAYAYA string concat proposal
Message ID:
71BEC0D4E1DED3118F7A009027B120287032A1@EXCH_MISSION
Suggestion: prepend a ~ or , to numeric comparison operators

Addresses the key concerns:
o  frees up .
o  spaces insensitive (though cmp, eq, ...do care about spaces)
o  using the , instead of ~ would be 1 keystroke on most keyboards
o  ~ and , visually intuit a string (~ more than ,)
o  avoids: $foo = "foo" + "$foo" + foo + foo()
o  easy to differentiate string and numeric ops
o  doesn't spill over into other syntax changes... (i think)

From: Stephen P. Potter [mailto:spp@belgarion.spotter.yi.org]
> 
> Garrett Goebel <garrett@scriptpro.com> whispered:
> | Perl 5          Perl 6
> | --------------- ---------------
> | ->              .
> | +               +
> | .               ~+
> | .=              ~+=
> |                 ~=+
     [and possibly consider]
> | eq              ~==  or eq
> | ne              ~!=  or ne
> | gt              ~>   or gt
> | ge              ~>=  or ge
> | lt              ~<   or lt
> | le              ~<=  or le
> | cmp             ~<=> or cmp
> |
> | You can leave aliases for eq, ne, gt... or depreciate them.
> | -But leave precedence as is...
 
> It's not bad enough that we're getting a proliferation of trigraph
> operators, now you want to add a quadgraph?  No thank you.

cmp requires typing at least 4 characters too:
  sort {$a cmp$b} qw(z y x);
  sort {${a}cmp$b} qw(z y x);

It has been suggested to me privately to leave the lettered ops eq, ne, cmp,
etc. alone since there is a history behind using lettered ops on strings and
symbol ops on numbers. That's fine. You might consider allowing either, or
possibly just dropping the trigraphs and/or quadgraphs.



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