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

Re: namespaces limitation



Bart Schaefer wrote:
> Yes, the first character of a namespace identifier should probably be
> an alphabetic.  Or an underscore?  That might really complicate math
> lexing, given that we allow underscores in numeric constants.

What's allowed in math context can be (and already is) more restrictive
that what it's possible to declare.

One option might be to disallow bare namespaces, so

  integer .var=56

would be disallowed. Where .3 just looks really wrong, .3.var feels
innocuous.

In ksh93:

  $ .var=23
  $ typeset -p .var
  .var=23
  $ namespace var { val=78; }
  $ typeset -p .var
  namespace var
  {
	  val=78
  }

Also questionable is the following which currently works:

  .a.=ddd

The ksh error for this is 'no parent' even if you create an "a"
namespace first. We also currently allow a.=ddd but I think that is less
questionable. We allow empty association elements.

Oliver




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