[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: x < y < z
- From: Alex Queiroz <asandroq@...>
- Date: Fri, 17 Jul 2015 15:43:53 +0200
On 17 July 2015 at 13:06, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>
> APL has an operator "scan" over arrays so that
>
> fct / x
>
> returns the value of a function that can be coded in Lua as
>
> function scan(fct,x)
> result = unit(fct)
> for _,v in ipairs(x) do result = fct(result,v) end
> return result
> end
>
https://en.wikipedia.org/wiki/Fold_(higher-order_function)
--
-alex
http://unendli.ch/