On Sat, 2001-11-24 at 15:56, Derek Atkins wrote: > Dave Peticolas <[EMAIL PROTECTED]> writes: > > > The query<->scm conversion routines in engine-helpers.c uses > > that enum. But if they change to strings, the obvious solution > > would be to use the strings themselves as part of the encoding. > > > > dave > > GRF... I think changing them to strings would inherit > too much overhead. In particular, switch statements > would turn into a long if (!strcmp()) {} else if (!strcmp()) {}... > One would think that all those strcmps would be a lot of extra > overhead compared to the switch().
With extendable types, switch statements would have to mostly go away, since they imply a fixed number of types. I think we would use hash tables instead, which at least gives you only about one strcmp. > Instead, I think I just want to use a guint32 and let modules > choose their own (unique) type-value (as opposed to their > own unique type-string). > > Do you have a preference of strings vs. integers? I think we should either have strings or dynamically-assigned integers like the gtk type system uses. Statically-assigned integers are not so nice, unless they are mechanically assigned like an enum. Personally, I prefer strings. dave
msg01609/pgp00000.pgp
Description: PGP signature