guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] In string-split, add support for character sets and predicat


From: Daniel Hartwig
Subject: Re: [PATCH] In string-split, add support for character sets and predicates.
Date: Wed, 10 Oct 2012 09:37:43 +0800

On 10 October 2012 01:48, Mark H Weaver <address@hidden> 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.

Attachment: 0001-In-string-split-add-support-for-character-sets-and-p.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]