[Gambas-devel] gb.api new version and documentation
daniel.campos at ...103...
Wed May 11 14:26:04 CEST 2005
I've updated the gb.api component, examples and documentation:
1) The "ApiPointer" class exists no more. Instead pointers are managed
with the "Integer" or "Pointer" data type, so it wastes less memory per
each pointer defined. However, a static class called "Pointer" provides
functions to manage memory easily. I think it is much more clear and
using the READ and WRITE functions. Now the memory allocations and
freeings can be made using the Alloc and Free methods from Gambas.
The "Pointer" class still provides the "AllocString" method to help in
2) I've updated the documentation, adding the Structure and Callback
It is updated in English and Spanish, but I'd need help from the French
translations to update these versions (and of course, to be part of my
little "Hall of Fame" :-))
Please be careful when translating, as the "Pointer" part as changed a
lot and there are
little changes everywhere.
3) I think Gambas could keep into its core the "Pointer" alias, the
"Free", "Alloc" and "Realloc"
methods, and let the rest of the code in a component:
(a) All this code is needed just for very specific applications
(b) Having the declarations in a component, declarations can be
deleted from memory if not needed, saving memory.
(c)I think is better also to use the "Api" class and the unknown method,
as, for example, a line of code like this:
is more coherent with an object oriented language than simply a
"misterious" new method
The first one represents an object and a function related with the API,
the second one makes difficult to a programmer to know where this new
"Gambas function" comes from when reading code written by other people.
(d) and "psicologically", having it in a component probably will prevent
to use that feature for everything without stopping to think a little if
all can be done without having to use external libraries.
4) All the new stuff is placed at: http://gambas.gnulinex.org/api
More information about the Devel