On 10 October 2012 01:48, Mark H Weaver <m...@netris.org> wrote: >> + if (!SCM_CHARSETP (char_pred)) >> { >> - last_idx = idx; >> - while (idx > 0 && buf[idx-1] != SCM_CHAR(chr)) >> - idx--; >> - if (idx >= 0) >> - { >> - res = scm_cons (scm_i_substring (str, idx, last_idx), res); >> - idx--; >> - } >> + SCM_ASSERT (scm_is_true (scm_procedure_p (char_pred)), >> + char_pred, SCM_ARG2, FUNC_NAME); >> + } > > Please drop the unneeded curly braces above.
Are guile's macros safe to always use that way? In libguile/__scm.h the SCM_ASSERT definition is conditional on SCM_RECKLESS and appears unsafe without the block. In NEWS it is mentioned that SCM_RECKLESS has been “removed completely” between 0.6 and 0.8, so I wonder if this instance was missed. The conditional in __scm.h dates to 1996. In any case, applied your suggestions and reattached; user of -DSCM_RECKLESS beware.
0001-In-string-split-add-support-for-character-sets-and-p.patch
Description: Binary data