Luke Palmer wrote:
Luke Palmer:
# The first thing I noticed was the == / eq distinction. This # has been invaluable for scripting, but since Perl 6 is # desiring to be more of a formal language, I'm wondering # whether the distinction is profitable.

[...]


Brent Dax:
Your desired "standard sort of equality" is provided by smartmatch.

$a ~~ $b

Don't get too hasty here, I actually did put some thought into this.
Smart match was not what I was thinking of.

[...]


# The solution that springs to mind is to conform to other # languages' thought and make == polymorphically compare # equality. Thanks to context-forcing, the string/numeric # distinction is still there, at the expense of a little extra # verbosity:
# # +$a == +$b; # Numeric compare
# ~$a == ~$b; # String compare
# $a == $b; # Generic compare


Conciseness and precision are lost. What's gained?

Sorry, but how's precision lost here? As Luke points out, we'd free up the eq operator to do more sophisticated comparisons like (deeply) checking for identity of data structures.
Admittedly, this would be a major break with Perl5's idioms, especially since eq would work the same in some situations in Perl6 as it did in Perl5, but even ignoring that it'd be slower, it'd break in other situations where joe average-scripter used it as (s)he used Perl5's eq operator.


[...]

Steffen
--
@n=([283488072,6076],[2105905181,8583184],[1823729722,9282996],[281232,
1312416],[1823790605,791604],[2104676663,884944]);$b=6;@c=' -/\_|'=~/./g
;for(@n){for$n(@$_){map{$h=int$n/$b**$_;$n-=$b**$_*$h;[EMAIL PROTECTED]
0..11;[EMAIL PROTECTED],[EMAIL PROTECTED];[EMAIL PROTECTED]"\n"[EMAIL PROTECTED];



Reply via email to