diff --git a/src/A.php b/src/A.php index 3123a9d..f4062de 100644 --- a/src/A.php +++ b/src/A.php @@ -191,4 +191,21 @@ class A { return $values; } + static final function filter_if(&$dest, callable $cond): void { + self::ensure_narray($dest); + $dest = cl::filter_if($dest, $cond); + } + + static final function filter_z(?array $dest): void { self::filter_if($dest, [cv::class, "z"]);} + static final function filter_nz(?array $dest): void { self::filter_if($dest, [cv::class, "nz"]);} + static final function filter_n(?array $dest): void { self::filter_if($dest, [cv::class, "n"]);} + static final function filter_nn(?array $dest): void { self::filter_if($dest, [cv::class, "nn"]);} + static final function filter_t(?array $dest): void { self::filter_if($dest, [cv::class, "t"]);} + static final function filter_f(?array $dest): void { self::filter_if($dest, [cv::class, "f"]);} + static final function filter_pt(?array $dest): void { self::filter_if($dest, [cv::class, "pt"]);} + static final function filter_pf(?array $dest): void { self::filter_if($dest, [cv::class, "pf"]);} + static final function filter_equals(?array $dest, $value): void { self::filter_if($dest, cv::equals($value)); } + static final function filter_not_equals(?array $dest, $value): void { self::filter_if($dest, cv::not_equals($value)); } + static final function filter_same(?array $dest, $value): void { self::filter_if($dest, cv::same($value)); } + static final function filter_not_same(?array $dest, $value): void { self::filter_if($dest, cv::not_same($value)); } }