[racket-dev] Non-negative real predicate?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Jun 10 16:15:30 EDT 2011

Matthew rules. 


On Jun 10, 2011, at 4:11 PM, Matthew Flatt wrote:

> I'm more in favor of using `(and/c real? (not/c negative?))'. 
> 
> At Fri, 10 Jun 2011 16:08:35 -0400, Matthias Felleisen wrote:
>> 
>> Make a real predicate and link to it. 
>> 
>> 
>> On Jun 10, 2011, at 3:23 PM, Asumu Takikawa wrote:
>> 
>>> Hi all,
>>> 
>>> I've seen some locations in the docs where a currently imaginary
>>> predicate is used as a contract. 
>>> 
>>> e.g. the sleep function has a nonnegative-number? contract
>>> 
>>> The same contract is often expressed as 
>>> (and/c real? (not/c negative?))
>>> in many locations. 
>>> 
>>> e.g. the get-extent method for snip%, methods for editor<%>, text%, etc.
>>> 
>>> It seems like the imaginary contract should be replaced with an actual
>>> one. Should it be replaced by the combinator expression above in the
>>> docs or can a predicate be made for this [somewhat common] case?
>>> 
>>> Cheers,
>>> Asumu
>>> _________________________________________________
>>> For list-related administrative tasks:
>>> http://lists.racket-lang.org/listinfo/dev
>> 
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/dev



Posted on the dev mailing list.