chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: bytevectors


From: Eduardo Cavazos
Subject: [Chicken-users] Re: bytevectors
Date: Tue, 17 Feb 2009 15:51:32 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080716 SeaMonkey/1.1.11

Eduardo Cavazos wrote:

Hmmm... After poking around some, I see that I can probably cook up a compatability layer. Something along these lines:

This is what I ended up using. I loaded into Chicken and it's handling some "R6RS" code of mine. These procedures are in tight loops. Chicken is keeping up with Larceny and Ypsilon so I'm guessing the overhead introduced isn't too bad. ;-)

----------------------------------------------------------------------
(use srfi-4)

(define (make-bytevector n)
  (u8vector->blob/shared (make-u8vector n)))

(define bytevector-length blob-size)

(define (bytevector-ieee-double-native-ref bv i)
  (f64vector-ref (blob->f64vector/shared bv) (/ i 8)))

(define (bytevector-ieee-double-native-set! bv i val)
  (f64vector-set! (blob->f64vector/shared bv) (/ i 8) val))
----------------------------------------------------------------------

Ed




reply via email to

[Prev in Thread] Current Thread [Next in Thread]