Repository navigation
docs(sheets): cover index-returning search functions - #15
Open
Kepler2024 wants to merge 2 commits into
Open
Kepler2024 wants to merge 2 commits into
Kepler2024 wants to merge 2 commits into
Conversation
…example
greet("Ann", greeting: "Hi") is Swift syntax and failed to compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rings Add first/last index lookups, not-found results, condition-based search and standard-library binary search (where one exists) to every English and Chinese sheet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Each sheet (English
sheets/and Chinesesheets_zh/) now covers the standard functions that return an index, inArraysandStrings:-1,ValueError,nil,None,npos)findIndex,IndexFunc,indexOfFirst,position,find_if, …)bisect,Arrays.binarySearch,lower_bound/upper_bound,slices.BinarySearch,BinarySearch,binarySearch,binary_search/partition_point). For JavaScript, TypeScript and Swift, a comment says there is none.New
CAREFUL:notes, each one run through the checker:list.index/str.indexraiseValueError.Arrays.asList(int[]).indexOffinds nothing.binarySearchon duplicates may not return the first match.strings.Indexcounts bytes.indexOfnever findsNaN.Also fixes an example in
sheets_zh/kotlin.mdthat was already broken onmain. It used Swift'sgreeting: "Hi"named-argument syntax, so the block didn't compile.Notes
findLastIndex: the checker'stsclib predates ES2023 and reports TS2550. A comment says so instead.java.mdis 1126 lines,cpp.md1116 andgo.md1110.Test plan
python3 tools/check.py sheets/<id>.mdpasses for all 10 sheetspython3 tools/check.py --no-lint --lang <id> sheets_zh/<id>.mdpasses for all 10 sheetsnpm run buildandnpm run checkpass🤖 Generated with Claude Code