Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Parameter flags and subscripts and references



On 13 Nov, Bart Schaefer wrote:
> Maybe the answer is that ${parameters[foo]} should *never* expand to
> "nameref-scalar" and should just stop at "nameref" like (t!) does,
> regardless of what "foo" represents.

Keep in mind that $parameters was created specifically to support
completion and to provide a way to get a list of parameters that are
applicable to a particular context. Mostly you shouldn't need to care
whether something is a nameref to a whatever or just a plain whatever.
I don't particularly object to the value including "nameref" but the
rest of the type is needed.

Extracting existing uses of _parameters -g we have:

  ^a*
  a*
  *array*
  array
  *array*~*readonly*
  *assoc*
  *association*~*readonly*
  *export*
  *export*~*readonly*
  (integer|float)*
  ^*readonly*
  ^*(readonly|association)*
  *scalar*
  scalar*export*

A few of those probably need an initial *.

Oliver




Messages sorted by: Reverse Date, Date, Thread, Author