8 hours ago, Stephan Houben wrote:
> I have code like this which dispatches on the type of a homogenous
> vector:
>
> (define (gl-vector->type vec)
>(cond
> ((bytes? vec) GL_UNSIGNED_BYTE)
> ((s8vector? vec) GL_BYTE)
> ((u16vector? vec) GL_UNSIGNED_SHORT)
> ((s16vector? vec
lang.org] On Behalf Of Thomas Chust
> Sent: 13 June 2011 17:11
> To: Stephan Houben
> Cc: Racket Users
> Subject: Re: [racket] dispatch on type
>
> 2011/6/13 Stephan Houben :
> > [...]
> > I have code like this which dispatches on
> > the type of a homogenous vec
2011/6/13 Stephan Houben :
> [...]
> I have code like this which dispatches on
> the type of a homogenous vector:
> [...]
> I was wondering if there is a more efficient way to
> do this, one which doesn't involve a linear scan
> over all possible types. I presume that at the C level
> there is a "t
Dear list,
I have code like this which dispatches on
the type of a homogenous vector:
(define (gl-vector->type vec)
(cond
((bytes? vec) GL_UNSIGNED_BYTE)
((s8vector? vec) GL_BYTE)
((u16vector? vec) GL_UNSIGNED_SHORT)
((s16vector? vec) GL_SHORT)
((u32vector? vec) GL_UNSIGNED
4 matches
Mail list logo