MOO-cows Mailing List Archive


Re: List operations: (reverse range) (SERVER mods)

> At 11:27 AM 8/16/95 PDT, wrote:
> >While we're revising ranges for lists and strings, we might as well revise
> >the ranges in for-loops as well, as suggested by someone (sorry, forgot who)
> >in a previous post:
> [much snippage, before and after]
> And one more for loop wish..
> for i in [10..1]
> instead of 
> for i in [1..10]
>   tmp = 11 - i ;

I personally don't like this.  If we have a 'implicit decrementing' loop,
I'd like to see a different keyword, like

for i from [10..1]

so the MOOlang can recognize what we are saying..
another interesting idea would be to borrow from poplog:

for i on ({list}) (where list = {e1,e2,e3...en} )

iteration  value of i

    1		{e1..en}
    2		{e2..en}
    n		{en}

this is useful in some list processing code, but it probably can be simulated
with standard moo operations.

myself, I would like some easy way of knowing the 'iteration number' 
that I'm currently on. when I use code like:

for i in ({list})

I many times need to know what index i'm at. so I code:

for i in  ({list})

I can't use (counter= i in {list})  since the same element may appear
twice in the list.

it would be nice to have :

for i in ({list}) count i_counter

or something like that... 

On another topic, with the discussion of FABLE, (which I haven't heard much
about recently)  will the 'future enhancements' be done by Pavel or should
we form a MOO_cabal to keep development going forth on MOOlang and 
MOOserver ?

David ( (rocky on Immaterial Park: 8888)


Home | Subject Index | Thread Index