Re: Pretty print struct field values

2011-04-25 Thread Andrej Mitrovic
On 4/25/11, Jacob Carlborg wrote: > I'm not sure I understand but do you want to print "properties" in this > case? Yeah.

Re: Pretty print struct field values

2011-04-25 Thread Jacob Carlborg
On 2011-04-25 18:47, Andrej Mitrovic wrote: Good idea. .tupleof seems to avoid collecting functions which is perfect. Here's a quick implementation: http://codepad.org/lSDTFd7E The only issue I have left is that the function that prints the code doesn't really know what the variable was named i

Re: Pretty print struct field values

2011-04-25 Thread Andrej Mitrovic
Good idea. .tupleof seems to avoid collecting functions which is perfect. Here's a quick implementation: http://codepad.org/lSDTFd7E The only issue I have left is that the function that prints the code doesn't really know what the variable was named in the calling code. As an alternative I could

Re: Pretty print struct field values

2011-04-25 Thread Jacob Carlborg
On 2011-04-24 23:11, Andrej Mitrovic wrote: This keeps popping up in my posts. Here's an example of printing out fields of a struct with its names: import std.stdio; void main() { struct ASIOChannelInfo { int channel; int isInput; int isActive; int

Pretty print struct field values

2011-04-24 Thread Andrej Mitrovic
This keeps popping up in my posts. Here's an example of printing out fields of a struct with its names: import std.stdio; void main() { struct ASIOChannelInfo { int channel; int isInput; int isActive; int channelGroup; int type; string name