MOO-cows Mailing List Archive

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

Re: List operations (Was: More LPMOO stuff)



On Tue, 15 Aug 1995, Ben Jackson wrote:

> In message <9508150203.AA16751@hardy.u.washington.edu> , you wrote:
> > Hence list[n..] would be equivalent to list[n..length(list)], except it
> > should save the extra time of evaluating length(list).
> 
> It would save you the extra time of *typing* length(list).  The length
> will still have to be evaluated.  In either case it's O(1), since list[0]
> contains the length (it's inaccessible from MOOcode).  I don't think you
> can argue that this would be a performance improvement.

Wouldn't it be an improvement since the actual call to the builtin length 
is not made?  Using the value in the list directly should be faster than 
running through the loop for the builtin call, pushing it on the stack 
and poping it back off...

Acroyear		       and his sidekick		       Stephan Szabo
Ex-King of Spartak					       Expired Bovine
Member of the Micronauts				       Theologist




Home | Subject Index | Thread Index