-
-
Notifications
You must be signed in to change notification settings - Fork 743
New std.uni module #1347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New std.uni module #1347
Conversation
Nitpick: The undocumented function Also nitpick: Since you are bumping our Unicode version, you are introducing Title Case. This breaks a few things, as noted in this bug report: The fix is pretty trivial, if you can do it. If not, if nothing else, a TODO would be nice. |
Maybe, for the moment it's both undocumented and private. I would go for a separate pull that enables it and adds new interface for toXYZ family. Then fix capitalize, etc. Let's eat this elephant by bits and pieces :)
BTW Titlecase is not anything new, we simply neglected it for years. E.g. even 4.1 explicitly mentions titlecase!
Was broken and a we have a bugzilla entry now, so we are in a good shape ... :) |
Didn't notice it was also private. I think 6.2 introduced a lot of new code that actually made use of titlecase, as opposed to before. In any case, noted. We'll process these minor issues later. |
@braddr Excuse me for pinging, but what kind of FreeBSD these boxes are running? |
8.1 and 8.2, I believe. I'm sure neither is 9.x |
Darn.. and on 9.1 at least std.uni release/debug tests are passing. Downloading older ones. |
W00t! Looks like the new std.uni is ready to merge? Any chance of seeing this pulled anytime soon? |
@andralex poke |
Okay, looks like our patient has stabilized :) However I have bad news as it seems to uncovered a compiler bug (with release build flags). Grapheme g = decompose!T(ch);
assert(equalS(g[], r), text(g[], " vs ", r)); vs assert(equalS(decompose!T(ch)[], r), text(decompose!T(ch)[], " vs ", r)); opSlice here is taking an address of a stack-allocated temporary Grapheme and uses that to access elements. My understansding is that D guarantees that r-values survive untill full expression is evaluated (in this case CallExp). Hence both pieces of code should be equivalent. Thus I think it'd be worthwhile to compare disassembly of 2 versions. |
@braddr Any chance to get an ssh account on these FreeBSDs? I can't reproduce this ellusive segfault somewhere in jemalloc |
@@ -257,8 +257,8 @@ private: | |||
enum IR:uint { | |||
Char = 0b1_00000_00, //a character | |||
Any = 0b1_00001_00, //any character | |||
CodepointSet = 0b1_00010_00, //a most generic CodepointSet [...] | |||
Trie = 0b1_00011_00, //CodepointSet implemented as Trie | |||
CodepointSetOld = 0b1_00010_00, //a most generic CodepointSetOld [...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yet another proof that vertical alignment sucks. Please align, or (better) get rid of alignment altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, it's rather me being to hasty to do find/replace.
Among others cases like comments the ones with IR opcodes should have stayed intact too, will fix.
Why all the renames from |
Name clash of old internal CodepointSet of std.regex with the new public one from std.uni. I guess something less intrusive (now that everything is stable) is in order... renamed imports/selective imports? |
Here, now the full diff should be far simpler ;) |
I recommend marking any functions which should not be used by user code to be |
E.g. |
Good catch, these cludges should have been below |
Do you think by any chance |
Absolutely. That is going to happen once I tackled the following: |
P.S. there's an unfortunate thing about
500 is basically a hardcoded number of max recursive instantiations. It's just something to keep in mind. I'm not sure if this can be written in a simpler way to avoid many template instances. |
About |
Well, let's not forget these are static iterations... If you iterate 500 On Fri, Jul 5, 2013 at 11:40 AM, Dmitry Olshansky
|
Funnly here is my //generate code for TypeTuple(S, S+1, S+2, ... E)
@system string ctGenSeq(int S, int E)
{
string s = "alias TypeTuple!(";
if(S < E)
s ~= to!string(S);
for(int i = S+1; i < E;i++)
{
s ~= ", ";
s ~= to!string(i);
}
return s ~") Sequence;";
}
//alias to TypeTuple(S, S+1, S+2, ... E)
template Sequence(int S, int E)
{
mixin(ctGenSeq(S,E));
} No extra templates but some costly CTFE. Anyway I think it's safe to put aside this matter for a separate ER/pull pair. |
Rebased. Anything else preventing the merge? As per recent pull for std.string Poured in some work to let DMD also get decent performance (even w/o inlining) otherwise debug builds would take a horrible performance hit. O.T. I've found an interesting issue about inlining is that |
Update: seems like I failed the first time, wierd. Anyway now finally all green. |
So that's it? This is pulled? MOST AWESOME. Congratulations. This warrants someone making an announcement on the boards (and a party!) |
Woohoo!!! Finally!!! Congrats to all involved, this is definitely a big step for Phobos. |
Cool, thanks @jmdavis ! |
A regression was reported for this pull request: |
Second attempt to fold it in after review.
Of things new:
Still unknown: