On Mon, 08 Jun 2015 18:04:44 -0700, <d...@gnu.org> wrote:
No dice. The main problem is dealing with all combinations of running out of signature and running out of available arguments. If you treat the optional argument skipping in an inner loop, you may still run out of signature, and in that case you still need to treat the case where you have simultaneously run out of arguments (namely because the non-matching argument triggering the skipping was \default aka *unspecified) separately _and_ break out of all loops. Since you have already fetched the next signature bit (since you would not know whether it was optional and skipping should continue), you can't return to the main loop which would fetch it again but need to clad the whole in one while (scm_is_false (scm_call_1 (pred, arg))) of its own. Treating all the terminating condition combinations in inner loop and outer loop separately causes the control structures to fray apart more than the "skipping" flag does, to the degree where the cleanest solution to handle one of the innermost loop termination conditions with a goto statement.
Well, the inner loop can decide whether to continue by peeking-ahead at the next entry in the signature. Then the jobs of the inner/outer loops remain clean. Some people don't like side-effects in loop-control conditionals while (scm_is_pair (scm_cdr (signature)) // more slots ? && scm_is_pair (scm_cadr (signature)) // next one optional ? && (signature = scm_cdr (signature)));// deal with it now. so maybe I'll use test-in-the-middle loop, but that needs only break one loop. _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel