[OT] Perl woes

Avleen Vig avleen at gmail.com
Thu Jan 29 02:59:01 GMT 2009


On Wed, Jan 28, 2009 at 10:56 AM, Jonathan Kimmitt
<Jonathan.Kimmitt at csr.com> wrote:
>        The next time I use == instead of eq to compare two strings, I
> will know to expect it will always
>        evaluate to true. What other language does this (apart from C,
> which would invariably return false)

Objective C (which is almost C, but different enough), == is used to
compare if two objects are equal. And by equal, we mean "pointers to
the same address space".

As a result, classes like NSString override == and 'isEqual' to
actually do things like string comparisons. So you can use == on
string objects just fine :-)


More information about the london.pm mailing list