From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.bugs Subject: bug#20193: 25.0.50; declarative type specification for D-Bus args Date: Fri, 27 Mar 2015 16:29:22 +0900 Message-ID: References: <87bnjgat6z.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427441426 23358 80.91.229.3 (27 Mar 2015 07:30:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2015 07:30:26 +0000 (UTC) Cc: 20193@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 27 08:30:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YbOic-000671-Nq for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Mar 2015 08:30:14 +0100 Original-Received: from localhost ([::1]:48080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbOib-000353-OA for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Mar 2015 03:30:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbOiY-00034p-PE for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 03:30:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbOiX-0007lJ-E2 for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 03:30:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbOiX-0007lE-B5 for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 03:30:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YbOiW-0003rd-Kz for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 03:30:09 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daiki Ueno Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Mar 2015 07:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20193-submit@debbugs.gnu.org id=B20193.142744136914770 (code B ref 20193); Fri, 27 Mar 2015 07:30:04 +0000 Original-Received: (at 20193) by debbugs.gnu.org; 27 Mar 2015 07:29:29 +0000 Original-Received: from localhost ([127.0.0.1]:37776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbOhs-0003q8-VB for submit@debbugs.gnu.org; Fri, 27 Mar 2015 03:29:29 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:57691 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbOhq-0003pr-O2 for 20193@debbugs.gnu.org; Fri, 27 Mar 2015 03:29:27 -0400 Original-Received: from du-a.org ([2001:e41:db5e:fb14::1]:36299 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YbOhp-0005nF-QF; Fri, 27 Mar 2015 03:29:26 -0400 In-Reply-To: <87bnjgat6z.fsf@gmx.de> (Michael Albinus's message of "Thu, 26 Mar 2015 12:34:12 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100968 Archived-At: Michael Albinus writes: > In the early design phase of dbus.el I have played with explicit > signatures for the arguments, like > > (dbus-call-method :session > "org.example.Foo" > "/org/example/Foo" > "org.example.Foo" > "Test" > :signature "a{si}" > '(("a" 1) ("b" 2))) > > which is similar to your proposal, with other means. I haven't > implemented it, because I found it to strict for Lisp developers to > think in D-Bus signatures. It has only survived for marking the type of > an empty array. > > Your proposal is closer to the developers, so it has charm. There is > also a minor difference how dict entries are expressed, but that could > be agreed. So I'm open to this, as an *alternative* option to the > existing spec. We don't want to break existing code. Certainly. Do you have any preference on the alternative form? My example used the `:type' keyword, but it was a tentative plan and might be too verbose for programmers. Reusing `:signature' might be a better idea as you mentioned (though it might be confusing with the current meaning of `:signature' as a D-Bus type "g"). >> Would this kind of change be considered? As a proof-of-concept, I'm >> attaching a small Elisp snippet that augments the argument value with >> the given type information (though I guess it should be implemented in >> the C level, to avoid duplication of signature computation code). > > IIRC, this was another reason that I haven't followed the :signature > approach - it was harder to implement in dbusbind.c. But this is years > ago, maybe my memories are wrong. > > Yes, it shall be implemented in dbusbind.c - would you like to try it? Sure. > Btw, one of your examples is wrong (or at least misleading). An empty > array must contain exactly one element of type signature. The case you > have shown here indicates, that '(:array :signature "sig") is an array > with exact one elemt, a signature. Although possible in D-Bus, this is > not possible in dbus.el (maybe a design flaw?). Your example could be > therefore changed to > > ;; (dbus--annotate-arg '(:struct :object-path (:array (:dict-entry > string :int32)) :string) > ;; '("path" nil "password")) > ;; ;=> ((:struct :object-path "path" (:array :signature "{si}") > :string "password")) > > This would require additional mapping of the type symbols to signature > strings - something what exist in dbusbind.c already. Oh, I see. Thanks for the info. Regards, -- Daiki Ueno