Charles Greathouse on Wed, 04 Dec 2024 19:52:29 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: setunion() on a vector of sets |
Dear Bill,Thank you for the pointer to fold().I think it'd still be beneficial (and uniform in view of other functions) to provide the syntax setunion(x,{y}).Regards,MaxOn Wed, Dec 4, 2024 at 10:03 AM Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:On Wed, Dec 04, 2024 at 09:50:39AM -0500, Max Alekseyev wrote:
> Can setunion() be extended to support a vector of arguments, like gcd() and
> other functions?
You can use fold:
? fold(setunion,[[1,2,3],[2,3,4],[4,5,6]])
%2 = [1,2,3,4,5,6]
Cheers,
Bill.