Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Greg Stark <gsstark(at)mit(dot)edu> writes:
> > There are other ways of achieving the same thing. Structs containing a union
> > for the subclass fields for example.
> Doesn't achieve the same thing, unless you mandate that every part of
> the system use the identical massively-overloaded union struct to refer
> to every node.
Are you saying it's important to preserve the ability for modules to add new
node types without notifying the rest of the code? I thought all the node
types were defined in a single header file currently anyways.
> That would (a) defeat the purpose of extensibility, and (b) make the code
> more error prone not less so (since it'd be notationally easy to refer to a
> field that's not actually present in the given node subtype).
You could use a local pointer to be preserve the existing model of a single
point where the decision is made. That could be encapsulated in a macro that
included an assertion to verify the type tag.
It would be pretty cool to have a type-safe codebase. It just seems like too
an awful lot of work for a mostly aesthetic improvement.
In response to
pgsql-hackers by date
|Next:||From: Taral||Date: 2006-04-27 19:42:35|
|Subject: Re: ANSI-strict pointer aliasing rules|
|Previous:||From: Larry Rosenman||Date: 2006-04-27 19:21:36|
|Subject: Re: Logging pg_autovacuum |