Thanks to visit codestin.com
Credit goes to github.com

Skip to content

2.071 updates#222

Merged
Jebbs merged 2 commits intomasterfrom
2.071-Updates
Apr 19, 2016
Merged

2.071 updates#222
Jebbs merged 2 commits intomasterfrom
2.071-Updates

Conversation

@Jebbs
Copy link
Owner

@Jebbs Jebbs commented Apr 15, 2016

This let's you use the most recent compiler for DSFML.

Fixes #219

import dsfml.system.string;
sfWindow_createFromHandle(sfPtr, handle, settings.depthBits,settings.stencilBits, settings.antialiasingLevel, settings.majorVersion, settings.minorVersion);
err.write(toString(sfErr_getOutput()));
err.write(dsfml.system.string.toString(sfErr_getOutput()));
Copy link

Choose a reason for hiding this comment

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

Why do you need import dsfml.system.string?

Copy link
Owner Author

@Jebbs Jebbs Apr 15, 2016

Choose a reason for hiding this comment

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

So that I don't have to import anything from the standard library.

dsfml.system.string.toString is specific to C strings and its only job is to convert them to a D styled string.

edit:
You still need to import the module. I only explicitly wrote dsfml.system.string.toString because otherwise it uses Object.toString which is what broke the code previously.

Copy link

Choose a reason for hiding this comment

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

Have you tried to import dsfml.system.string : toString? Or do need something else from that module?

Copy link
Owner Author

Choose a reason for hiding this comment

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

That wouldn't help. Based on the new rules, the compiler will attempt to look up symbols locally before checking imported modules, even modules that are imported in the same scope. It will always find Object.toString first, so we have to be explicit.

Does import module : symbol only import the one symbol now? I was under the assumption that it still imported the whole module.

Copy link

Choose a reason for hiding this comment

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

Does import module : symbol only import the one symbol now? I was under the assumption that it still imported the whole module.

I was under impression that it always imported only the selected symbols.

Copy link

Choose a reason for hiding this comment

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

You still need to import the module. I only explicitly wrote dsfml.system.string.toString because otherwise it uses Object.toString which is what broke the code previously.

It will always find Object.toString first

I'm trying to construct the smallest possible code to reproduce this. But it works either way. Though, I don't use extern(C).

Copy link
Owner Author

Choose a reason for hiding this comment

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

I was under impression that it always imported only the selected symbols.

As I understand it, the compiler lets you use only those symbols as part of the import system, but it does actually import the entire module.

@Jebbs Jebbs merged commit 208ca64 into master Apr 19, 2016
@Jebbs Jebbs deleted the 2.071-Updates branch April 19, 2016 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments