Improving std.regex(p)

Don nospam at nospam.com
Sun Jun 20 02:50:22 PDT 2010


Ellery Newcomer wrote:
> On 06/19/2010 10:55 PM, BCS wrote:
>> Hello Nick,
>>
>>> "BCS" <none at anon.com> wrote in message
>>> news:a6268ff154ca8ccddf1ef51e1d8 at news.digitalmars.com...
>>>
>>>> Hello Ellery,
>>>>
>>>>> Generally I think D's CT capabilities have a way to go yet before
>>>>> this would be worth tackling. E.g. how do you build a parse tree if
>>>>> pointers and classes aren't allowed in CT code?
>>>>>
>>>> You use the type system. I can say from experience that (memory
>>>> issues aside) it works.
>>>>
>>> Trivial example?
>>>
>>
>> Building an arbitrary tree:
> 
> Okay, you use structs without indirection. I guess that works. How much 
> copying does that entail when you e.g. pass your tree in a function call?

Currently CTFE uses copy-on-write. If you're just passing the tree, not 
modifying it, there's no copying. If you modify the tree, there's a 
horrific amount of copying -- this is the major CTFE bug.


More information about the Digitalmars-d mailing list