elfring
(Markus Elfring)
December 9, 2020, 9:46am
#1
I became curious again to improve the software situation another bit around the usage of “maybe” containers.
Would you like to add any information to related feature requests?
See also further information sources:
Description for the GVariant type system
Constructing an empty maybe GVariant object based on a previous GVariant object
Support for “maybe” containers (nullable data types)
pwithnall
(Philip Withnall)
December 9, 2020, 10:03am
#2
The feature request that Markus is talking about is this one: https://gitlab.gnome.org/GNOME/glib/-/issues/2267
2 Likes
arnaudb
(Arnaud B.)
December 9, 2020, 11:15am
#3
I’m quite sure that would be useful somewhere in Dconf Editor, as it’s a place where GVariant are used and abused in every way possible. But that should not exactly count as a proof the method would be useful in everyday cases.
elfring
(Markus Elfring)
December 9, 2020, 11:38am
#4
But that should not exactly count as a proof the method would be useful in everyday cases.
Such a view is fine.
I imagine that empty GVariant maybe objects will occasionally be needed in data models.
zbrown
(Zander Brown)
December 9, 2020, 4:22pm
#5
In general I see the benefits of “maybe” types but in GVariant it’s kinda nasty given they are incompatible with dbus
1 Like
elfring
(Markus Elfring)
December 10, 2020, 7:24am
#6
Do software development challenges need further clarification according to D-Bus applications?
zbrown
(Zander Brown)
December 10, 2020, 9:30am
#7
Honestly no idea what your saying here
zbrown
(Zander Brown)
December 10, 2020, 9:54am
#9
Potentially - You could use the wrap-in-array trick but that’s adding slightly magic behaviour and other dbus clients won’t desugar it (in fact I’m not sure gio could safely either?)
Off-topic really
Yes I’m well aware of NULL
elfring
(Markus Elfring)
December 10, 2020, 10:11am
#10
How does such a view fit to the type code “109 (ASCII ‘m’)” in the summary of D-Bus types ?
zbrown
(Zander Brown)
December 10, 2020, 10:17am
#11
So the definition is “nothing at all, but maybe one day do whatever GLib does - until then it’s invalid”
Thus whatever GVariant does, even if incompatible with previous versions GLib releases, is fully compliant with the spec
elfring
(Markus Elfring)
December 10, 2020, 10:24am
#12
system
(system)
Closed
December 24, 2020, 10:28am
#13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.