Michael G Schwern wrote:
> On Tue, Jan 28, 2003 at 12:11:18PM +1300, [EMAIL PROTECTED] wrote:
>
> > Has anyone considered removing with the syntactic distinction
> > between numeric and string indexing -- that is, between array and
> > hash lookup?
>
> PHP works this way.
Well, for some definit
On Wed, 2003-01-29 at 05:29, Leopold Toetsch wrote:
> John Williams wrote:
>
> > I think you are still overlooking the autovivification behavior.
> > i.e. What is the difference between these:
> >
> >1) $a{1234567} = 1;
> >
> >2) $a[1234567] = 1;
> >
> > Answer: #1 creates 1 element
--- Sam Vilain <[EMAIL PROTECTED]> wrote:
> =head2 includes( [ I, ] [ I ])
Where the and/or are obviously junctions.
if ($container.includes(any("ant", "beaver", "cow", "duck"))(
...
This is *SO* cool.
=Austin
John Williams wrote:
I think you are still overlooking the autovivification behavior.
i.e. What is the difference between these:
1) $a{1234567} = 1;
2) $a[1234567] = 1;
Answer: #1 creates 1 element. #2 creates 1,234,567 elements!
Not currently: 2) does
- generate a sparse hole be
On Wed, 29 Jan 2003 18:04, Michael G Schwern wrote:
> On Tue, Jan 28, 2003 at 12:11:18PM +1300, [EMAIL PROTECTED] wrote:
> > This may sound like a silly idea but ...
> >
> > Has anyone considered removing with the syntactic distinction between
> > numeric and string indexing -- that is, between arr
>> In particular, it would seem that
>> %foo[$key]
>> would be just as easy for the compiler to grok as
>> %foo{$key}
On Mon, 27 Jan 2003 15:39:19 -0800, Damian Conway <[EMAIL PROTECTED]> wrote:
> Sure. But then is this:
>
> $ref[$key]
>
> an array or hash look-up???
Yes, well I suppose t
On Tue, Jan 28, 2003 at 12:11:18PM +1300, [EMAIL PROTECTED] wrote:
> This may sound like a silly idea but ...
>
> Has anyone considered removing with the syntactic distinction between
> numeric and string indexing -- that is, between array and hash lookup?
PHP works this way.
http://www.php.net/m
On 28 Jan 2003, Aaron Sherman wrote:
> I'm not sure I recall the sufficient, yet irrelevant technical reasons.
> I certainly can't think of anything. It also helps in the case of
> objects that are non truly arrayish or hashish:
>
> my SuperTree $foo;
> $foo["Munge"]; # Returns the nod
On Tue, Jan 28, 2003 at 09:24:50AM -0800, Austin Hastings wrote:
> --- Dan Sugalski <[EMAIL PROTECTED]> wrote:
> > At 8:47 AM + 1/28/03, Piers Cawley wrote:
> > >> $ref[$key]
> > >>
> > >> an array or hash look-up???
> > >
> > >Decided at runtime?
> >
> > How? People use strings as array ind
At 5:07 PM -0500 1/28/03, Aaron Sherman wrote:
On Tue, 2003-01-28 at 16:34, Dan Sugalski wrote:
At 4:17 PM -0500 1/28/03, Aaron Sherman wrote:
> Now the question becomes, do you WANT them
>for readability?
Given that Larry's answer has been a resounding "yes" all along,
I'm not sure that
On Tue, 2003-01-28 at 16:34, Dan Sugalski wrote:
> At 4:17 PM -0500 1/28/03, Aaron Sherman wrote:
> > Now the question becomes, do you WANT them
> >for readability?
>
> Given that Larry's answer has been a resounding "yes" all along,
I'm not sure that this specific case was brought up. I rememb
At 4:17 PM -0500 1/28/03, Aaron Sherman wrote:
Now the question becomes, do you WANT them
for readability?
Given that Larry's answer has been a resounding "yes" all along, the
technical reasons (Which are, themselves, sufficient) are pretty
irrelevant.
--
On Tue, 2003-01-28 at 11:49, Dan Sugalski wrote:
> At 8:47 AM + 1/28/03, Piers Cawley wrote:
> >Damian Conway <[EMAIL PROTECTED]> writes:
> > > Sure. But then is this:
> >>
> >>$ref[$key]
> >>
> >> an array or hash look-up???
> >
> >Decided at runtime?
>
> How? People use strings as arra
Dan Sugalski <[EMAIL PROTECTED]> writes:
> At 8:47 AM + 1/28/03, Piers Cawley wrote:
>>Damian Conway <[EMAIL PROTECTED]> writes:
>> > Sure. But then is this:
>>>
>>> $ref[$key]
>>>
>>> an array or hash look-up???
>>
>>Decided at runtime?
>
> How? People use strings as array indices and i
--- Dan Sugalski <[EMAIL PROTECTED]> wrote:
> At 8:47 AM + 1/28/03, Piers Cawley wrote:
> >Damian Conway <[EMAIL PROTECTED]> writes:
> > > Sure. But then is this:
> >>
> >>$ref[$key]
> >>
> >> an array or hash look-up???
> >
> >Decided at runtime?
>
> How? People use strings as array in
At 8:47 AM + 1/28/03, Piers Cawley wrote:
Damian Conway <[EMAIL PROTECTED]> writes:
> Sure. But then is this:
$ref[$key]
an array or hash look-up???
Decided at runtime?
How? People use strings as array indices and ints/floats as hash
indices, and count on autoconversion to Make It W
Sure. But then is this:
$ref[$key]
an array or hash look-up???
Decided at runtime?
Doesn't help if $ref refers to a type that has both hash-like and array-like
accessability. And that will be very common, since all Perl 6 regexes return
such objects.
Damian
ECMAscript already tried this.
Bad idea.
If your hash keys happen to look like large numbers (e.g. you
have 7-digit product codes) as soon as you store one of them, it says:
"Oh, this looks like a number, so we'll store it like an array" and
happily creates a million empty array entries for you.
Damian Conway <[EMAIL PROTECTED]> writes:
>> This may sound like a silly idea
>
> It's been suggested previously.
>
>
>> Has anyone considered removing with the syntactic distinction between
>> numeric and string indexing -- that is, between array and hash lookup?
>
> Yes. We rejected the idea.
>
This may sound like a silly idea
It's been suggested previously.
Has anyone considered removing with the syntactic distinction between
numeric and string indexing -- that is, between array and hash lookup?
Yes. We rejected the idea.
In particular, it would seem that
%foo[$key]
would b
This may sound like a silly idea but ...
Has anyone considered removing with the syntactic distinction between
numeric and string indexing -- that is, between array and hash lookup?
In particular, it would seem that
%foo[$key]
would be just as easy for the compiler to grok as
%foo{$key}
21 matches
Mail list logo