Re: Immutable struct fields

2010-11-01 Thread Dmitry Olshansky
On 02.11.2010 0:24, bearophile wrote: To answer the recent D.learn thread "How would I optimize this parser?", I have tried to find a more efficient way to build the parse tree, so I have used tagged structs, something like this: enum NodeType { node, text, tag } struct Node { /*immutab

Immutable struct fields

2010-11-01 Thread bearophile
To answer the recent D.learn thread "How would I optimize this parser?", I have tried to find a more efficient way to build the parse tree, so I have used tagged structs, something like this: enum NodeType { node, text, tag } struct Node { /*immutable*/ NodeType type = NodeType.node; N