Skip to content
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

std.conv: clean imports & parse (null and bool) fix #2667

Merged
merged 2 commits into from Nov 11, 2014
Merged

std.conv: clean imports & parse (null and bool) fix #2667

merged 2 commits into from Nov 11, 2014

Conversation

9il
Copy link
Member

@9il 9il commented Nov 8, 2014

@quickfur
Copy link
Member

Can we temporarily take out the changes to format and merge the other stuff in first? I'd like to get this PR in sooner rather than later, and don't really feel like waiting just because we haven't decided what to do with std.string.format yet.

@9il
Copy link
Member Author

9il commented Nov 11, 2014

A am not alone :-)

       ///phobos / std / digest / digest.d
        body
        {
            enum string msg = "Buffer needs to be at least " ~ digestLength!(T).stringof ~ " bytes " ~
                "big, check " ~ typeof(this).stringof ~ ".length!";
            asArray!(digestLength!T)(buf, msg) = _digest.finish();
            return buf[0 .. digestLength!T];
        }

@9il
Copy link
Member Author

9il commented Nov 11, 2014

std.conv and std.format are extensively used in CTFE.
Those code should be tiny for faster compilation of other projects including phobos.

@quickfur
Copy link
Member

I'm pretty sure that code was from before std.format became CTFE-able. Quite a bit of effort was bit into making format CTFE-able. As @Dicebot said elsewhere, if there's a complexity issue with format, we should fix format instead of throwing it out and going back to IMO inferior ways of doing the same thing.

fix parse for null and bool

1. Allow parse nulls from input range
2. Remove slow (unicode like) version of parse for bools.
3. Range version of parse for bools is used.

revert some changes

remove some changes

remove few changes
@9il
Copy link
Member Author

9il commented Nov 11, 2014

@quickfur I gave up :-)
All format removals removed. Rebesed.

@9il 9il changed the title std.conv: clean imports std.conv: clean imports & parse (null and bool) fix Nov 11, 2014
// string to bool conversions
Target parse(Target, Source)(ref Source s)
if (isExactSomeString!Source &&
is(Unqual!Target == bool))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this removal?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is slower then common function for input range of dchar. See line 1840.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

@mihails-strasuns
Copy link

LGTM, thanks!

@mihails-strasuns
Copy link

Auto-merge toggled on

mihails-strasuns pushed a commit that referenced this pull request Nov 11, 2014
std.conv: clean imports & parse (null and bool) fix
@mihails-strasuns mihails-strasuns merged commit c0028b4 into dlang:master Nov 11, 2014
@quickfur
Copy link
Member

Hmm. Not sure if it's this PR, or something else, that just broke the druntime tests. :-(

@mihails-strasuns
Copy link

How can phobos PR possibly break druntime tests?

@9il 9il deleted the conv branch November 11, 2014 21:18
@quickfur
Copy link
Member

You're right, what was I thinking. Nevermind what I said.

mouth.open();
mouth.insert(foot);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants