logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: int32 vs uint32 issues with untyped language bindings: msg#00047

Subject: Re: int32 vs uint32 issues with untyped language bindings
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

Attachment: signature.asc
Description: This is a digitally signed message part


<Prev in Thread] Current Thread [Next in Thread>