lua-users home
lua-l archive

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


As long as you set all elements in your array. I really don't like the idea
that the function that returns the length of an array may not return the
length as anyone else using another programming language would understand
it, or that iteration over arrays may not return all elements 

And yes, performance does matter.

Some of my objection is just aesthetic, too. My mental programming model
regards them as different things, and forcing the two together seems ugly.

But as I said, I wasn't being very constructive, and this reply of mine is
no better :(

(Mostly I'm just using these messages as a convenient distraction from a
disaster of a project at work!)

P.


-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Doug Rogers
Sent: 06 June 2007 16:33
To: Lua list
Subject: Re: Sieve of Eratosthenes performance question

Paul Hudson wrote:

> I know I'm flogging a dead horse here, and I do not expect it ever to
> change (or want it to, as it would be too disruptive), but things like
> this make me more certain in my view that combining dictionaries/hash
> tables and contiguously-indexed-arrays in Lua was a mistake.

But the interface hasn't changed. Lua the language hasn't changed. You
can still use non contiguously indexed arrays. You can still use
whatever you want (except nil) to index a table. I don't get the gripe.
We're only talking about the implementation here. I know, I know, the
implementation matters as far as performance goes. But in this case it
helps.

The only change in the language that is relevant to this discussion is
the definition of the '#' operator. It managed to escape from the
implementation through the protective membrane of the interface.

Doug

-- 
Innovative Concepts, Inc. www.innocon.com 703-893-2007 x220