Re: [LAU] OT: 2 minute intro to type systems (was C or C++?)

From: Chris Cannam <cannam@email-addr-hidden-day-breakfast.com>
Date: Fri Oct 15 2010 - 14:05:20 EEST

On Fri, Oct 15, 2010 at 11:51 AM, Erik de Castro Lopo
<mle+la@email-addr-hidden-nerd.com> wrote:
>> $x = 1;
>> $y = "2";
>> $z = $x + $y;
>
> [...] an implicit conversion from int
> to string is performed on $x and then the '+' operator then concatenates
> the two strings.

Other way around -- the string is converted to an int and the result
is a number. (This is relatively unfamiliar behaviour, which is why
it came to mind first as showing weaker typing than in other
languages.) "." is string concatenation in Perl, not "+".

Chris
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Fri Oct 15 16:15:04 2010

This archive was generated by hypermail 2.1.8 : Fri Oct 15 2010 - 16:15:04 EEST