Thread overview
ctype.isspace missing characters
Jun 29, 2004
Sean Kelly
Jun 30, 2004
Walter
Jun 30, 2004
Sean Kelly
Jun 30, 2004
J C Calvarese
June 29, 2004
isspace should evaluate true when the passed value is any of the following:

0x09 – 0x0D or 0x20

ie.

space (' '), form feed ('\f'), new-line ('\n'), carriage return ('\r'),
horizontal tab ('\t'), and vertical tab ('\v').

I think it just returns true for ' ' now.


June 30, 2004
I think it works, can you try again?

"Sean Kelly" <sean@f4.ca> wrote in message news:cbsued$a7f$1@digitaldaemon.com...
> isspace should evaluate true when the passed value is any of the
following:
>
> 0x09 - 0x0D or 0x20
>
> ie.
>
> space (' '), form feed ('\f'), new-line ('\n'), carriage return ('\r'),
> horizontal tab ('\t'), and vertical tab ('\v').
>
> I think it just returns true for ' ' now.
>
>


June 30, 2004
Sean Kelly wrote:
> isspace should evaluate true when the passed value is any of the following:
> 
> 0x09 – 0x0D or 0x20
> 
> ie.
> 
> space (' '), form feed ('\f'), new-line ('\n'), carriage return ('\r'),
> horizontal tab ('\t'), and vertical tab ('\v').
> 
> I think it just returns true for ' ' now.


This works for me (no asserts fail). Did I miss one?


import std.ctype;

void main()
{
    assert(isspace(' '));  /* space */
    assert(isspace('\r')); /* carriage return */
    assert(isspace('\n')); /* new-line */
    assert(isspace('\f')); /* form feed */
    assert(isspace('\t')); /* horizontal tab */
    assert(isspace('\v')); /* vertical tab */

    assert(isspace('\x09'));
    assert(isspace('\x0A'));
    assert(isspace('\x0B'));
    assert(isspace('\x0C'));
    assert(isspace('\x0D'));
    assert(isspace('\x20'));

    assert(!isspace('j'));
}

-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
June 30, 2004
In article <cbt51h$j9q$2@digitaldaemon.com>, Walter says...
>
>I think it works, can you try again?

It does work.  I must have screwed up my test case.  Sorry about that.

Sean