Yeah I didn't really consider ksh's "backward compatible" function syntax in my post because using that form while looking for better support for function libraries would be a needless handicap. You don't even get local variables with the backward-compatible syntax, so there's no hope of getting around issues like nameref collision.
Indeed, much of what I had to say about returning values from functions was on your site. I included the information mainly to provide some context to the feature request. ----- Original Message ----- From: "Greg Wooledge" <wool...@eeg.ccf.org> To:"bug-bash" <bug-bash@gnu.org> Cc: Sent:Wed, 14 Jun 2017 12:18:15 -0400 Subject:Re: RFE: Fix the name collision issues and typing issues with namerefs, improve various issues for function libraries On Wed, Jun 14, 2017 at 12:04:35PM -0400, tetsu...@scope-eye.net wrote: > So first off, the circular reference problem with "declare -n" > apparently doesn't exist in Korn Shell: If you "typeset -n x=$1", and > $1 is "x", it's not a circular reference. Korn shell actually has two different *kinds* of functions. ... If you declare using: function foo { ...; } Then it works as you described. ... > Regarding return values, there's a couple ways of looking at this: > [...] You're retracing a lot of the ground I've already covered in the last few years. Which is cool, and I'll be happy if you find something that I missed.