Front page | perl.perl6.language |
Postings from August 2006
Re: === and array-refs
Thread Previous
|
Thread Next
From:
Mark J. Reed
Date:
August 17, 2006 11:41
Subject:
Re: === and array-refs
Message ID:
f60fe000608171141t6442dbb2y48aea63cdfea606d@mail.gmail.com
On 8/17/06, David Green <david.green@telus.net> wrote:
> > $a=[1, 2, \@x];
> > $c=[1, 2, \@x];
> > $d=[1, 2, \@y];
> >
> >So $a, $c, and $d may all have the same *value*
> >(or "snapshot", when evaluated all the way down
> >through nesting and references), i.e. they might
> >be eqv, but only $a and $c are === because they
> >have the same contents [unevaluated contents]
> >and $d doesn't.
In this case, it seems like [===] @$a, @$c would do what you want,
yes? It would return true, while [===] @$a,@$d would return false...
In the general case - well, I think the thread demonstrates that it's
hard to define a general case for what you want to do. Based on your
example, I assumed you wanted one-level dereferencing, regardless of
the contents. But it sounds like what you want is infinite
dereferencing as long as the referent is anonymous, and no
dereferencing if the referent is a named variable? That doesn't seem
like a common enough case to warrant sugar to me; what am I missing?
--
Mark J. Reed <markjreed@mail.com>
Thread Previous
|
Thread Next
-
===, =:=, ~~, eq and == revisited (blame ajs!)
by Yuval Kogman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Yuval Kogman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by David Green
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Larry Wall
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Smylers
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Charles Bailey
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
by Jonathan Lang
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Darren Duncan
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Aaron Sherman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Yuval Kogman
-
Re: ===, =:=, ~~, eq and == revisited (blame ajs!)
by Yuval Kogman