[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Sun, 14 Mar 2004 23:16:35 +0000 (UTC) 
Subject:Re: for in vectors 
From:steve 
Volume-ID: 

Hi Luc,

>I'm wondering why no for...endfor syntax is provided for vectors.

It is
	for i in_vector v do ...
	for i in_vectorclass v do ....
But, alas, it is not documented in HELP * FOR but HELP * FOR_FORM.  Note
that with_index does works with these forms.


>But I was curious why it
>was left out in the first place.

For loops have been developed in a patchwork way with backwards
compatibility preserved.  This is a pity really as it has led to
under-generalization.  e.g. with_index only works with a vector-class
iterators, using_subscriptor only works with single loop variables,
and combination of iterators is unsupported.

Of course, if you come from Java programming you will probably
think you have died and gone to heaven (version 1.8).

-- 
Steve