|
Boost : |
From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-02-01 22:37:18
Matthew Vogt wrote:
> Anyhow, my problem with the macro-based IDL is that it obscures the
> function signatures so badly, partly by separating the components so I
> don't recognise them as a signature, and partly by encasing them in a
> dense text block.
>
> I think that this:
>
> BOOST_IDL_BEGIN(Interface)
> BOOST_IDL_CONST_FN2(print, void, ostream&, int)
> BOOST_IDL_END(Interface)
>
> is readability-wise so far away from:
>
> struct Interface
> {
> void print(ostream&, int) const;
> };
>
> that it is an enormous hurdle for BIL to overcome.
I'm sympathetic to this point of view. The reason it doesn't seem so bad to me
is that only a relatively small part of coding with BIL is actually defining
interfaces; the code which uses the interfaces is just ordinary C++.
Do you have any suggestions for improving the macro syntax? For instance, do you
like David Abrahams's suggested syntax better:
DECLARE_INTERFACE(
Interface,
((int)(print)(ostream&)(int))
);
?
(I'm not sure where to stick 'const')
> The template-based IDL theorised in your docs seems much closer to
> what I would like:
>
> typedef interface<
> function<print, void (ostream&, int)> const
>> Interface;
>
> There doesn't seem to be much support for this in the tarball, though.
Right, there isn't any.
> Do you have any experimental code for defining these interfaces?
I've started work on it, but it doesn't work yet.
> If not, do you forsee major issues in implementing them later?
I'm sure it is theoretically correct, and am optimistic that it will work in
practice because it uses the same techniques as the macro-based approach.
However I can't say for sure that it will work until I see it.
> Thanks,
> Matt
Jonathan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk