From: Tiarnán Ó Corráin
Subject: How to test a string contains only numbers?
Date: 
Message-ID: <m2mzqzo239.fsf@Cascade.local>
Hello--

I'm trying to find out whether a string contains only numbers. I
expected
        (every #'numberp "1234")
to succeed, since
        (every #'numberp #(1 2 3 4))
does, but no joy.

I suspect it's because "1234" is really #(#\1 #\2 #\3 #\4).

-- 
Tiarn�n

From: Lars Brinkhoff
Subject: Re: How to test a string contains only numbers?
Date: 
Message-ID: <85y8ajpfv4.fsf@junk.nocrew.org>
········@yahoo.com (Tiarn�n � Corr�in) writes:
> I'm trying to find out whether a string contains only numbers. I
> expected
>         (every #'numberp "1234")
> to succeed, since
>         (every #'numberp #(1 2 3 4))
> does, but no joy.

          (every #'digit-char-p "1234")
From: Tiarnán Ó Corráin
Subject: Re: How to test a string contains only numbers?
Date: 
Message-ID: <m2fywrnwrl.fsf@Cascade.local>
Lars Brinkhoff <·········@nocrew.org> writes:

> ········@yahoo.com (Tiarn�n � Corr�in) writes:
>> I'm trying to find out whether a string contains only numbers. I
>> expected
>>         (every #'numberp "1234")
>> to succeed, since
>>         (every #'numberp #(1 2 3 4))
>> does, but no joy.
>
>           (every #'digit-char-p "1234")

Thank you.
-- 
Tiarn�n
From: Raymond Wiker
Subject: Re: How to test a string contains only numbers?
Date: 
Message-ID: <86ll6j7676.fsf@raw.grenland.fast.no>
········@yahoo.com (Tiarn�n � Corr�in) writes:

> Hello--
>
> I'm trying to find out whether a string contains only numbers. I
> expected
>         (every #'numberp "1234")
> to succeed, since
>         (every #'numberp #(1 2 3 4))
> does, but no joy.
>
> I suspect it's because "1234" is really #(#\1 #\2 #\3 #\4).

        Try #'digit-char-p instead of #'numberp.

-- 
Raymond Wiker                        Mail:  ·············@fast.no
Senior Software Engineer             Web:   http://www.fast.no/
Fast Search & Transfer ASA           Phone: +47 23 01 11 60
P.O. Box 1677 Vika                   Fax:   +47 35 54 87 99
NO-0120 Oslo, NORWAY                 Mob:   +47 48 01 11 60
From: Pascal Bourguignon
Subject: Re: How to test a string contains only numbers?
Date: 
Message-ID: <87y8ajbbz8.fsf@thalassa.informatimago.com>
········@yahoo.com (Tiarn�n � Corr�in) writes:
> Hello--
>
> I'm trying to find out whether a string contains only numbers. I
> expected
>         (every #'numberp "1234")
> to succeed, since
>         (every #'numberp #(1 2 3 4))
> does, but no joy.
>
> I suspect it's because "1234" is really #(#\1 #\2 #\3 #\4).

The problem is  that you are confounding two different notions: 
number and digit.

Digits are some designated characters, used to write some
representations of numbers.

Numbers are mathematical abstractions used to "compute".

  
Try: (every (function digit-char-p) "1234")

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush