RosettaCodeData/Task/Comma-quibbling/Maple/comma-quibbling-1.maple
2023-07-01 13:44:08 -04:00

12 lines
279 B
Text

Quibble := proc( los )
uses StringTools;
Fence( proc()
if los = [] then
""
elif numelems( los ) = 1 then
los[ 1 ]
else
cat( Join( los[ 1 .. -2 ], ", " ), " and ", los[ -1 ] )
end if
end(), "{", "}" )
end proc: