int32 vs uint32 issues with untyped language bindings

Owen Taylor otaylor at redhat.com
Tue Dec 28 14:15:44 PST 2004


On Tue, 2004-12-28 at 00:06 -0500, Havoc Pennington wrote:

> There is one possible quick fix that might help a lot: get rid of uint
> and only have int. However, that still leaves int32 vs. int64 and I
> really like having the uint types available so you can easily pass
> through uint data without worrying about some funny lossiness or
> casting. People casting uints to ints and back wouldn't help python
> either.

If you write truly native language bindings for Perl, Python, etc,
you get more cases of ambiguity ... depending on context, in Perl

 "0"

should autoconvert to byte, boolean, int32, uint32, int64, uint64,
double, string ... over half the dbus types. And the particular
way that an arbitrary Perl scalar coverts to a boolean should follow
the Perl rules. "0" is false, "" is false, "1" is true, "a" is true.

A natural binding to a  dynamically typed language can't do without 
the introspection information. 

Regards,
					Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/pipermail/dbus/attachments/20041228/203e642e/attachment.pgp


More information about the dbus mailing list