Testing whitespace

Subject: Testing whitespace
From: Jany Quintard <quintard.j@xxxxxx>
Date: Mon, 13 Mar 2000 10:07:40 +0100 (CET)
Thanks Brandon and Peter. 
 
> Quoting Jany Quintard <quintard.j@xxxxxx>:
> > When processing the content (character data) of an element, I want to
know
> > if this element contains only space characters. It is easy to use a
loop
> > to check if each character is equal to #\space.
> > But, a space can also be a newline, a tabulation and so on.
> > So, is there a best way to check spaces (I guess using properties)
than
> > comparing a character to a list of values ?
> > 
> Quoting Brandon Ibach <bibach@xxxxxxxxxxxxxx>
>    Well, Peter will have to speak to the relative speed of this method
> as opposed to using (member) against a list of whitespace characters,
> but you could use:  (char-property 'input-whitespace? c), where "c" is
> the character in question.
This seems a much cleaner way to do it.

>    This requires OpenJade 1.3, as 1.2.2 will simply return false for
> every character.
This makes the post from Alexander Sieb <alex@xxxxxxx> (OpenJade 1.3
binaries for Windows NT/2000 available) an even better new, because if
I am a Linux user, my clients are mainly Windows users..

> Quoting Peter Nilsson <pnidv96@xxxxxxxxxxxxxx>
> It should be quiet fast. It is a primitive that searches a 3-level tree
> for the value. The (member ...) approach is a little slower. I'd
recommend
> using char-property. Please tell me if there are any performance
problems,
Well, it seems that there are none. It works fine, on my both platforms.

(my apologies for the long quotings)
Jany.



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread