/ 7. C<<1 builtin iterators and conditionals, updated 2008-01-26 xCh.
'----------------------------------------------------------------------- */
#define loop while(TRUE)
-#define repeat(N) _NEW(I,0) _NEW(J,N) while(_I++<_J)
-#define for_range(VAR,FROM,TO) _NEW(I,FROM) _NEW(J,TO) for( VAR=_I ; _I<=_J?VAR<=_J:VAR>=_J ; _I<=_J?VAR++:VAR--)
+#define repeat(N) _NEW(I,0) _NEW(J,(N)) while(_I++<_J) /* C99 version would be: for(int _i=0,_j=(N);_i++<_j;) */
+#define for_range(VAR,FROM,TO) _NEW(I,(FROM)) _NEW(J,(TO)) for( VAR=_I ; _I<=_J?VAR<=_J:VAR>=_J ; _I<=_J?VAR++:VAR--)
#define for_each(NODE,HEAD) for(NODE=HEAD; NODE; NODE=NODE->__next)
#define for_search(NODE,HEAD,EXPR) for_each(NODE,HEAD) if(EXPR)
#define for_file_lines(STR,FNAME) /* _NEW(CTX,get_context()) file_read(FNAME) for(use_context(_CTX),STR=file_line(_F);release_context(_M),(*S && !feof(_F));STR=file_line(_F),end_context()) _CATCH */
'----------------------------------------------------------------------- */
/* later... #define _MALLOC void *_cll1_malloc(size_t size) { return malloc(size); } */
#define _CLL1_FPRINT(IOSTREAM) { int ofs=0; va_list ap; /* <-' */ for(va_start(ap,s);s!=NIL;s=va_arg(ap,char *)) { if(ofs)fputs(OFS,IOSTREAM);else ofs=1;/**/fputs(coalesce(s,NIL),IOSTREAM); } va_end(ap); fputs(EOL,IOSTREAM); }
-#define _DECLARE_PRINT void _cll1_print(char *s,...)
+#define _DECLARE_PRINT void _cll1_print(const char *s,...)
#define _PRINT _DECLARE_PRINT _CLL1_FPRINT(stdout)
-#define _DECLARE_FPRINT void _cll1_fprint(FILE *f,char *s,...)
+#define _DECLARE_FPRINT void _cll1_fprint(FILE *f,const char *s,...)
#define _FPRINT _DECLARE_FPRINT _CLL1_FPRINT(f)
#define _CLL1_FECHO(IOSTREAM) { va_list ap; /* <-' */ for(va_start(ap,s);s!=NIL;s=va_arg(ap,char *)) fputs(coalesce(s,NIL),IOSTREAM); va_end(ap); }
#define _ECHO void _cll1_echo(char *s,...) _CLL1_FECHO(stdout)