On Sat, Dec 28 2019, Klemens Nanni <[email protected]> wrote:
> On Sat, Dec 28, 2019 at 04:07:02PM +0100, Mark Kettenis wrote:
>> Are there other ksh implementations that have this "feature"?
> MirBSD's ksh allows all three forms but treats `function name()' like
> `name()', that is $0 stays the same and will not be set to the funtion's
> name:
Bah, I think I understand why this was chosen. bash functions declared
with "function name" or "function name()" aren't special. Probably we
should do the same. I'm postponing this for now, thanks for the
feedback so far.
> $ echo $KSH_VERSION
> @(#)MIRBSD KSH R57 2019/03/01
> $ function f { echo $0; }
> $ f2() { echo $0; }
> $ function f3() { echo $0; }
> $ typeset -f
> function f {
> \echo $0
> }
> f2() {
> \echo $0
> }
> f3() {
> \echo $0
> }
> $ f
> f
> $ f2
> mksh
> $ f3
> mksh
>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE