[plt-dev] Inexact integers

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Fri May 21 22:32:02 EDT 2010

I talked with the PLTers who attended TFP and it was agreed that inexact 
integers, a holdover from Scheme standards, are counter intuitive.  I 
wonder if it is worth doing away with them in Racket?

They cause a mess with the types in Typed Scheme (IME) and lead to bugs 
in contracts and code.  For example, the contract on `text' in 
2htdp/image says the font size argument is an `integer?', but really it 
should be `exact-integer?'.  For example:

    #lang racket
    (require 2htdp/image)
    (text "hi" 12.0 'black)

This gives:

find-or-create-font in font-list% (family id case): expected argument of 
type <exact integer in [1, 255]>; given 12.0

David


Posted on the dev mailing list.