Skip to content

Comments

Provide references to other common names#4985

Merged
JackStouffer merged 1 commit intodlang:masterfrom
wilzbach:other-languages
Feb 16, 2017
Merged

Provide references to other common names#4985
JackStouffer merged 1 commit intodlang:masterfrom
wilzbach:other-languages

Conversation

@wilzbach
Copy link
Contributor

So I found this old discussion:

Perhaps until and find should mention takeWhile and dropWhile. It's not entirely uncommon for someone to think that there's no function in Phobos which does what they want simply because none of them have a name that they recognize as doing what they want. It's not an entirely solvable problem, but we can probably find ways to improve the situation.

So here's an attempt to make the docs a little bit nicer (and Google-friendlier) by providing a couple of reference to other common names in other languages or Phobos.

Should we maybe use a category like Other names?

joined directly without anything in between them (often called $(D flatten)
joined directly without anything in between them (often called `flatten`
in other languages).

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks a bit better IMO if you merge these two clauses, mentioning both alternate names in one go. Nothing what would make me reject this trough.

Copy link
Contributor

Choose a reason for hiding this comment

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

oops, it seems the other clause i'm talking about does not show above. It is just just below what is shown.

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 recommend setting your GH diff view to "Split":

image

Completes in $(BIGOH n) time for all other ranges.

This is similar to `drop` (and `dropRight`) in other languages.

Copy link
Contributor

Choose a reason for hiding this comment

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

Slightly misleading, since D also has a drop function. Better alternative would be to mention it's difference to drop(), and perhaps also add (if it has not already) a similar mention to description of drop().

@dukc
Copy link
Contributor

dukc commented Dec 22, 2016

All in all, I like this.

@dukc
Copy link
Contributor

dukc commented Dec 23, 2016

"often called flatten similar to interpose in other languages" instead of "often called flatten or interpose in other languages" :-P. Otherwise, looks better, in both places I commented.

@wilzbach wilzbach force-pushed the other-languages branch 3 times, most recently from 9b2c51d to bf4764f Compare December 24, 2016 07:46
@wilzbach wilzbach force-pushed the other-languages branch 2 times, most recently from 1776e7b to 3d5b736 Compare January 4, 2017 13:56
@wilzbach
Copy link
Contributor Author

wilzbach commented Jan 4, 2017

I found @nordlow's very reasonable comment at phobos-next:

argmin and argmax are very common math terms. We should add either add a doc ref or aliases for them

and thus added a mention in the docs for argmin / argmax.
Btw is anything blocking this? (this just improves the documentation pages for a couple of popular functions)

Copy link
Contributor

@JackStouffer JackStouffer left a comment

Choose a reason for hiding this comment

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

looks good minus one issue

a range primitive, the returned range will also provide that range
primitive.

See_Also: $(LREF chain) to chain values to ranges
Copy link
Contributor

Choose a reason for hiding this comment

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

A reference to itself?

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 wanted to reference only ...

@wilzbach
Copy link
Contributor Author

looks good minus one issue

Fixed & rebased.

@JackStouffer
Copy link
Contributor

Auto-merge toggled on

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