1 Summary
XCU Ch2.14 states that 'return' shall cause the shell to leave the
current function or dot script, if any. Ch2.95 says that execution shall
continue with the next command after the function call. Implementations
that claim conformance consistently contradict this specification,
I basically agree this is an issue - I see return as more for being interpreted
as a lexical scope abort, whatever the execution context, and exit an execution
scope abort, such as a subshell or separate script utility environment, as
their basic intent. Further complicating things, I don't
On 10/03/20 18:25, shwaresyst wrote:
>
> I basically agree this is an issue - I see return as more for being
interpreted as a lexical scope abort, whatever the execution context,
and exit an execution scope abort, such as a subshell or separate script
utility environment, as their basic intent.
After some thought, I believe I'd be in favor more of: a) adding explicitly
that '{' and '(' introduce a new lexical scope, balanced by '}' and ')'
respectively; b) when such scopes are asynchronous return shall function the
same as exit, with, as App Usage, it is up to any trap action for
I've mostly been lurking in this group for decades(!), but there are
certain recurring themes that might be worth considering for the next
revision.
Yes, I fully recognize that the goal is "standardizing existing practice"
is a requirement of the standard, but as was pointed out, I believe in the