Front page | perl.perl6.language |
Postings from August 2006
Re: === and array-refs
Thread Previous
|
Thread Next
From:
Dr.Ruud
Date:
August 16, 2006 07:32
Subject:
Re: === and array-refs
Message ID:
20060816143250.28984.qmail@lists.develooper.com
"Markus Laire" schreef:
> Dr.Ruud:
>> Markus Laire:
>>> my $x = 'Just Another';
>>> my $y := $x;
>>> $y = 'Perl Hacker';
>>>
>>> After this, both $x and $y contain the string "Perl Hacker", since
>>> they are really just two different names for the same variable.
>>> </quote>
>>
>> So "$x === Sy" stil[l] holds.
>
> Exactly, and because of that $a === $b does NOT hold in my example.
> ($a would be "Two", $b would be "One")
Yes, sorry for my over-compact reply. Where Darren wrote:
The difference between === and eqv is that, if you have 2 symbols, $a
and $b, and $a === $b returns true, then that result is guaranteed to
be eternal if you don't assign to either symbol afterwards.
I think he meant something like "to either symbol (or alias)".
But read S03 for an exacter description.
I also wondered why a "simple" array (for example containing only value
type objects) whould not C<===> its copy.
But with .SKID that must be easy to handle.
Comparing strings in Perl5, using NFKD:
perl5 -MUnicode::Normalize -we '
($\, $,) = ("\n", "\t") ;
$x = qq{Henry IV} ;
$y = qq{Henry \x{2163}} ;
print qq{<$x>}, qq{<$y>}, length $x, length $y, $x eq $y ? 1 : 0 ;
# $x = NFKD $x ;
$y = NFKD $y ;
print qq{<$x>}, qq{<$y>}, length $x, length $y, $x eq $y ? 1 : 0 ;
'
Wide character in print at -e line 5.
<Henry IV> <Henry â.£> 8 7 0
<Henry IV> <Henry IV> 8 8 1
How will the Str type do this?
--
Affijn, Ruud
"Gewoon is een tijger."
Thread Previous
|
Thread Next
-
===, =:=, ~~, eq and == revisited (blame ajs!)
by Yuval Kogman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Yuval Kogman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by David Green
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Larry Wall
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Smylers
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Charles Bailey
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Jonathan Lang
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Darren Duncan
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Aaron Sherman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Yuval Kogman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Yuval Kogman