Compile time $foreach_r
For consistency and code simplification.
Argument against this: there is neither $while nor $do $while. It's not supposed to be a strict 1:1
Argument for this: I have the working patch. :)
Argument for this: I have the working patch. :)
Knowing Christoffer, it would be more productive to provide a showcase where $foreach_r would be extremely helpful. Remember, that C3 is trying to be minimalistic and have only nesessary (widely used) functionality.
With that argument a lot of things removed from C3 should be in the language.
Note that it is not particularly hard to write a macro that takes a compile time list and reverses it for reverse foreach
Argument for this: I have the working patch. :)
Knowing Christoffer, it would be more productive to provide a showcase where
$foreach_rwould be extremely helpful. Remember, that C3 is trying to be minimalistic and have only nesessary (widely used) functionality.
Not quite $foreach_r, but adjacent. I have abused of compile time loops on a few projects, for example on my kernel project I generate 256 ISR stubs via an ASM macro compile-time loop. In plain C or C3, I’d have to spell each function by hand.
But i understand that it clashes with the simple language philosophy.
So even though I could absolutely use this feature, I get why it might not fit the language’s goals.
@carlosdaniel26 is reverse iteration required explicitly? Is not $for sufficient?