Making generalized Trie type in D

Dmitry Olshansky dmitry.olsh at gmail.com
Mon Jun 4 15:21:41 PDT 2012


On 05.06.2012 2:06, Dmitry Olshansky wrote:
> On 05.06.2012 1:56, Roman D. Boiko wrote:
>> On Monday, 4 June 2012 at 21:39:50 UTC, Dmitry Olshansky wrote:
>>> On 05.06.2012 1:16, Roman D. Boiko wrote:
>>> I believe that once encoidng is established your compiler tool should
>>> use the best code for that encoding. And that means templates,
>>> tailored per encoding in my book.
>>> If anything I plan to use Tries on strings without decoding codepoint,
>>> just using length of it (as first stage, might need some tweak).
>> Will it be difficult to adapt your API for immutable tries? E.g., it is
>> not possible to implement immutable sequence (linked list) as a range,
>
> Linked list? I'm horrified. Though I'd need some info on where and why
> you'd need that ;)
> Despite some claims to the contrary small arrays (like e-hm 10_000
> elements) are faster in nearly all operations possible.

And you can fake immutability, buy always picking up an unused slot btw. 
No need to go beyond logical immutability.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list