Skip to content

Conversation

@salano-ym
Copy link
Member

@salano-ym salano-ym commented Apr 11, 2024

What

arr.flatarr.flat_mapを追加します。

@(v: arr).flat(depth: num): arr

配列に含まれる配列を depth で指定した深さの階層まで結合した新しい配列を作成します。
depth には0以上の整数値を指定します。省略時は1になります。

@(v: arr).flat_map(func: @(item: value, index: num) { value }): arr

配列の各要素を func の返り値で置き換えた後、1階層平坦化した新しい配列を作成します。
func は非同期的に呼び出されます。

Why

Additional info (optional)

@salano-ym salano-ym self-assigned this Apr 11, 2024
@salano-ym salano-ym requested a review from FineArchs April 15, 2024 10:04
@salano-ym salano-ym mentioned this pull request Apr 15, 2024
6 tasks
@salano-ym salano-ym merged commit 44a9e4c into aiscript-dev:master May 12, 2024
@salano-ym salano-ym deleted the arr-flat branch May 13, 2024 02:07
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