I would keep finite? for the semantics associated with the name even if it is just a renaming of rational?. Particularly since you can't just use (not (infinite? x)) when NaNs are a possibility. [I personally don't like using rational? for an abstraction that includes irrational numbers.]<br>
<br>On Friday, November 18, 2011, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>> wrote:<br>> Except for `finite?' (which seems to be covered by `rational?'), these<br>> additions sound fine to me.<br>
><br>> I'm not sure whether they should go in `racket/math' or `racket/base',<br>> though. Although it feels wrong to keep adding to `racket/base', two<br>> thoughts make me lean in that direction:<br>
><br>> * It will be confusing to have bindings such as<br>> `exact-nonnegative-integer?' in `racket/base', while binding such as<br>> `nonnegative-real?' are in `racket/math'. Putting all of those<br>
> functions in the same place seems more consistent.<br>><br>> * Adding things to `racket/base' probably leads to fewer compatibility<br>> issues. That's because `racket/math' could be explicitly imported<br>
> into a module that defines `nonnegative-real?', leading to an<br>> import--definition conflict. If `racket/base' as a module language<br>> provides nonnegative-real?', then a module's own definition of<br>
> `nonnegative-real?' can shadow it without conflict.<br>><br>> At Fri, 18 Nov 2011 12:47:16 -0700, Ryan Culpepper wrote:<br>>> On 11/18/2011 12:34 PM, Neil Toronto wrote:<br>>> > On 11/18/2011 12:22 PM, Ryan Culpepper wrote:<br>
>> >> On 11/18/2011 12:13 PM, Neil Toronto wrote:<br>>> >>> I've moved this to dev from a private discussion with Doug, who has just<br>>> >>> tried the nightly build.<br>>> >>><br>
>> >>> On 11/18/2011 11:43 AM, Williams, Doug wrote:<br>>> >>>> 2) The plot/utils has nan? and infinite?, which are also exported from<br>>> >>>> the science collection and I had to explicitly exclude them in the<br>
>> >>>> require. Can we talk to the powers that be and see about getting them<br>>> >>>> (and finite?) moved to racket/math? Then we can both remove them from<br>>> >>>> our code. [I'm not sure about any interaction with the r6rs functions.]<br>
>> >>><br>>> >>> Powers That Be, Doug and I would like `nan?' and `infinite?' to be in<br>>> >>> `racket/math'.<br>>> >>><br>>> >>> I made an exact equivalent of Doug's `finite?', but called it<br>
>> >>> `regular-real?'. I use it in all kinds of function contracts (it returns<br>>> >>> #f for non-reals). We would also like that one, with either name, in<br>>> >>> `racket/math'.<br>
>> >><br>>> >> How does 'finite?' differ from 'rational?'?<br>>> ><br>>> > Whoa! It doesn't!<br>>> ><br>>> >> If we're making a wishlist, I'd really like<br>
>> >> '{positive,nonnegative}-{real,rational}?'.<br>>> ><br>>> > For use or for contracts? For contracts, we already have `>/c', `</c',<br>>> > `>=/c' and `<=/c', which can do the same as `positive-real?',<br>
>> > `negative-real?', `nonnegative-real?' and `nonpositive-real?' if applied<br>>> > to 0, and are arguably easier to read.<br>>><br>>> I'd argue that they're less easy to read. Also, despite their<br>
>> availability, I've still seen contracts that say 'real?' even when they<br>>> mean '(>=/c 0)', etc. (Or possibly 'nonnegative-rational?'.)<br>>><br>>> > For the `*-rational?' ones, would they identify only exact rationals?<br>
>> > Because that would be inconsistent with `rational?'.<br>>><br>>> No, they should be consistent with 'rational?' and accept inexacts.<br>>><br>>> > If we *are* making a wishlist, I'd like to add exact-round, exact-floor,<br>
>> > exact-truncate and exact-ceiling. I rarely need to chop off fractional<br>>> > parts without also making the result exact.<br>>><br>>> +1<br>>><br>>> Ryan<br>><br>> _________________________________________________<br>
> For list-related administrative tasks:<br>> <a href="http://lists.racket-lang.org/listinfo/dev">http://lists.racket-lang.org/listinfo/dev</a><br>>