Re: broken oop ? (example)

Elliot Lee wrote:
> On Mon, 17 May 1999, Sergio A. Kessler wrote:
> > >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 ?
> Macros may make sense...
> > >> - 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.
> Sorry, but I don't believe you.

Ouch, that's hurt.
Look, I'm in a team where the compilers _writers_ are in,
we are all working in a project involving gtk, when a field like
that is found we have to put a flag of type word and make bit 
shifts here and there to know the value of the field.
The compilers writers say that there are no other way, because
the stored in x bits is not implemented.
Now, if you know something that I or the compilers writers
don't, please, tell me.
Look below for an example...

> > no, no, no, no, no, please, remove the ": 1",  *please*
> > (pascal don't support it, and I'm afraid neither others languajes)
> You should map the concept, not how it is implemented in C, onto the
> target language. Pascal supports 'boolean' just fine, and that would be
> the appropriate mapping of 'guint flag :1'.

and how I do when I pass the object by reference (all gtk functions)
to access in the result GtkWidget the first bit of a boolean type ?

(part of GtkCombo widget)

       Pascal                             C

  entry_change_id : guint;         guint entry_change_id;
  list_change_id : guint;          guint list_change_id
  flag0 : word;                    guint value_in_list : 1;
                                   guint ok_if_empty : 1;
                                   guint case_sensitive : 1;
                                   guint use_arrows : 1;
                                   guint use_arrows_always : 1;
  current_button : guint16;        guint16 current_button;
  activate_id : guint;             guint activate_id;

then in pascal folow tons of stupid functions doing stupids
shifts around the stupid flag0, to know the stupid values
of the stupids bitfields (wich is _really_ weird).

se entiende ?  capito ?

is too bad to do:

typedef enum { 0, 1} gbit;       ??
typedef enum { FALSE, TRUE} gbit;      ??

I don't know, but if gboolean can't be used for boolean fields,
(as Tim pointed out) I think there something broken anyway, no ?

  |    Sergio A. Kessler
-O_O-  Keep working at it... you will either succeed, or become an

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]