[plt-dev] flvector

From: Andrew Reilly (areilly at bigpond.net.au)
Date: Mon Dec 21 17:40:48 EST 2009

On Mon, Dec 21, 2009 at 11:17:08AM -0500, Anthony Cowley wrote:
> On Dec 21, 2009, at 10:44 AM, Noel Welsh <noelwelsh at gmail.com> wrote:
> >On Sat, Dec 19, 2009 at 2:54 PM, Matthew Flatt <mflatt at cs.utah.edu>  
> >wrote:
> >>
> >>I can see the use for many flavors of vectors when dealing with  
> >>foreign
> >>libraries. But is there another reason to bother with "signed 16-bit
> >>integer" instead of just using exact integers?
> >>
> >
> >I think arrays of doubles are by far the most common requirement,
> >followed by arrays of ints, then distantly followed by floats, 16-bit
> >ints and bytes in that order.
> FWIW, I agree with Noel's assessment with the exception that I think  
> bytes are  more important: I use byte arrays all the time for working  
> with images. To simplify life, one often works with int arrays  
> (especially when using a high level language), but things like masking  
> work out just fine on 8-bit values.

Is it possible to go the r6rs-route (I think that's where I saw
it), and replace all of the unboxed-vector variants with just
byte/octet vectors, and put the result-typing into a family of
-ref/-set! functions?  That should have no performance penalty,
I would hope, and might also help with parsing various binary
header formats and what-not.


Posted on the dev mailing list.