mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-12-28 17:08:55 +00:00
move new-function from Seq to Collection
This commit is contained in:
parent
351647944d
commit
d1b412f913
@ -3,6 +3,12 @@ namespace MadLisp;
|
||||
|
||||
abstract class Collection
|
||||
{
|
||||
public static function new(array $data = []): self
|
||||
{
|
||||
// late static binding
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
protected array $data = [];
|
||||
|
||||
public function __construct(array $data = [])
|
||||
|
@ -3,9 +3,5 @@ namespace MadLisp;
|
||||
|
||||
abstract class Seq extends Collection
|
||||
{
|
||||
public static function new(array $data = []): self
|
||||
{
|
||||
// late static binding
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user