Re: Changes I had to make to get langbinding to build

"Roman Yakovenko" <[email protected]>
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <[email protected]>
On 6/15/07, John Moeller <[email protected]> wrote:
> [Ok, that was just embarrassing; reposting here]
>
> Not that anyone cares about my personal status on this project, but I
> thought I'd share some progress that I made.
>
>
> 1.  I think I understand what the library does (that took a few days of
> study all in itself :) ).  The class graph stuff went over my head, but
> I'm neither familiar with BGL nor with Graph Theory in general (though
> it's probably within my reach if I spent the time).  I can see vaguely
> what its purpose is, however.
>
> 2.  I got the source building, with a new Jamfile.v2.  That didn't take
> terribly long, and I got a little more familiar with the build system.
>
> 3.  I worked on getting each test to run.
>
> 3a. I had trouble getting the holder.cpp test to build.  The override
> function object returns a proxy, and the proxy doesn't like being cast
> to an int for some reason, even though it seems to me that the
> conversion should work just fine.  I tried the pointer conversion, but
> the assertions failed.  I eventually gave up on this test, because I was
> more interested in getting the invoker class working.
>
> 3b. The tests that use the invoker class wouldn't build because they
> were using a version of fusion that was out-of-date.  After about a week
> of study, I figured out that I needed to make some fundamental changes
> to how fusion was utilized in the invoker.  I also discovered that
> fusion is very cool.
>
> It seems to me that the way things worked before was to create the
> transform view of the function arguments with the proper converters, and
> call a generate metafunction, that when constructed with a sequence
> iterator, generated a tuple with all the correct argument converters:
>
>          aux::fusion_arg_iterator arg_iterator(args);
>
>          typename fusion::meta::generate<
>              mpl::transform_view<
>                  argument_types
>                , arg_extractor<mpl::_>
>              >
>          >::type argument_converters(arg_iterator);
>
> I basically replaced meta::generate with result_of::as_list; it seems
> that this is the way that you get a type that can be instantiated with a
> sequence:
>
>          aux::fusion_arg_sequence<
>              mpl::size<argument_types>::type
>          > arg_seq(args);
>
>          typename fusion::result_of::as_list<
>              mpl::transform_view<
>                  argument_types
>                , arg_extractor<mpl::_>
>              >
>          >::type argument_converters(arg_seq);
>
> Unfortunately, list's constructor doesn't take an iterator; it takes a
> sequence, so I had to add sequence support to fusion_arg_iterator, in
> addition to modifying the iterator.
>
> The invoker-related tests pass now.  However, I wanted to be certain
> that I didn't fundamentally destroy the way that things were supposed to
> work, so that's why I'm posting what I changed.
>
> 4.  I got a test jamfile working.  All the tests use assert(), though,
> and not Boost:Test asserts.  I didn't change any of them.
>
> 5.  I got autolinking working.
>
>
> So now that I've done all that, should I get some of this into CVS?  Or
> should I post some diffs up?  If I should commit these changes to CVS, I
> think that I would need access, but I don't know if I'm supposed to have
> that.  I'm not a developer with an approved project.  (Or can I commit
> with anonymous CVS?  I've never developed using anonymous CVS.)  Either
> way, I don't really want to lose this work.
>
> Another thing; Fusion has invocation support now.  I looked into it
> briefly, and it seems that it may allow some contraction of the invoker
> code; at least, it could replace a good portion of aux::invoke.  Is this
> something that you would be interested in seeing done?  Or should it be
> left alone?

It looks like you make some good progress with the library.

Does it make sense to setup a new project and commit all changes to it?


-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.