GNU bug report logs - #20193
25.0.50; declarative type specification for D-Bus args

Previous Next

Package: emacs;

Reported by: Daiki Ueno <ueno <at> gnu.org>

Date: Wed, 25 Mar 2015 03:32:01 UTC

Severity: wishlist

Found in version 25.0.50

Full log


View this message in rfc822 format

From: Daiki Ueno <ueno <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 20193 <at> debbugs.gnu.org
Subject: bug#20193: 25.0.50; declarative type specification for D-Bus args
Date: Fri, 04 Sep 2015 11:33:20 +0900
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Daiki Ueno <ueno <at> gnu.org> writes:
>
>>> For the second new test I'm not sure whether this is possible (the
>>> documentation doesn't speak about), but it looks natural to me.
>>
>> Yes, this was actually a bug because of missing checks on the number of
>> required arguments after `:type'.  Fixed as:
>> http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=scratch/dbusbind-type-tests&id=def5829c0769b142b3cc0d69a9ad58935a9f237f
>
> Well, dbus-test.el passes now, thanks. But there are still some cases
> I'm not so happy with:
>
> plist-get
>  (dbus--test-create-message-with-args
>   '(:array)
>   '(:array :signature "u")
>   :type '(:array :uint32)
>   nil)
>  :signature)
>
> |- "asauau"
>
> I would expect "asauaub"

Right, thanks for pointing that.

> Maybe you could be a little bit more verbose about, and adapt the code?
> When there is a :type argument, there must *always* be two additional
> arguments?

That makes sense.  Moreover, I personally prefer not to mix
implicit and explicit typing.  So, I am currently thinking to collect
type specifiers for all arguments as a list and put it in front of the
actual arguments, like this:

(dbus-message-internal ...
  :timeout 100
  :type '((:array :string) (:array :uint32) (:array :uint32) :boolean)
  '("a") '(1) '(2) t)

How does that sound?

> As you see, even I (who has tried to understand the new syntax) am a
> little bit confused.

Yes, I am realizing how helpful it is to write unit tests, to smoke out
such pitfalls before landing the feature :-)

Regards,
-- 
Daiki Ueno




This bug report was last modified 4 years and 322 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.