After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729269 - gvariant: Fix confusion between type and format strings in the docs
gvariant: Fix confusion between type and format strings in the docs
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-04-30 14:38 UTC by Philip Withnall
Modified: 2014-05-28 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gvariant: Fix confusion between type and format strings in the docs (1.87 KB, patch)
2014-04-30 14:38 UTC, Philip Withnall
rejected Details | Review
docs: Remove a duplicated word from the GVariant documentation (923 bytes, patch)
2014-04-30 14:58 UTC, Philip Withnall
none Details | Review
docs: Fix some minor typos in the GVariant documentation (1.80 KB, patch)
2014-05-01 13:35 UTC, Philip Withnall
committed Details | Review
Revert "gvariant: Fix confusion between type and format strings in the docs" (1.80 KB, patch)
2014-05-26 15:35 UTC, Allison Karlitskaya (desrt)
committed Details | Review
I see. The documentation could definitely be improved there, I think. How about this? Although really there should be a formal grammar somewhere instead of this prosaic description. Would you accept a patch for that? (1.97 KB, patch)
2014-05-27 14:54 UTC, Philip Withnall
accepted-commit_now Details | Review
gvariant: Clarify type and format strings in the docs (2.04 KB, patch)
2014-05-28 09:59 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2014-04-30 14:38:42 UTC
This fixes some confusion between type and format strings in the docs. I’m pretty sure the patch is right.
Comment 1 Philip Withnall 2014-04-30 14:38:44 UTC
Created attachment 275493 [details] [review]
gvariant: Fix confusion between type and format strings in the docs

‘@’ and ‘&’ are only used in format strings, not type strings.
Comment 2 Philip Withnall 2014-04-30 14:58:55 UTC
Created attachment 275495 [details] [review]
docs: Remove a duplicated word from the GVariant documentation
Comment 3 Philip Withnall 2014-05-01 13:35:02 UTC
Created attachment 275540 [details] [review]
docs: Fix some minor typos in the GVariant documentation
Comment 4 Matthias Clasen 2014-05-01 22:46:26 UTC
Review of attachment 275540 [details] [review]:

sure
Comment 5 Philip Withnall 2014-05-02 07:07:26 UTC
Thanks for the fast review. Merged to master.

Attachment 275493 [details] pushed as fca1b83 - gvariant: Fix confusion between type and format strings in the docs
Attachment 275540 [details] pushed as 361a6eb - docs: Fix some minor typos in the GVariant documentation
Comment 6 Allison Karlitskaya (desrt) 2014-05-26 15:35:09 UTC
Created attachment 277212 [details] [review]
Revert "gvariant: Fix confusion between type and format strings in the docs"

This reverts commit fca1b83be74c9840037cfee84015fd8460cc33f9.

The original documentation was correct.
Comment 7 Philip Withnall 2014-05-26 17:10:59 UTC
(In reply to comment #6)
> The original documentation was correct.

How? '@' and '&' are in the GVariant format string documentation section. They are accepted by g_variant_new() and g_variant_get(), whose documentation describes them both as taking GVariant format strings. If I call g_variant_type_new("@as") I get a critical error.

What am I missing? :-(
Comment 8 Allison Karlitskaya (desrt) 2014-05-27 06:39:50 UTC
Used as a prefix on a GVariant type string...

  "as" is the type string.  "@" is the prefix.  "@as" is the result.

This works for any type string.

The "(not a format string)" is meant to tell you that you cannot do this with arbitrary format strings.  For example, "@^as" is invalid.
Comment 9 Philip Withnall 2014-05-27 14:54:20 UTC
Created attachment 277305 [details] [review]
I see. The documentation could definitely be improved there, I think. How about this? Although really there should be a formal grammar somewhere instead of this prosaic description. Would you accept a patch for that?

gvariant: Clarify type and format strings in the docs

'@' and '&' are only used in format strings as prefixes to type
strings and not to full format strings.
Comment 10 Allison Karlitskaya (desrt) 2014-05-28 06:43:11 UTC
Review of attachment 277305 [details] [review]:

Looks good, but just repeat the text instead of making the user of '&' go hunting for '@'.

I don't think that many people would find a formal grammar to be particularly helpful, but I'm sure some would.  If you want to take the effort, I'll be happy to look it over and make sure it's correct.
Comment 11 Philip Withnall 2014-05-28 09:59:52 UTC
Created attachment 277373 [details] [review]
gvariant: Clarify type and format strings in the docs

'@' and '&' are only used in format strings as prefixes to type
strings and not to full format strings.
Comment 12 Philip Withnall 2014-05-28 10:02:07 UTC
Comment on attachment 277373 [details] [review]
gvariant: Clarify type and format strings in the docs

Sorted. I've added 'GVariant grammar' to my backlog list and will hopefully find time for it in the next few weeks. I will need to do that anyway to validate the conformance of Tartan's GVariant parser, so I might as well produce a formal grammar which can be used to generate test cases and documentation.

Attachment 277373 [details] pushed as fd9120d - gvariant: Clarify type and format strings in the docs