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

Add idxmin() and idxmax() #12976

Closed
wants to merge 4 commits into from
Closed

Add idxmin() and idxmax() #12976

wants to merge 4 commits into from

Conversation

facorazza
Copy link
Contributor

These are two procedures that return the index of the corresponding minimum and maximum value

@facorazza facorazza closed this Dec 27, 2019
@facorazza facorazza reopened this Dec 27, 2019
@@ -390,6 +390,7 @@ proc `[]=`*(p: var MultipartData, name: string,

proc format(p: MultipartData): tuple[contentType, body: string] =
if p == nil or p.content.len == 0:

Copy link
Member

Choose a reason for hiding this comment

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

unrelated change please remove from this PR

@cooldome
Copy link
Member

The aim is to keep system.nim lean.
sequtils module is more suitable for these functions.

@juancarlospaco
Copy link
Collaborator

This should be moved to sequtils.
The return type should be Natural, then you can remove result = 0.

@cooldome
Copy link
Member

Yep, return type is incorrect. Plus tests are required.

@SolitudeSF
Copy link
Contributor

this doesn't work for arrays with non-zero starting index.

@disruptek
Copy link
Contributor

I think this is too trivial and not useful enough to jump into stdlib. It would need a .since. and a ChangeLog entry, also.

@facorazza facorazza closed this Dec 30, 2019
@facorazza facorazza mentioned this pull request Dec 31, 2019
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.

5 participants