aiscript icon indicating copy to clipboard operation
aiscript copied to clipboard

文字列と配列の検索系関数の拡張

Open FineArchs opened this issue 1 year ago • 1 comments

{ 文字列 / 配列 / オブジェクト } における
{ 引数と同じ値 / 検査関数がtrueを返す値 }
{
  が存在するか / の数
  / のうち{ 最初 / 最後 / n番目 }のものの{ 添字 / 値 }
  / の添字の配列
  / だけ抜き出したもの
} を返す関数

を一部除きそれぞれ実装したい

FineArchs avatar Oct 13 '23 14:10 FineArchs

文字列における引数と同じ値

  • [x] が存在するか(incl)
  • [ ] の数(count?)
  • [x] のうち最初のものの添字(index_of)
  • [ ] のうち最後のものの添字(last_index_of?)
  • [ ] のうちn番目のものの添字(nth_index_of?)
  • [x] ~のうち{ 最初 / 最後 / n番目 }のものの値~
  • [ ] の添字の配列(search?)
  • [x] ~だけ抜き出したもの~

文字列における検査関数がtrueを返す値〜

  • さすがに時間がかかり過ぎる?

配列における引数と同じ値

  • [x] が存在するか(incl)
  • [ ] の数(count?)
  • [ ] のうち最初のものの添字(index_of?)
  • [ ] のうち最後のものの添字(last_index_of?)
  • [ ] のうちn番目のものの添字(nth_index_of?)
  • [x] ~のうち{ 最初 / 最後 / n番目 }のものの値~
  • [ ] の添字の配列(search?)
  • [x] ~だけ抜き出したもの~

配列における検査関数がtrueを返す値

  • [ ] が存在するか(some?)
  • [ ] の数(countFunc?)
  • [ ] のうち最初のものの添字(find_index?)
  • [ ] のうち最後のものの添字(find_last_index?)
  • [ ] のうちn番目のものの添字(find_nth_index?)
  • [x] のうち最初のものの値(find)
  • [ ] のうち最後のものの値(find_last?)
  • [ ] のうちn番目のものの値(find_nth?)
  • [ ] の添字の配列(query?)
  • [x] だけ抜き出したもの(filter)

オブジェクトにおける引数と同じ値

  • [ ] が存在するか(incl?)
  • [ ] の数(count?)
  • [ ] のうち最初のものの添字(index_of?)
  • [ ] のうち最後のものの添字(last_index_of?)
  • [ ] のうちn番目のものの添字(nth_index_of?)
  • [x] ~のうち{ 最初 / 最後 / n番目 }のものの値~
  • [ ] の添字の配列(search?)
  • [x] ~だけ抜き出したもの~

オブジェクトにおける検査関数がtrueを返す値

  • [ ] が存在するか(some?)
  • [ ] の数(countFunc?)
  • [ ] のうち最初のものの添字(find_key?)
  • [ ] のうち最後のものの添字(find_last_key?)
  • [ ] のうちn番目のものの添字(find_nth_key?)
  • [ ] のうち最初のものの値(find?)
  • [ ] のうち最後のものの値(find_last?)
  • [ ] のうちn番目のものの値(find_nth?)
  • [ ] の添字の配列(query?)
  • [ ] だけ抜き出したもの(filter?)

FineArchs avatar Oct 13 '23 14:10 FineArchs