を返します。 fun 関数は False るすべてのメンバを削除し、入力 list のコピーを返します。
removeIfNot ( fun As Name, _
list As List ) As Any
引数 | [タイプ] | 説明 |
---|---|---|
fun | Name | この関数は、 boolean 戻り適用する関数の名前です。 |
list | List | テスト関数が適用される引数の list をクリックします。 |
lists の list にIntent >removeIfNot(:empty?, {{}, {:b}, {}, {:d}}) --> {{}, {}}空 lists のみを返します。 つまり、空ではないサブリストが削除されています。
Intent >removeIfNot(string?, {:a, :c, "b", :d, 3, {3}, "3", 2, 1})
--> {"b", "3"}
Function string?(item As Any) As Boolean
string? = (typeName(item) = :string)
End Function
Intent >removeIfNot(:even?, {1, 2, 3, 4, 5, 6, 7, 8})
--> {2, 4, 6, 8}
ここでは、奇数(偶数でない)項目が結果から削除されました。