Skip to content

Conversation

lionello
Copy link
Contributor

These were found using the PR #2121 (issue 10236)

@monarchdodra
Copy link
Collaborator

LGTM. Most of the chnages are in std.datetime. @jmdavis , perhaps you also want to take a look?

@@ -2108,12 +2108,12 @@ assert(SysTime(DateTime(-7, 4, 5, 7, 45, 2)).day == 5);
Params:
tz = The $(D TimeZone) to set this $(D SysTime)'s time zone to.
+/
@property void timezone(immutable TimeZone timezone) pure nothrow
@property void timezone(immutable TimeZone tz) pure nothrow
Copy link

Choose a reason for hiding this comment

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

Why is this change necessary? I know it makes the internal code a little less confusing (having the function and parameter name not being named the same), but if your ddoc pull warns or errors on this style of code then I think the pull should be fixed up. People might want to write code like this without seeing any warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I had to change either the comment or the code. In this case (and a few others, in fact) I went with changing the code because I, personally, thought 'tz' was better here than 'timezone'. I thought the doc (and the code, in fact) would be confusing with the parameter having the same name of the function.

There's nothing in the patch that dictates this. It's merely my preference in this case.

Copy link

Choose a reason for hiding this comment

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

Oh ok. I'll leave it to @jmdavis then.

Copy link
Member

Choose a reason for hiding this comment

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

Well, in general, I don't want anything to be renamed just to rename it, so I'd prefer that name changes like this weren't made, but more than that, I really don't want any pulls made against std.datetime right now unless they actually need to be made, because I'm in the middle of breaking it up into separate modules, and pulls like this just make my job harder. This doesn't fix any real bugs in the code, and I'm having to go over and fix all of the documentation in std.datetime right now anyway (thanks to things having moved around). So, I'd much appreciate it if you would remove any std.datetime changes from this pull. If there are any real issues with the documentation after I'm done splitting it up, you can create a pull to fix those then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've reverted the fixes to std.datetime.

@@ -693,7 +693,7 @@ class Element : Item
* Constructs an Element from a Tag.
*
* Params:
* tag = the start or empty tag of the element.
* tag_ = the start or empty tag of the element.
*/
this(const(Tag) tag_)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, this should just be called tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't agree. The class has a member named 'tag' and it's being referenced a couple of times in this method. Forgetting one 'this.' might break the code. Adding 'this.' now is easy, but it hurts maintainability.

Copy link
Member

Choose a reason for hiding this comment

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

Personally, I think that adding the _ is ugly and that it's better to just use this, and FWIW, IIRC, Andrei agrees based on what he's said in the past about this sort of thing. Now, given that it's in std.xml, which is going to get the axe at some point, I'm not sure I care, but in general, I'm definitely against this sort of naming.

Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO, naming it tag_ is a form of implementation leak. That said, I don't want to debate naming more than that.

Also, this was the way it was before, so... it's alright if this pull doesn't address this "issue".

No problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feel free to create a PR with the fixed parameter names. It's a bit too bit of a code change to include in this one.

monarchdodra added a commit that referenced this pull request Sep 8, 2013
Fix issue 10893: added missing or renamed DDoc parameters
@monarchdodra monarchdodra merged commit 60187c9 into dlang:master Sep 8, 2013
@lionello lionello deleted the bug10893 branch September 9, 2013 01:16
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.

3 participants