add quickindex table to std/meta.d#4376
Conversation
|
Shouldn't this rather go into the general Phobos style guide? |
I don't know, my idea was that I didn't immediately seeing a system behind:
and a user is unlikely to read the style guide before reading the API? An alternative idea would be to split the templates into categories as for std.traits? |
|
Well, the other issue with adding that to the documentation here is that std.meta is a legacy module with inconsistent naming (even though it it has unfortunately be renamed only recently without addressing that). For example, there is no reason why |
|
(There are also |
Yeah, how about something like this:
(I left out IndexOf, as it should be deprecated.) I think [staticMap, staticSort, templateAnd, templateNot, templateOr] should all be capitalized as they all return templates. |
Do you want to be the brave and propose the deprecation? Non-Eponymous TemplatesThe names of user-defined types should be PascalCased Eponymous TemplatesTemplates which have the same name as a symbol within that template (and instantiations of that template are therefore replaced with that symbol) should be capitalized in the same way that that inner symbol would be capitalized if it weren't in a template - e.g. types should be PascalCased and values should be camelCased. |
I would, but I'm working on a Phobos proposal for an alternative to std.meta that also allows reusing a new form of ranges for sequence manipulation, and I don't want to spend time working on the "old" stuff :P |
cd769da to
0fa8062
Compare
|
@ZombineDev I rebased this PR with your table. Related PR to fix some table CSS: dlang/dlang.org#1315
It was marked as "kept for backwards compatibilty" in May 2015. As it's already marked as in the documentation as "for backwards compatibilty", I added a deprecation warning to this PR.
Looking forward to it! |
Thanks, obviously LGTM ;) |
|
Considering I embarrassingly missed the fact that there is already a std.meta.Filter and opened a PR to add it, I am all for a change that makes the names easier to see at a glance. |
|
Rebased so that issuing the deprecating warning for the deprecated IndexOf is a separate commit. |
std/meta.d
Outdated
| * $(LREF Reverse) | ||
| * $(LREF Repeat) | ||
| * )) | ||
| * $(TR $(TD Boolean operators) $(TD |
There was a problem hiding this comment.
Given that the above paragraph introduces the term "template predicates" for what these templates operate on, the category should probably refer to it somehow.
|
@klickverbot thanks for your feedback - I made a couple of changes
|
|
We are sooo close to turning this into a giant collaborative bike-shed colouring event, but I still feel I should comment on the fact that pragma(msg, staticMap!(ApplyLeft!(Repeat, 3), AliasSeq!(int, float))); |
It could be way worse. Don't be silly - your comment is very reasonable! |
|
Auto-merge toggled on |
|
Seems reasonable enough now to be a solid improvement on its own – if somebody disagrees, further tweaks can just be made as follow-up separate PRs. |
|
|
|
@ZombineDev how about a quick follow-up pr? |
Not in the narrow sense in which the term is defined in this module (see the top-level comment). You are right that they don't transform predicates into predicates, though, they apply predicates to a sequence. |
|
@klickverbot the term "template predicates" as defined in the documentation in this module does not apply to anything in this module. The only template that "takes a single argument" is |
|
|
Alright, see PR #4382 |
It seems like I am not the only one (e.g #4088) who didn't realize there was a system behind the naming in std.meta, better document it?
Ping @klickverbot