Named reference (and other) pending work

Philippe Altherr <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAGdYchs+naf4xm2RcK_vfsMPCuiYPqf-050-Z6z-Ch095Y+hGw@mail.gmail.com>
*Pending patches about named references *(from most to least important)

- Remove support for named references to subscripted variables
<https://github.com/zsh-users/zsh/compare/master...paltherr:zsh:kill-subscripted-refs>
 - workers/54363 <http://zsh.org/workers/54363>
- Fix nameref issues in builtin "unset"
<https://github.com/zsh-users/zsh/compare/master...paltherr:zsh:fix-unset>
 - workers/54364 <http://zsh.org/workers/54364>
  - Implement references to positional parameters
<https://github.com/paltherr/zsh/compare/paltherr:fix-unset...paltherr:zsh:fix-argn-refs>
 - workers/54365 <http://zsh.org/workers/54365>
- Detect invalid variable names in reference initializers
<https://github.com/zsh-users/zsh/compare/master...paltherr:zsh:detect-invalid-variable-names>
 - workers/54278 <http://zsh.org/workers/54278>
- Remove unnecessary tag based reference loop detection
<https://github.com/zsh-users/zsh/compare/master...paltherr:zsh:kill-tagged-loop-detection>
 - workers/54277 <http://zsh.org/workers/54277>

*Other pending patches* (from most to least important)

- Run ZERR trap also when there was a Zsh error
<https://github.com/zsh-users/zsh/compare/master...paltherr:zsh:run-zerr-trap-on-zsh-error>
 - workers/54374 <http://zsh.org/workers/54374>
- Remove partial duplication of strsetfn and arrsetfn
<https://github.com/zsh-users/zsh/compare/master...paltherr:zsh:kill-setfn-duplication>
 - workers/54340 <http://zsh.org/workers/54340>
  - Refine string and array slice assignments
<https://github.com/paltherr/zsh/compare/fix-reversed-slices-bis...paltherr:zsh:refine-slice-assignments>
 - workers/54348 <http://zsh.org/workers/54348>
- Only ever turn global parameters into named directories
<https://github.com/paltherr/zsh/compare/kill-setfn-duplication...kill-local-nameddirs>
 - workers/54328 <http://zsh.org/workers/54328>

*Review of dereferencing lookups*

I have started reviewing all parameter lookups that also dereference named
references, i.e., more or less all calls to realparamtab->getnode().
Several of these lookups have issues. In many cases, they should simply not
perform any dereferencing (i.e., call getnode2() instead of getnode) but a
few are more problematic. I have already reviewed most lookup and will
start sending out patches and/or start discussions to figure out what to do.

*Review of typeset implementation*

A few months ago, I started an exhaustive review of the implementation of
typeset and found many issues, which lead to many side tracks. Some of them
have been resolved and a few others are among the patches listed above.
However, I know for sure that there are still issues with typeset. In
particular with -p and -m when applied to named references. I suspect that
there are also still issues with some calls to typeset p=v where p is an
existing named reference.

*Turn placeholder dereferencing into an error*

In ksh, any attempt to dereference a placeholder reference triggers an
error. Zsh should do the same. Currently it sometimes exhibits rather
dubious behaviors in place of triggering an error.

*Discuss the semantics of references to not-yet-defined variables*

With the current implementation, references to not-yet-defined variables
lead sometimes to behaviors that are nonsensical in my opinion. I think
that a different approach could lead to references that are not only less
problematic but also generally more useful.

*Other issues*

I'm aware of a number of other issues but as long as named references are
released as an experimental feature, I think that they can be addressed
after the release.

Philippe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.