On Wed, 2021-12-29 at 18:34 +0000, Michael Kay mike@xxxxxxxxxxxx wrote:
>
> As Dimitre says, ($n except $a) where $n is a singleton isn't
> immediately intuitive - but intuition takes practice!
I'd be tempted to write,
function($found-so-far, $new) {
(
$found-so-far,
if (some $try in $found-so-far satisfies $try is $new)
then ()
else $new
)
}
mostly because a year from now i'll likely still understand it :)
Liam
--
Liam Quin,B https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations: B http://www.fromoldbooks.org
|