<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I started work on some for a research project last year. You can
download them at <a
href="https://coderanger.net/svn/school/2007/fall/spacefortress/trunk/dbus-lisp/">https://coderanger.net/svn/school/2007/fall/spacefortress/trunk/dbus-lisp/</a>.
You will need CFFI and closer-mop, but both are available via asdf-install.
Look at the test* scripts to see examples.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>--Noah<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
dbus-bounces@lists.freedesktop.org [mailto:dbus-bounces@lists.freedesktop.org] <b>On
Behalf Of </b>Gustavo<br>
<b>Sent:</b> Wednesday, May 28, 2008 10:11 AM<br>
<b>To:</b> DBus Lista de Discussão<br>
<b>Subject:</b> Common-Lisp bindings<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Hello, everyone,<br>
<br>
I program in Common-Lisp and there is no binding to this library, so I decided
to create one! I've already started to create bindings for the library with
some Lisp abstractions, and when I finish I will create a wrapper to make these
bindings look just like it was a built-in Common-Lisp library! But there are
somethings I'd like to talk about before starting this second step.<br>
<br>
First, I would like not to deal with addresses and to give the user the
possibility to disconnect and reconnect, so it seems that the right choice is
use dbus_bus_get_private and setting dbus_bus_set_exit_on_disconnect(conn, 0),
right? I am asking because the documentation says that the get_private should
be avoided because multiple connections are slow but I probably won't use more
than one connection at the same time, so I guess it has no problems to use this
function...<br>
<br>
Second, dbus supports many types, but Common-Lisp has much more! Common-Lisp
also supports optional and endless parameters for functions. So these values:<br>
- hash-tables with compose keys (like lists or so)<br>
- (heterogeneous) lists (which could be confusing with also heterogeneous
arrays)<br>
- symbols and keywords (both are similar enough to be colapsed to the same type
in a protocol like this one)<br>
- object instances and structures (same as before)<br>
- limitless integers<br>
- rationals<br>
- complex numbers<br>
- functions<br>
- pathnames (for portability issues)<br>
(perhaps other things that I don't remember)<br>
<br>
I was thinking that a good idea was to distingüish the result of the method
call org.freedesktop.DBus.Introspection.Instrospect for other common-lisps
clients (or whoever requests throw DBus this distinct introspection) and for
other regular programs. <br>
<br>
So, for instance, when sending a list, an array to some regular program it
would be transformed into an array before the transmition, while, for
common-lisp clients, a list would be sent as '(av)' while an array would be
sent as 'av'. A rational could have the signature '(ii)' and a complex '((vv))'
(since a complex accepts two rationals, two integers or two floats). Endless
integers could be sent as strings or arrays but with different notations than
regular strings and arrays.<br>
<br>
Is sending diferent introspections and method returns to different clients ok
or does this violate some rule of the protocol? Or maybe this is not a good
practice? Another idea would be to always transmit the same instrospection and
let program deal with it (a program in C, for instance, would be obligated to
transform, by hand, '(av) into 'av', which is ok to me (C is already confuse
anyway) but C or Java programmers might not like to deal with this resolution.<br>
<br>
Third, a protocol extension idea: there could be a header option informing
something like &quot;oh, whenever you see '(av)' you can transform it into 'av'
if you like&quot; (an array of struct of two type signatures), to deal with the
previous issue in a more portable way. Perhaps another field telling which
internal data representation protocol or whatever this message is
&quot;encoded&quot; in. What do you think? This could be a not good idea since
the protocol supports so many types just to not to have to deals with these
issues.<br>
<br>
Well, this is it. Sorry for the very long message.<br>
Gustavo<o:p></o:p></p>

</div>

</body>

</html>