Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 4/8] CodingGuidelines: give an example for control statements

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:00:57

David Kastrup [off-list ref] writes:
quoted
  - We do not write the noiseword "function" in front of shell
s/noiseword/bashism/
That is outside the scope of this patch, but since you brought it
up...

I did consider between noiseword and bashism when I wrote this part,
and decided against "bashism".  XCU 2.4 "Reserved Words" lists it
(among others) and says

    ... may be recognized as reserved words on some implementations
    ... causing unspecified results

Even if "bash" were not the only shell that uses "function" keyword
to introduce a shell function definition, we wouldn't use it.  As we
say in the introductory part, we may say "It is not in POSIX, but it
is supported so widely and using it give us so great a benefit, so
we do use it" for some things, but "function" is not one of them.

The reason is because it is a noiseword and its use is not necessary
in order to define a shell function.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help