XCU: 'return' from subshell

2020-03-10 Thread Dirk Fieldhouse
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,

RE: XCU: 'return' from subshell

2020-03-10 Thread shwaresyst
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

Re: XCU: 'return' from subshell

2020-03-10 Thread Dirk Fieldhouse
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.

Re: XCU: 'return' from subshell

2020-03-10 Thread shwaresyst
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

Thinking a bit outside of/stepping back from the box

2020-03-10 Thread Donn Terry
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