Re: broken oop ?
- From: "Sergio A. Kessler" <ser perio unlp edu ar>
- To: "gtk-devel-list redhat com" <gtk-devel-list redhat com>
- Subject: Re: broken oop ?
- Date: Mon, 17 May 1999 17:06:18 -0300
Elliot Lee <sopwith@redhat.com> el día Sun, 16 May 1999 17:34:25 -0400
(EDT), escribió:
>On Sat, 15 May 1999, Sergio Kessler wrote:
>
>> ok, but when you work with automated tools to make bindigs, doing
>> extra calls that are not part of the original API is, again, a
>> pain, usually you have to do it by hand.
>
>Fix the automated tools :-)
ok, joking aside, I don't think my tool is broken, it cannot translate
what is not there...
>> again, if gtk also provide accesors to _read_ (as well write) all
>> the properties, gtk would be more cleaner and will allow more changes
>> to the internal fields without breaking compatibility, and, of course,
>> it will make the life of bindings maker _much_ more easy.
>>
>> Conclusion: I'am not asking to modify gtk 1.2 (of course), I'm asking
>> that if could be possible for authors following some guidelines in
>> 1.3 that could really help us *very* much.
>>
>> For example:
>>
>> - Use gboolean for boolean fields and boolean functions.
>
>(yes yes)
>
>> - Provide accesors for reading properties.
>
>This will be really really slow compared to direct access.
C'mon Elliot...
Isn't the rigth thing to provide accesors ?
At least as macros as Miguel suggested ?
If speed i so important, then why not use internal fields for
write also, if they are so fast to read, they must be fast to
write too, no ?
Then remove all accesors and all will be good and faster.
(btw, I don't think the speed difference is so great in a
normal machine, they are no common path, so a _normal_ app
using accesors to read properties may be _marginally_ slower
than using fields directly)
>> - Try to avoid to use something like "flag : x;" wich is not
>> supported in other languajes.
>
>This should be trivial to parse in and translate into other language
>equivalents...
there is no equivalent for this in pascal, believe me.
>Something better would to have
>
>#define GTK_PUBLIC
>
>And then do stuff like
>
>typedef struct {
> GtkWidget widget;
> GTK_PUBLIC gboolean myfield, myfield2 : 1;
>} GtkMine;
no, no, no, no, no, please, remove the ": 1", *please*
(pascal don't support it, and I'm afraid neither others languajes)
btw, why gboolean is not something like enum { FALSE, TRUE} ?
About the public key, I don't think is the rigth solution, ok,
better than current, but not "The Rigth Thing To Do (tm)", and
remember, as Linus said, half solutions always found a way to
stay for a loooong time, if you gonna to do it, make it rigth.
How *I* think is right ? Suppose I'm an object:
- My fields are _mine_, and I'm the _only_ authorized to
read/write them
- You wana write one of _my_ fields ?
Ask me, then if (I want && I can) I'll do for you.
- You wana know the value of one of _my_ fields ?
Ask me, then if (I want && I can) I'll tell you.
- Don't bother me too much :)
Hey, I'm just asking for a little help for bindings makers,
it's that possible ? please ?
Sergio
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]