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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 15, 2010 at 11:51 AM, Erik de Castro Lopo
<mle+la@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user


[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux