develooper Front page | perl.perl6.language | Postings from July 2002

Re: what's new continued

Thread Previous | Thread Next
From:
raptor
Date:
July 4, 2002 06:51
Subject:
Re: what's new continued
Message ID:
20020704165037.756c389f.raptor@unacs.bg




|Comments (otherwise you have things pretty much right):
]- that is good :")
|
|> Every subrotine or variable or method or object can have a "notes" (out of bound data)
|out-of-band data
]- yep

|> we can even have hyper-assignment :
|> 
|> my ($a, $b) ^= new Foo;
|
|This is unlikely to do what you wanted. It creates a new Foo object and then
|assigns a reference to that one object to both $a and $b. It doesn't create two
|Foo objects. (But maybe one object referenced twice is what you wanted).

]- i've got it from here :
<snip apo4>
For historical reasons, the assignment in

     my ($a, $b) = new Foo;

will not distribute automatically over $a and $b. If you want that, use the ^= hyperassignment instead, maybe.
</snip>

But probably i havent understood it !

|
|> Let's someone of the anti-perl camp tell me that this "upper-cap noise" makes the code hard to read and I will smash him with a hammer in the head :") and leave him to type "from here to tommorow loop after loop after loop after loop" :"). Gees those perl designers with LW in the head are mad-scientists .....
|
|Do you really need to say this?

]- no just kidding :")

|
|> 7.) Quantum superpositions ===============
|> 
|> case2 - hyperoperator :
|> 
|> my $result = 0;
|> for ($a,$b,$c)  {
|>    if ($x == $_) { $result =1; last}
|> }
|
|Not correct. The second case is the same as:
|
|	($x == $a, $x == $b, $x == $c)
|
|which reduces in effect to:
|
|	$x == $c

]- i see now...  so if ',' works the Perl5 way, then all are ecaluated but the result is the result of the last comparison, but in superposition if for some comparision we have true the rest are not evaluated..

|> and all they (except CATCH) are in fact proprietes of the block
|
|So is CATCH.

]- i see, i havent read it well :
<snip apo4>
There is, however, no catch property to go with the CATCH block.
</snip>

thanx




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About