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

Re: Real KSH93 is finally free software!



On Apr 12,  1:38pm, Peter Stephenson wrote:
}
} Juhapekka Tolvanen wrote:
} > Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:
} > 
} > > Sure; almost anything using namerefs or discipline functions.
} > 
} > Are them difficult or impossible to implement? If not, when they are
} > added to zsh?
} 
} I don't think they're particularly tricky

Actually they *are* particularly tricky, because of the way zsh's nested
parameter expansion passes data around.  Our first attempt to implement
namerefs was what led to ${(P)var}.

Discipline functions are ugly because in order to set them the parser has
to implement the other missing bit of ksh syntax, which is namespaces as
in ${foo.bar}.  Zsh doesn't allow "." as a valid character in variable
names and it's difficult to do so because the same identifier parser is
used both inside and outside the braces; that is, if you make the most
obvious change to enable ${foo.bar} then $foo.bar also parses as a single
variable name rather than as ${foo}.bar, which will break large numbers
of scripts.

So the changes to implement both of these things go fairly deep into the
most critical parts of the shell.



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