On 6/26/2010 3:37 PM, P Kishor wrote:
> On Sat, Jun 26, 2010 at 9:32 AM, Craig DeForest
> <[email protected]> wrote:
>> You are confusing direct assignment and computed assignment. "$b=$b*10"
>> creates a new PDL and puts it in the scalar named $b, dropping the old one
>> (and its dataflow connection to $a) on the floor. use computed assignment
>> (".=") instead.
It is pretty consistent with itself. However, the usage
can definitely trip you up if you start thinking in "C".
As far as I know, all the X= combined X-operator and
assignments do the data flow thing. Regular assignment,
=, is just completely standard perl assignment so no
inconsistency there---just difference.
This is exactly the sort of thing that can be confusing
to new PDL users.
--Chris
> Fair enough. But, add this to the list of inconsistencies.
>
> perldl> $a = sequence 5
> perldl> p $a
> [0 1 2 3 4]
>
> perldl> $b = $a->slice('1:3')
> perldl> $b = $b + 5
> perldl> p $b
> [6 7 8]
>
> However....
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl