function with SH_GLOB

safreya <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <[email protected]>
Hello:

I'm reading the manual(6.3) ,about function. That says:

 > If the option SH_GLOB is set for compatibility with other shells, 
then whitespace may appear between the left and right parentheses when 
there is a single word; otherwise, the parentheses will be treated as 
forming a globbing pattern in that case.

I made my tests below:

test % zsh -f
bsd% unsetopt shglob
bsd% func1()
function> {print ok}
bsd% func2 ()
function> {print ok}
bsd% func3( )
zsh: unknown file attribute:
bsd% func4 ( )
zsh: unknown file attribute:
bsd% setopt shglob
bsd% func5()
function> {print ok}
bsd% func6 ()
function> {print ok}
bsd% func7( )
zsh: parse error near `('
bsd% func8 ( )
zsh: parse error near `('

I'm confused. When  'setopt shglob',definitions should be OK?

Now, I only know "Do not put space between ()"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.