[Omake] join function?

Aleksey Nogin nogin at metaprl.org
Sun Jan 7 09:18:50 PST 2007


On 07.01.2007 00:32, Jason Hickey wrote:

>    nonempty(l) =
>       gt($(length $l), 0)
> 
>    join(l1, l2) =
>       result[] =
>       while $(and $(nonempty $(l1)), $(nonempty $(l2)))
>          x = $(nth 0, $(l1))
>          y = $(nth 0, $(l2))
>          l1 = $(nth-tl 1, $(l1))
>          l2 = $(nth-tl 1, $(l2))
>          result[] += $x$y
>       value $(result)

I've added this (with a slight modification - GNU Make appends the
remaining "tail" of the longer list to the end of the result) to the
Pervasives.om on Subversion (0.9.8.x branch, rev. 9916).

Aleksey


More information about the Omake mailing list