[fetter-devel] Possible solution for multiple includes

Andy Cristina acristin at gmail.com
Fri Oct 7 14:35:00 UTC 2005


On 10/7/05, Kenny Tilton <ktilton at nyc.rr.com> wrote:
> I have joked before about the downside of generating bindings only for
> symbols mentioned in include files actually listed in a binding
> definition, as opposed to files reached via nested includes: large
> libraries customarily break their apis up into multiple includes, so
> these have to be listed in the binding definition to get bindings generated.
>
> I just ran into an egregious case of this as I look to see if vzn can
> handle wxWidgets:
> <many headers>
>
> <g>
>
> Well, it is not that hard to paste the same list into a binding
> defintion, but it occurred to me that there is a natural solution to
> this minor annoyance. What if vzn generated bindings for any include
> found in the same directory tree as any listed include?
>
> There is a gotcha here, perhaps. I gave up fighting VC++ at one point
> and just copied the headers for a package into /vc++/vc98/include. So
> one would now be back to pulling in every symbol ala windows.h. But! In
> this case, the source all includes "wx/wx....h", so I will be creating a
> "wx" subdirectory under the vc++ include directory, and the scheme I
> propose would thus work.
>
> But! number two is that maybe I gave up too fast on vc++. It does allow
> specification of other search paths for includes. I tried that without
> success on something or other, but probably that could have been made to
> work, and again this scheme would hold up.
>
> I have not thought this through exhaustively. Can anyone see an
> objection? Obviously the big one would be: vzn cannot see the paths! Can it?
>

Please PLEASE make this an option in the binding if you go this route.
 Creating a binding file isn't something you do very often, and I
think spending the time to list every header you want included isn't
that high a cost. Especially if you've commited to a library that
would make you do the same thing in a C program.  If it is really a
problem, why not allow something like (include "wx/*.h") ?  That way
you don't do something that smells bad just to avoid typing.  Or
perhaps we can have a vzn utilities package that can make bindings for
libraries... maybe put a fancy gui on it, point it at a directory, and
it can give you a list control to select which headers to bind.  I
haven't really thought this out; I have been awake a very short time
and don't really have the ability to hold a thought for more than a
minute or so.  But the idea of silently including things smells really
bad to me.

My two cents,
Andy



More information about the fetter-devel mailing list