Question: how to convert a list or a set to expression sequence?

It is annoying that some functions in Maple wants input like (a,b,c,.....) which represents numbers, and I am not able to find how to use such a function, because the list of numbers I have are in a list.

For example, ilcm and igcd.  This is not a good design. The input should have been a list or set, or vector, etc.... 

I wanted to find least common multiplier of a list of numbers. These numbers are allready in a list, since this is a result of a computation done earlier. Now I want to find ilcm of them. 

How to use ilcm in this case? How to unpack them to make ilcm happy? In Mathematica there a special function to do this, called Sequence, which takes a list and unpack it to call function. 

But I am not able to find one in Maple. There is no convert(list,exprseq). 

Here is a MWE

v:=[2,4,7];
ilcm( v ); #does not work, since ilcm does not accept a list

The variable v above has to be in a list (or set, or vector). This is result from another computation. This is all done non-interactive. 

So I am looking for some magic function to use it like this

v:=[2,4,7];
ilcm( convert_to_expression_sequence(v) )

Is there a way to unpack or convert list to expression sequence, so I can use ilcm?

This is my attempt. But I suspect there is a build-in way in Maple to do this which I have not found yet.

restart;

convert_list_to_exprsequence:=proc(L::list)::exprseq;
local r:=NULL,item;

for item in L do
    r:=r,item;
od;

return r;
end proc:

v:=[2,4,7];
ilcm(convert_list_to_exprsequence(v)); #now it works

                  #28

Maple 2020.1

Please Wait...