Skip to content

Update std.traits to reflect renaming of TypeTuple to AliasSeq#4954

Closed
wilzbach wants to merge 7 commits intodlang:masterfrom
wilzbach:jamadagni-remove_typetuple
Closed

Update std.traits to reflect renaming of TypeTuple to AliasSeq#4954
wilzbach wants to merge 7 commits intodlang:masterfrom
wilzbach:jamadagni-remove_typetuple

Conversation

@wilzbach
Copy link
Contributor

Revived #3756 as is (just rebased to latest Master).

… terminology

changed imports to use std.meta i.o. std.typetuple
rename names ending in "Tuple" or "List" by using plural of preceding word or replacing by Seq.
rename unclear names "Parameters" and "Fields" to refer to "Types" since we have "Identifiers" of the same also.
add deprecated tags to all aliases referring to the old names in all cases above.
add deprecated tags to the typetuple module and alias.
changed references to "function" to "callable" wherever the template was testing for isCallable.
move description of callable to "isCallable" only.
minor typo corrections.
template SharedConstOf(T) { alias SharedConstOf = shared(const(T)); }
/// ditto.
template ImmutableOf(T) { alias ImmutableOf = immutable(T) ; }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

does anyone know what @jamadagni was trying to do here?
AFAICT this change undocuments all these templates, doesn't it?

Copy link
Member

Choose a reason for hiding this comment

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

I'd say undo this change

@wilzbach
Copy link
Contributor Author

So I took #3756 as is (well apart from the necessary changes during the rebase) and started to amend my changes. The two important ones:

  • fixed compilation (thanks @tsbockman)
  • added deprecation messages and a specific date to the deprecated alias

@andralex
Copy link
Member

dat copyright year update

@andralex
Copy link
Member

What's Jenkins unhappy about?

@wilzbach
Copy link
Contributor Author

dat copyright year update

There are (a lot) more changes - you need to click on "Load diff" ;-)

What's Jenkins unhappy about?

Martin just started the project tester. However many of the projects are still broken with the current DMD / Phobos. So please ignore it for now.

Copy link
Member

@andralex andralex left a comment

Choose a reason for hiding this comment

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

This seems to be a pass that someone made through a personal project after finding a nicer naming convention. I think it breaks too many things for too little benefit.

I think some of the things can be cherry picked, e.g. name of nodes in the grammar. Looks like a long task, thanks for taking it.

* ))
* $(TR $(TD Type behaviours) $(TD
* $(LREF isAbstractClass)
* $(LREF isAbstractFunction)
* $(LREF isInstanceOf)
Copy link
Member

Choose a reason for hiding this comment

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

why did you move this? I think it was ordered alphabetically

* $(LREF isFinalClass)
* $(LREF isFinalFunction)
* $(LREF isFunctionPointer)
* $(LREF isInstanceOf)
* $(LREF isSomeFunction)
Copy link
Member

Choose a reason for hiding this comment

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

keep ordered

* $(LREF Unqual)
* $(LREF Signed)
Copy link
Member

Choose a reason for hiding this comment

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

this wasn't ordered but probably should

@@ -146,7 +146,7 @@
* Copyright: Copyright Digital Mars 2005 - 2009.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Copy link
Member

Choose a reason for hiding this comment

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

yum

@@ -146,7 +146,7 @@
* Copyright: Copyright Digital Mars 2005 - 2009.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(HTTP digitalmars.com, Walter Bright),
* Tomasz Stachowiak ($(D isExpressions)),
* Tomasz Stachowiak ($(D isExpressionSeq)),
Copy link
Member

Choose a reason for hiding this comment

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

Use backticks since you touched it?

template SharedConstOf(T) { alias SharedConstOf = shared(const(T)); }
/// ditto.
template ImmutableOf(T) { alias ImmutableOf = immutable(T) ; }

Copy link
Member

Choose a reason for hiding this comment

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

I'd say undo this change

*/
template Parameters(func...)
template ParameterTypes(func...)
Copy link
Member

Choose a reason for hiding this comment

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

Is this a breaking change?

}

@safe unittest
{
alias STC = ParameterStorageClass;
alias PSC = ParameterStorageClass;
Copy link
Member

Choose a reason for hiding this comment

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

this kind of thing seems gratuitous


// @@@DEPRECATED_2017-12@@@
deprecated("It will be removed from Phobos in December 2017. Use ParameterTypes")
alias Parameters = ParameterTypes;
Copy link
Member

Choose a reason for hiding this comment

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

this seems gratuitous

else
static assert(0, "argument has no parameters");
}

// @@@DEPRECATED_2017-12@@@
deprecated("It will be removed from Phobos in December 2017. Use ParameterTypes")
alias ParameterTypeTuple = ParameterTypes;
Copy link
Member

Choose a reason for hiding this comment

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

this seems something we can live with

@wilzbach
Copy link
Contributor Author

This seems to be a pass that someone made through a personal project after finding a nicer naming convention. I think it breaks too many things for too little benefit.

I think some of the things can be cherry picked, e.g. name of nodes in the grammar. Looks like a long task, thanks for taking it.

Okay started with the least controversial bit: triggering the deprecation warnings for std.typetuple -> #4968

@andralex
Copy link
Member

@MartinNowak - I think you should look at this.

@wilzbach
Copy link
Contributor Author

Closing this for the same reason as #4968 (not much time, no progress / consensus in sight).
However, as mentioned on the other PR I am still interested in seeing this happening, so @ D enthusiasts from the future please don't take this as a sign, that we will never clean up the mess std.typetuple, just don't give up trying ;-)

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.

4 participants