David Green writes:

> I guess my problem is that [1,2] *feels* like it should === [1,2].
> You can explain that there's this mutable object stuff going on, and I
> can follow that (sort of...), but it seems like an implementation
> detail leaking out.

The currently defined behaviour seems intuitive to me, from a starting
point of Perl 5.  The difference between:

  my $new = [EMAIL PROTECTED];

and:

  my $new = [EMAIL PROTECTED];

is that the second one is a copy; square brackets always create a new
anonymous array rather than merely refering to an existing one, and
that's the same thing that's happening here.  Think of square brackets
as meaning something like Array->new and each one is obviously distinct.

> And I feel this way because [1,2] looks like it should be platonically
> unique.

I'd say that C< (1, 2) > looks like that.  But C< [1, 2] > looks like
it's its own thing that won't be equal to another one.

Smylers

Reply via email to