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

on basics/type-qualifiers - example's writeln output consistency - proposal #250

Closed
astoliar opened this issue Mar 27, 2018 · 2 comments
Closed

Comments

@astoliar
Copy link
Contributor

(this issues was presented at dlang-tour/spanish#23)

I think this is a small issue of consistency in the example that might confuse someone.

The example is about mutability qualifiers but also shows how to use the typeof( .. ).tostring() to obtain a human-readable string of that type. At line 18 it says:

const int* cm = &m;
writeln("cm: ", typeof(cm).stringof);

and few lines down (line 37) it says:

const int* cv = &v;
writeln("*cv: ", typeof(cv).stringof);

there is no consistency between the two sections of the example. If the first writln text is correct then the text of the second writeln should say "cv" and not "*cv". You know, the output of typeof(*cv).stringof is not the same that typeof(cv).stringof, like "*cv: const(int*)" is not the same that "cv: const(int*)".

I think that the * must be removed from the second writeln.

@wilzbach
Copy link
Member

Yes I agree that this is an oversight. I quickly submitted the PR for you: #251

@astoliar
Copy link
Contributor Author

Great. Thanks

wilzbach added a commit that referenced this issue Mar 30, 2018
Fix #250 - example's writeln output consistency
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

No branches or pull requests

2 participants