in reply to Re^4: compiling perl scripts aka why is perl not as fast as C
in thread compiling perl scripts aka why is perl not as fast as C
Definitely not. List assignment takes a list of scalars, and that's exactly what you provided.
Call me naive, but I only see a scalar, not a list of scalars. Still a list of of scalars is a list, not an array, so even @array = ($a, $b) looks to me like a coercion. Likewise @array = foo() coerces the result list to an array. So you have $variable_of_one_type = $variable_of_other_type where the LHS dictates the type of the result.
it's count is assigned, and that's a completely different entity.
The count is an intrinsic property of the @array, and as far as I understand coercion, it is allowed to lose information - just like in other languages coercing a float to int loses the fractional part. I haven't seen a definition of coercion yet that requires the coerced object to retain the essence of what it was, however you define "essence".
So you haven't convinced me in either case that not coercion is happening.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: compiling perl scripts aka why is perl not as fast as C
by ikegami (Patriarch) on Mar 22, 2010 at 17:39 UTC | |
by moritz (Cardinal) on Mar 22, 2010 at 17:57 UTC | |
by ikegami (Patriarch) on Mar 22, 2010 at 18:19 UTC |