move new-function from Seq to Collection

This commit is contained in:
Pekka Laiho 2020-12-06 21:05:04 +07:00
parent 351647944d
commit d1b412f913
2 changed files with 7 additions and 5 deletions

View File

@ -3,6 +3,12 @@ namespace MadLisp;
abstract class Collection abstract class Collection
{ {
public static function new(array $data = []): self
{
// late static binding
return new static($data);
}
protected array $data = []; protected array $data = [];
public function __construct(array $data = []) public function __construct(array $data = [])

View File

@ -3,9 +3,5 @@ namespace MadLisp;
abstract class Seq extends Collection abstract class Seq extends Collection
{ {
public static function new(array $data = []): self
{
// late static binding
return new static($data);
}
} }