# \newcolumntype with optional argument

With the array package we can define a new column specifier that can be used in a tabular environment (e.g. \newcolumntype{A}[{>{\centering \arraybackslash}m{2cm}}).

It is even allowed to define a new column type with an argument like \newcolumntype{B}[1]{>{\centering \arraybackslash}m{#1}}.

Now I need to let the new colomn type argument have a default value like \newcolumntype{C}[1][2cm]{>{\centering \arraybackslash}m{#1}} but this results in a compilation error.

So I am asking if it is possible to provide a default argument to the \newcolumntype command?

MWE

\documentclass[]{article}
\usepackage{array}
\newcolumntype{A}[1]{>{\centering \arraybackslash}m{#1}}

%\newcolumntype{B}[1]{3cm]{>{\centering \arraybackslash}m{#1}}

\begin{document}
\begin{tabular}{|A{2cm}|A{4cm}|}\hline
column width = 2 cm & column width= 4cm \\\hline
hello world hello world hello world &  hello world hello world hello world\\\hline
\end{tabular}
\end{document}


You can not do that without somewhat extensive changes to the array package, adding the declaration possibility would be simple but the mechanism used to replace defined columntypes does not have anything that would help detect optional parameters, so you would have to change that mechanism, and doing that without breaking packages that depend on it (colortbl, tabularx, tabulary, ....) might be tricky.
\newcolumntype{A}[1]{>{\centering \arraybackslash}m{\if!#1!3cm\else#1\fi}}

would allow A{} to use a default width of 3cm