Comment #0 by TeddyBear12311 — 2017-03-18T14:24:59Z
when printing out a manifest constant using pragma(msg, c) the output is ugly:
[Tuple(['w', 'c', 'h', 'a', 'r'])]
The following exhibits the issue:
import std.typecons, std.string, std.conv;
enum x = [tuple(to!wstring(strip(" wchar")))];
pragma(msg, x);
enum y = [tuple(to!wstring(strip(" wchar"))~"")];
pragma(msg, y);
enum z = [tuple(to!wstring(strip(" wchar"))~""w)];
pragma(msg, z);
void main()
{
}
[Tuple(['w', 'c', 'h', 'a', 'r'])]
[Tuple("wchar")]
[Tuple("wchar")]
Maybe pragma should treat array's of wchars/chars, etc as a string. Or check if all the values are "printable" and then print it was a string.
Comment #1 by TeddyBear12311 — 2017-03-18T14:33:14Z
It might be nice also to have a reduced syntax for Tuple!(having tuples of tuples of tuples becomes quite messy and makes the strings/output very long).
instead of
[Tuple("wchar")]
we get
[{"wchar"}]
where {} are used to represent a tuple. If {} is not good enough(conflicts with something else), then <>, T{}, T(), or something similar can be used.
Comment #2 by robert.schadek — 2024-12-13T18:51:50Z