On 6 August 2012 12:50, Roland Mainz <roland.ma...@nrubsig.org> wrote:
> Hi!
>
> ----
>
> ${#.sh.match[0][@]} in ast-ksh.2012-07027 seems to count the wrong
> number of array elements if ~(E) contains (pattern1)|(pattern2) when
> either pattern1 XOR pattern2 match.
> Example:
> -- snip --
> $ ksh -c 's="a1a2a3" ; d="${s//~(E)([[:alpha:]])|([[:digit:]])/dummy}"
> ; print -v .sh.match ; printf "#.sh.match[0][@]=%d\n"
> "${#.sh.match[0][@]}"'
> (
>         (
>                 [0]=a
>                 [1]=1
>                 [2]=a
>                 [3]=2
>                 [4]=a
>                 [5]=3
>         )
>         (
>                 [0]=a
>                 [2]=a
>                 [4]=a
>         )
>         (
>                 [1]=1
>                 [3]=2
>                 [5]=3
>         )
> )
> #.sh.match[0][@]=5
> -- snip --
>
> IMO I would expect the value "6" from ${#.sh.match[0][@]} since it has
> six elements...

*sigh*

This raises again the question about QA and how stable ksh93u+ really is.

David, you might want to consider adding a SHOPT_EXPERIMENTAL build
option and only build experimental/unstable features like ~(E),
.sh.match or shell types if it is requested. Seems they are nowhere
stable enough for anything than games in the command line.

Lionel
_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to