65 lines
1.1 KiB
PHP
65 lines
1.1 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace alveolata\term;
|
||
|
|
||
|
// require_once(DIR_ALVEOLATA . '/definitions.php');
|
||
|
require_once(DIR_ALVEOLATA . '/list/functions.php');
|
||
|
require_once(DIR_ALVEOLATA . '/term/interface.php');
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
class class_function implements interface_term
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @var string
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public $head;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @var list<interface_type>
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public $arguments;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param string $head
|
||
|
* @param list<interface_term> $arguments
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public function __construct(
|
||
|
string $head,
|
||
|
array $arguments = []
|
||
|
)
|
||
|
{
|
||
|
$this->head = $head;
|
||
|
$this->arguments = $arguments;
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @implementation
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public function clone_(
|
||
|
) : interface_term
|
||
|
{
|
||
|
return (
|
||
|
new class_function(
|
||
|
$this->head,
|
||
|
\alveolata\list_\map(
|
||
|
$this->arguments,
|
||
|
function ($argument) {return $argument->clone_();}
|
||
|
)
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|