[prev in list] [next in list] [prev in thread] [next in thread]
List: racket-users
Subject: [plt-scheme] ffi equivalent of array in struct
From: dyoo () hkn ! eecs ! berkeley ! edu (Danny Yoo)
Date: 2006-04-25 6:40:41
Message-ID: Pine.LNX.4.64.0604242337030.3017 () hkn ! eecs ! berkeley ! edu
[Download RAW message or body]
> This is not a problem that should be solved by a macro. (And once you
> start going that way, it's a classic trap that keeps you from doing the
> simple thing.) If all you had was define-cstruct, then you would need a
> macro to do generate things like
>
> (define-cstruct _Foo [x1 _int] [x2 _int] ... [x100 _int])
>
> But in this case, make-cstruct-type is available, and can do something
> equivalent to that, with no need for macros at all. All you need is to
> create a list of 100 _int values, like
>
> (build-list 100 (lambda (i) _int))
*smack on head* I'm so silly sometimes, and I'm glad someone's making sure
to keep me from doing too much damage.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic