On Mon, 24 Sep 2018, Sven Schreiber wrote:
Am 24.09.2018 um 16:18 schrieb Riccardo (Jack) Lucchetti:
> On Mon, 24 Sep 2018, Sven Schreiber wrote:
>
> It could be _marginally_ useful; the only case when I use count loops is
> when I have to time things so some repetition is needed. Otherwise, looping
> without being able to access the index is pretty useless to me.
>
> If we want to allow
>
> loop A/B
>
> in place of
>
> scalar C = A/B
> loop C
>
> I'd be fine with this, provided it's not too much work for the tokenizer.
If I understand correctly it's already allowed (but not
documented). The thing is that a syntax error can then lead the
parser to think it's intended as a count loop when it was a
different kind of loop.
OK, I've found a way to present a better error message in a case of
this kind, so I guess we may as well keep the facility to accept an
expression that yields a scalar for the repetitions of a "count"
loop. (Although I agree with Jack that this is probably only
marginally useful.) In which case I suppose it should also be
documented.
Allin