Better named tuple support?

Rainer Schuetze via Digitalmars-d-ide digitalmars-d-ide at puremagic.com
Tue Apr 18 00:02:29 PDT 2017



On 17.04.2017 01:43, Jethro wrote:
> On Sunday, 16 April 2017 at 21:00:59 UTC, Jethro wrote:
>> Debugging tuples is pretty hard to decypher. Instead of using
>> _expand_field, could it be possible to display the names of the fields
>> of they exist?
>>
>> After all, the type is listed with the names so it should be easy to
>> get them from the type string and just replace the displayed
>> _expand_field with them.
>
> Also, when displaying the value in watches, it would be nice to not show
> the field name, they take up so much room that one can't really see much
> of the tuple, specially with nested values.
>
> {__expand_field_0="A", __expand_field_1={__expand_field_0="B",
> __expand_field_1=0}, ...}
>
> Instead
>
> {"A", {"B", 0}, ...}
>
> It's much more concise and is not confusing at all.
>
>

Yeah, having an option to hide the field names makes sense. It can help 
with any struct, not only tuples.

Extracting the names of the fields from the template type string is a 
bit more involved and very much specialized to the implementation of 
Tuple. Maybe a VS visualizer works, but I suspect it needs some 
visualizer macro system in mago.


More information about the Digitalmars-d-ide mailing list