Re: [AD] Export AL_VECTOR |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2008-06-18, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> On June 18, 2008, Peter Wang wrote:
> > On 2008-06-18, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> > >
> > > Without a public AL_VECTOR, I'd have to either use char** arrays, or
> > > implement my own dynamic array api just for the fs api. I find that wrong
> > > on a few levels.
> >
> > You can export an (opaque) resizable array API which is specific to the
> > fs API, and implement that using _AL_VECTOR. Would that be okay?
>
> I personally think that's still dirty. I then have to duplicate the api. then
> what happens to parts of the api that also need a resizeable array? Do they
> then duplicate the interface again?
Yes. On the plus side you can present a subset or specialised interface
of the operations that make sense, and retain type safety (which is the
main problem with a generic interface in C).
Not that I'm in favour of code duplication. Can you explain how you
plan to use the vectors in your fs API?
Peter