Re: [racket] numbers/bytes in r6rs

2010-12-26 Thread Vincent St-Amour
At Sun, 26 Dec 2010 10:49:45 -0600, Matthew Flatt wrote: > > - determining whether a floating point number is a double or a single. > > I don't think there's any predicate for that. flonum? returns true for double-precision floats, and (lambda (x) (and (inexact-real? x) (not (flonum? x return

Re: [racket] numbers/bytes in r6rs

2010-12-26 Thread Robby Findler
Whoops looks like I was wrong there. Please disregard. Robby On Sunday, December 26, 2010, Robby Findler wrote: > In racket you'd use this function, fwiw: > >  (λ (n) (bytes-length (string->bytes/utf-8 (format "~s" n > > (or possibly a variant of it depending on the encoding you were using)

Re: [racket] numbers/bytes in r6rs

2010-12-26 Thread Matthew Flatt
At Sun, 26 Dec 2010 09:52:20 +0100, Wolfgang De Meuter wrote: > I'm struggling with chapter 2 of the R6RS libraries (relation between Scheme > data objects and bytevectors). Does anyone know a clean&simple way for > - determining the number of bytes needed to push an arbitrary-sized number in > a

Re: [racket] numbers/bytes in r6rs

2010-12-26 Thread Robby Findler
In racket you'd use this function, fwiw: (λ (n) (bytes-length (string->bytes/utf-8 (format "~s" n (or possibly a variant of it depending on the encoding you were using). Robby On Sun, Dec 26, 2010 at 2:52 AM, Wolfgang De Meuter wrote: > Hello > > I'm struggling with chapter 2 of the R6RS