From: Sam Steingold
Subject: (typep t '(satisfies evenp))
Date: 
Message-ID: <m3bs1xyttt.fsf@loiso.podval.org>
What should the above return?
CLHS for SATISFIES says that
        (typep x '(satisfies p)) is equivalent to (if (p x) t nil)
In that case (typep 'foo '(satisfies evenp)) will signal an error.
Maybe what was meant was
        (if (ignore-errors (p x)) t nil)
??

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
We're too busy mopping the floor to turn off the faucet.

From: Barry Margolin
Subject: Re: (typep t '(satisfies evenp))
Date: 
Message-ID: <q1B_9.27$is4.1348@paloalto-snr1.gtei.net>
In article <··············@loiso.podval.org>,
Sam Steingold  <···@gnu.org> wrote:
>What should the above return?
>CLHS for SATISFIES says that
>        (typep x '(satisfies p)) is equivalent to (if (p x) t nil)
>In that case (typep 'foo '(satisfies evenp)) will signal an error.

I think it should.

>Maybe what was meant was
>        (if (ignore-errors (p x)) t nil)
>??

No, if you want a type for even numbers, you should write:

 (typep x '(and number (satisfies evenp)))

or

 (typep x '(satisfied (lambda (x) (and (numberp x) (evenp x)))))

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Peter Seibel
Subject: Re: (typep t '(satisfies evenp))
Date: 
Message-ID: <m3d6md811p.fsf@localhost.localdomain>
Barry Margolin <······@genuity.net> writes:

> No, if you want a type for even numbers, you should write:
> 
>  (typep x '(and number (satisfies evenp)))
> 
> or
> 
>  (typep x '(satisfied (lambda (x) (and (numberp x) (evenp x)))))

Huh? I can't find 'satisfied' in the CLHS and and the 'satisfies'
predicate only takes a symbol. What did I miss?

-Peter

-- 
Peter Seibel
·····@javamonkey.com
From: Barry Margolin
Subject: Re: (typep t '(satisfies evenp))
Date: 
Message-ID: <ZuC_9.29$is4.1343@paloalto-snr1.gtei.net>
In article <··············@localhost.localdomain>,
Peter Seibel  <·····@javamonkey.com> wrote:
>Barry Margolin <······@genuity.net> writes:
>
>> No, if you want a type for even numbers, you should write:
>> 
>>  (typep x '(and number (satisfies evenp)))
>> 
>> or
>> 
>>  (typep x '(satisfied (lambda (x) (and (numberp x) (evenp x)))))
>
>Huh? I can't find 'satisfied' in the CLHS and and the 'satisfies'
>predicate only takes a symbol. What did I miss?

A typo and my mistake.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Kent M Pitman
Subject: Re: (typep t '(satisfies evenp))
Date: 
Message-ID: <sfw1y2sixgi.fsf@shell01.TheWorld.com>
Barry Margolin <······@genuity.net> writes:

> In article <··············@loiso.podval.org>,
> Sam Steingold  <···@gnu.org> wrote:
> >What should the above return?
> >CLHS for SATISFIES says that
> >        (typep x '(satisfies p)) is equivalent to (if (p x) t nil)
> >In that case (typep 'foo '(satisfies evenp)) will signal an error.
> 
> I think it should.

FWIW, I agree with Barry.  SATISFIES is documented to call the predicate.
The argument x is unconstrained.  Therefore, the predicate must be a 
universal predicate.  If you have foreknowledge that X is always a number,
you can safely use EVENP, but not otherwise.  No, it doesn't say this 
explicitly anywhere, but I think this is all a logical consequence of what
is said.