List Info

Thread: Proposed spec format update: Dict




Proposed spec format update: Dict<A,B>
user name
2007-10-13 09:59:13
We do not currently mark up dictionary parameter types:

Before:
       <arg direction="in"
name="aliases" type="a"/>

I propose:

       <arg direction="in"
name="aliases" type="a" 
tp:type="Dict<Contact_Handle,String"/>

This is inspired by the format we already use to describe
arrays and 
based on the syntax for templates in C++ and generics in C#.
It is 
surprisingly easy to parse recursively in XSL.

For primitive (D-Bus) types, we will use the
Telepathy_Camel_Case form 
of the names specified in the D-Bus spec:

Byte, Boolean, Int16, UInt16, Int32, UInt32, Int64, UInt64,
Float, 
Double, String, Object_Path, Signature, Variant
_______________________________________________
Telepathy mailing list
Telepathylists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy

Re: Proposed spec format update: Dict<A,B>
user name
2007-10-13 10:08:14
Alp Toker wrote:
> I propose:
> 
>        <arg direction="in"
name="aliases" type="a" 
> tp:type="Dict<Contact_Handle,String"/>

Sorry, typo there. Here's the correction.

I propose:

After:
        <arg direction="in"
name="aliases" type="a"
tp:type="Dict<Contact_Handle,String>"/>
_______________________________________________
Telepathy mailing list
Telepathylists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy

Re: Proposed spec format update: Dict<A,B>
user name
2007-10-13 10:23:08
Alp Toker wrote:
> Alp Toker wrote:
>         <arg direction="in"
name="aliases" type="a"
>
tp:type="Dict<Contact_Handle,String>"/>

The < and > of course need to be encoded as entities.

         <arg direction="in"
name="aliases" type="a"
tp:type="Dict&lt;Contact_Handle,String&gt;"
;/>

Any suggestions for a more wrist-friendly format, or shall
we go ahead
and use &lt;/&gt;?

_______________________________________________
Telepathy mailing list
Telepathylists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy

Re: Proposed spec format update: Dict<A,B>
user name
2007-10-13 10:29:43
> >         <arg direction="in"
name="aliases" type="a"
> >
tp:type="Dict<Contact_Handle,String>"/>

> The < and > of course need to be encoded as
entities.

>          <arg direction="in"
name="aliases" type="a"
>
tp:type="Dict&lt;Contact_Handle,String&gt;"
;/>

> Any suggestions for a more wrist-friendly format, or
shall we go ahead
> and use &lt;/&gt;?

Curly braces, by analogy with a ?

<arg direction="in" name="aliases"
type="a" 
tp:type="Dict{Contact_Handle,String}"/>


Jiri
-- 
Jiri Baum <jiribaum.com.au>                   http://www.baum.com.au/~
jiri
_______________________________________________
Telepathy mailing list
Telepathylists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy

Re: Proposed spec format update: Dict<A,B>
user name
2007-10-13 10:39:52
Jiri Baum wrote:
>> Any suggestions for a more wrist-friendly format,
or shall we go ahead
>> and use &lt;/&gt;?
> 
> Curly braces, by analogy with a ?
> 
> <arg direction="in"
name="aliases" type="a" 
> tp:type="Dict{Contact_Handle,String}"/>

Brilliant! Can't believe I didn't think of this 

This should be the proposed syntax.

_______________________________________________
Telepathy mailing list
Telepathylists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy

Re: Proposed spec format update: Dict<A,B>
country flaguser name
United Kingdom
2007-10-15 04:22:55
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 13 Oct 2007 at 15:59:13 +0100, Alp Toker wrote:
> This is inspired by the format we already use to
describe arrays and 
> based on the syntax for templates in C++ and generics
in C#. It is 
> surprisingly easy to parse recursively in XSL.

In the type-generating code in telepathy-glib I just name
the types of
dict we use, rather than using templates or generics - the
point of my
type-generating code was to cache GTypes so we don't need to
ask
dbus-glib to parse varargs over and over again, so using a
finite set of
types actually aligns better with this goal.

It turns out we need surprisingly few flavours of dict, so I
think this
approach is viable. I'll prepare spec patches when I get a
chance.

	Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://ww
w.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFHEzFvWSc8zVUw7HYRAlTQAJ0YZVSc+4XXIn2zxrxLyesfyu1yMACZ
AW8d
v7KzN8OTaEUoah7Sqcb4EHo=
=vD2U
-----END PGP SIGNATURE-----
_______________________________________________
Telepathy mailing list
Telepathylists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )