[racket-dev] Refactoring in-vector and friends

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Dec 2 18:26:14 EST 2010

I've read the commit and it looks like a good change. I presume you've
re-run the tests and you'll write new tests for the new vector types?

Jay

On Wed, Dec 1, 2010 at 8:41 AM, Noel Welsh <noelwelsh at gmail.com> wrote:
> Hi all,
>
> I spent (far too much) time this morning refactoring the definition of
> in-vector to expose the building blocks to compose these
> macro/functions. After refactoring the code for defining in-vector is:
>
>  (define-:vector-like-gen :vector-gen unsafe-vector-ref)
>
>  (define-in-vector-like in-vector
>    "vector" vector? vector-length :vector-gen)
>
>  (define-sequence-syntax *in-vector
>    (lambda () #'in-vector)
>    (make-in-vector-like #'vector?
>                         #'unsafe-vector-length
>                         #'in-vector
>                         #'unsafe-vector-ref))
>
> This could obviously be made smaller but it sufficient to enable reuse
> for in-flvector (my goal), in-f64vector etc. In doing so I split
> for.rkt into three (I couldn't handle refactoring the 1000+ lines of
> for.rkt; I needed something smaller to understand it all). Since this
> is a moderately large change I'm looking for comments/objections
> before committing. If you have objections please let me know -- if I
> don't hear any I'll commit tomorrow. Diff is attached.
>
> N.
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93


Posted on the dev mailing list.