[Fluxus] Fwd: [racket] Interesting article
evan.raskob [lists]
lists at lowfrequency.org
Thu Aug 12 07:41:46 PDT 2010
Thought this was interesting (part of a side discussion from the racket list)
Begin forwarded message:
> From: Noel Welsh <noelwelsh at gmail.com>
> Date: 12 August 2010 14:42:09 GMT+01:00
> To: Eduardo Bellani <ebellani at gmail.com>
> Cc: Racket mailing list <users at racket-lang.org>
> Subject: Re: [racket] Interesting article
>
> I agree with most of his gripes. Addressing his points about vectors,
> I have a fairly extensive library of vectors functions on github
>
> http://github.com/noelwelsh/numeric
>
> It has the same API for vector, evector [extensible vector], and
> f64vector. It could easily be extended to flvector but I haven't yet
> had the need/time. (Nor the time to properly package it.) I regularly
> write numeric algorithms (e.g. discrete cosine transform, which I
> wrote yesterday) in a functional system using this library.
>
> The code is written using a compile-time unit system, which is well
> ...err... something.
>
> API is below in case anyone is interested.
>
> N.
>
> (define-comprehensions
> (import 'vector
> 'in-vector
> make-vector
> vector?
> vector-ref
> vector-set!
> vector-length)
> (export for/vector
> for/fold/vector
> _
> in-vector-reverse))
>
> ;;; Constructors
>
> (define-constructors
> (import make-vector
> for/vector
> in-vector
> vector-length)
> (export vector-ones
> vector-zeros
> vector-copy
> vector-reverse))
>
> ;;; Predicates
>
> (define-predicates
> (import in-vector vector-length)
> (export vector-null? vector-=))
>
> ;;; Selectors
>
> (define-selectors
> (import for/vector for/fold/vector in-vector vector-ref
> vector-length list->vector)
> (export vector-select
> vector-last
> vector-find vector-findi
> vector-find-first vector-find-firsti
> vector-slice))
>
> ;;; Mutators
>
> (define-mutators
> (import vector-ref vector-set!)
> (export vector-add1! vector-sub1!))
>
> ;;; Iterators
>
> (define-iterators
> (import for/fold/vector for/vector
> in-vector
> vector-length)
> (export vector-map vector-mapi
> vector-fold vector-foldi))
>
> ;;; General Functions
>
> (define-functions
> (import for/vector
> in-vector
> vector-set!
> vector-ref
> vector-length
> vector-find-firsti)
> (export vector* vector+ vector/ vector-
> vector*s vector/s vector+s vector-s
> vector-sum vector-product
> vector-dot
> vector-normalise
> vector-max vector-maxi vector-min vector-mini
> vector-adjoin vector-append
> vector-remove vector-remove-first vector-removei))
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20100812/ae1fdc5f/attachment-0002.htm>
More information about the Fluxus
mailing list