int32 vs uint32 issues with untyped language bindings

Havoc Pennington hp at redhat.com
Tue Dec 28 22:39:39 PST 2004


On Tue, 2004-12-28 at 17:15 -0500, Owen Taylor wrote:
> 
> 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.

Good point, that's a final tough-to-argue-with nail in the coffin of
doing type conversion in libdbus - it's not really helpful to do type
conversion according to some random dbus rules, type conversion needs to
be done according to binding-specific rules.

Havoc




More information about the dbus mailing list