[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
string-any, string-every predicate
From: |
Kevin Ryde |
Subject: |
string-any, string-every predicate |
Date: |
Sat, 14 Aug 2004 10:35:41 +1000 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) |
* srfi-13.c (scm_string_any, scm_string_every): Add support for char
and charset as predicates, per SRFI-13 spec.
I slipped this into 1.6 too, since it's a deviation from the spec.
New words:
-- Scheme Procedure: string-any char_pred s [start end]
Return true if `char_pred' is satisfied for any character in the
string S. CHAR_PRED can be
* A character, to to test for any in S equal to that.
* A character set (*note SRFI-14::), to test for any character
in S in that character set.
* A predicate function, called as `(CHAR_PRED c)' for each
character in S, from left to right, to test for any on which
CHAR_PRED returns true.
When CHAR_PRED does return true (ie. non-`#f'), that value is
the value returned by `string-any'.
If there are no characters in S (ie. START equals END) then the
return is `#f'.
SRFI-13 specifies that when CHAR_PRED is a predicate function, the
call on the last character of S (assuming that point is reached)
is a tail call, but currently in Guile this is not the case.
-- Scheme Procedure: string-every char_pred s [start end]
Return true if CHAR_PRED is satisifed for every character in the
string S. CHAR_PRED can be
* A character, to to test for every character in S equal to
that.
* A character set (*note SRFI-14::), to test for every
character in S being in that character set.
* A predicate function, called as `(CHAR_PRED c)' for each
character in S, from left to right, to test that it returns
true for every character in S.
When CHAR_PRED does return true (ie. non-`#f') for every
character, the return from the last call is the value
returned by `string-any'.
If there are no characters in S (ie. START equals END) then the
return is `#t'.
SRFI-13 specifies that when CHAR_PRED is a predicate function, the
call on the last character of S (assuming that point is reached)
is a tail call, but currently in Guile this is not the case.
srfi-13.c.any.diff
Description: Text document
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- string-any, string-every predicate,
Kevin Ryde <=