protected function libIndex($args)
{
list($list, $value) = $args;
if ($value[0] === Type::T_MAP) {
return static::$null;
}
if ($list[0] === Type::T_MAP || $list[0] === Type::T_STRING || $list[0] === Type::T_KEYWORD || $list[0] === Type::T_INTERPOLATE) {
$list = $this->coerceList($list, ' ');
}
if ($list[0] !== Type::T_LIST) {
return static::$null;
}
$values = [];
foreach ($list[2] as $item) {
$values[] = $this->normalizeValue($item);
}
$key = array_search($this->normalizeValue($value), $values);
return false === $key ? static::$null : $key + 1;
}