20-May-2013 12:15, deadalnix пишет:
On Monday, 20 May 2013 at 06:19:29 UTC, Jesse Phillips wrote:
Please cast your vote for std.uni at:
http://forum.dlang.org/post/zczqphzzqnxvjflle...@forum.dlang.org
Overall it looks great. I have one question l is it possible to build
tries at runtime using CTFE ?
At compile-time? The short answer is it should be possible but not quite
yet.
The long answer is:
enum myA = unicode.alphabetic.toTrie!4;
---
Error: CTFE internal error: unsupported assignment this = p
uni.d(1841): called from here:
this.data.opAssign((Uint24Array!(GcPolicy) __ctmp6762 = 0;
, __ctmp6762).this(flattened))
uni.d(6742): called from here: (InversionList!(GcPolicy)
__ctmp6477 = 0;
, __ctmp6477).this(decompressIntervals(compressed))
---
So I forgot to reduce a bug it seems (or maybe I filed it).
Another reason is that will be quite slow to compile (in the current
setting). That's why all of tables in new std.uni were precomputed by
constructing at run-time and serializing to source.
This is actualy one of things I'd love to push as a separate feature
Phobos-wide: serialization of objects to CTFE-able/mixin-able source
code. Some of these done in std.uni weren't clean enough to fit into a
public interface.
Anyway, as long as this is implementable,
this have my vote.
Second thing, it is probably too late, but let's ask anyway. Is that
possible to rename the thing as std.unicode ?
I dunno. Technically I see no problem with std.unicode except that we
have to patch old code and some ~1.5 year of painfully slow deprecation
and for what? If the chief benefit of renaming is aesthetics then I'd
rather pass. If we make it as part of restructuring of std.* that is
long overdue then I'm fine but it's a discussion in its own.
We should probably split the discussion-while-voting in a separate
thread in D.d.
--
Dmitry Olshansky