2011-05-24 17:23:20 -0400, Chet Ramey:
[...]
> > Why would you put any restriction on the allowed name of a function?
[...]
> Because Posix does, and because unset without -f has to enforce the variable
> name restrictions.  (Though the language has been relaxed in the latest
> standard.)
[...]

POSIX puts restrictions on the name of functions used by
applications, but I can't see anywhere it restricting what the
shell allows.

'foo bar'() {
  baz
}

being not a valid POSIX syntax, I can't imaging POSIX forcing a
shell to do this (define a "foo bar" function) or that (return
an error message) upon reading it.

I may be wrong though, is there any specific section of the
standard you had in mind?

Note that all of pdksh, mksh, zsh (at least) allow
foo+bar() { w; } for instance
ksh93 allows foo.get() { w; }

I also find it unfortunate that bash doesn't allow

foo() bar

given that every other Bourne-like shell (including the Bourne
shell) supports it (again, it's not POSIX syntax, so bash
doesn't have to implement it, 

-- 
Stephane

Reply via email to