[Xcb] XML-XCB: language-neutral bit constants
Jamey Sharp
jamey at minilop.net
Tue Mar 14 15:49:11 PST 2006
On Tue, Mar 14, 2006 at 11:23:46AM -0800, Ian Osgood wrote:
> On Tue, 14 Mar 2006, Ian Osgood wrote:
> >> We should strive to be language-neutral in the protocol
> >> definitions, right?
Certainly...
> >> <op="<<"> is 1) ugly 2) repetitious
No argument there.
> >> 3) C-specific.
>
> <bit> is for addressing a bit in a word. The C idiom is (1<<n), but
> other languages name this "shl(1,n)" or have built in bit addressing
> syntax (Pascal, Modula, and Oberon's sets for instance).
But I don't think I agree with this. It's not hard to pattern-match
these cases in the existing XML. An XPath expression something like this
should do it (though my XPath is rusty):
op[@op="<<" and value[1]="1"]/value[2]
That said, your other two reasons are probably sufficient.
> >I came up with <bit bit="n"/>, which replaces:
> >
> ><op op="<<"><value>1</value><value>n</value></op>
> >
> >Unless there are objections, I'll push my changes to xproto.xml,
> >xcb.xsd, and c-client.xsl.
I assume your changes to xproto.xml involve demonstrating how to use
<bit>? It'd be good to commit that after committing the xsl/xsd changes.
> I'm adding a convenience function for one usage of the op="<<"
> tag (see above). <op> itself is unmodified. I realize that
> changing the name of operators & and << would result in
> lots of breakage in the extensions.
If there's a strong argument for changing the operator names, we can
accept multiple names for the same operator, to provide time for a
transition.
--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060314/c77a5b13/attachment.pgp
More information about the Xcb
mailing list