* Re: PATCH: Re: Open bugs and questions?
@ 2000-08-02 10:28 Sven Wischnowsky
2000-08-02 11:43 ` patterns in subscripts Andrej Borsenkow
0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 2000-08-02 10:28 UTC (permalink / raw)
To: zsh-workers
Peter Stephenson wrote:
> > % let "$foo[(I)(|\([^\)]#\))-bar(|[-+=])(|\[[^]]\])(|:*)]"
> > zsh: bad math expression: operand expected at `)(|:*)]'
> > % (( $foo[(I)(|\([^\)]#\))-bar(|[-+=])(|\[[^]]\])(|:*)] ))
> > zsh: command not found: )(|:*)]
>
> % pat='(|\([^\)]#\))-bar(|[-+=])(|\[[^\]]\])(|:*)'
> % (( $foo[(I)$~pat] ))
>
> I haven't tried this out because out of context I haven't the smallest idea
> what it's supposed to be doing.
Yes, I know. I wanted to avoid introducing an extra parameter just for
the pattern.
It's used to test if one of the options found in the --help output has
a description in the user specified specs. I.e. the pattern should
match option specs.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 2+ messages in thread
* patterns in subscripts
2000-08-02 10:28 PATCH: Re: Open bugs and questions? Sven Wischnowsky
@ 2000-08-02 11:43 ` Andrej Borsenkow
0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 2000-08-02 11:43 UTC (permalink / raw)
To: zsh-workers
>
> Yes, I know. I wanted to avoid introducing an extra parameter just for
> the pattern.
>
there is something fishy.
bor@itsrm2% typeset -A foo
bor@itsrm2% foo[bar]=baz
bor@itsrm2% foo[bar1]=baz1
bor@itsrm2% print ${foo[(I)*]}
bar1 bar
bor@itsrm2% print ${foo[(I)bar*]}
bar1 bar
bor@itsrm2% print ${foo[(I)bar*~bar?]}
bar
bor@itsrm2% print ${foo[(I)bar?#]}
bar1 bar
bor@itsrm2% print ${foo[(I)bar?##]}
BUG: ?# did not get optimized to *
BUG: ?# did not get optimized to *
bor@itsrm2% foo[bar\]]=baz\]
zsh: not an identifier: foo[bar\]]
bor@itsrm2% foo[bar\\]]=baz\]
zsh: command not found: foo[bar\]]=baz]
bor@itsrm2% foo[bar\\\]]=baz\]
zsh: not an identifier: foo[bar\\\]]
Must key always be identifier?
-andrej
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-08-02 11:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-02 10:28 PATCH: Re: Open bugs and questions? Sven Wischnowsky
2000-08-02 11:43 ` patterns in subscripts Andrej Borsenkow
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).