Changes in command 'name' and 'for' planned for G'MIC 3.0.3

This was what I wanted to know at the top of the thread. It is clear to me what the changes are now.


foreachdone is comme ci comme ça. Shortens the code but I usually do complex stuff, including repeat $!-1 l[$<] ... endl done and commands and selections between the repeat and local and endl and done.

Yes, indeed sometimes the usual repeat..done construct will be more adapted.
It’s just a proposal for another construct that will simplify maybe 80% of the commands in stdlib :slight_smile:

I understand. Just concerned whether adding more commands that do essential the same thing in a limited way is a good thing or not…

Yes, that is debatable.
Anyway, note that repeat was already something we could do with a for:

foo : 
  i=0
  for i<$!
    ... do something here ...
    i+=1
  done

is equivalent to

foo : 
  repeat $!
    .. do something here ..
  done

Yes, I have wondered about that too. :nerd_face:

I tried just this example. It loops forever not foreach!

As I said, the feature is not implemented yet.
I’ve started writing some code for it, but it’s only a start.