[Pkg-zsh-devel] Bug#871816: Bug#871787: Bug#871816: zsh: error "defining function based on alias ..."
Axel Beckert
abe at debian.org
Fri Aug 11 20:46:28 UTC 2017
Hi Daniel,
Daniel Shahaf wrote:
> It is mentioned in the list of incompatibilities in the upstream
> README.
Thanks for that hint. I've updated the entry for the NEWS.Debian as
follows and will commit and push that soon:
zsh (5.4.1-1) unstable; urgency=medium
From the upstream README of 5.4.1:
> The default behaviour of code like the following has changed:
>
> alias foo='noglob foo'
> foo() { print function body; }
>
> When this is encountered in a start-up file, or other place where
> input was read line by line, "foo" is in command position and is
> expanded as an alias before the function definition takes place. In
> previous versions of the shell, this caused two functions "noglob" and
> "foo" to be defined. Any expansion of an alias in a function
> definition is nearly always an unintended effect, as well as hard to
> detect, so has been made an error. (The option setting
> NO_MULTI_FUNC_DEF turned this case into an error, but did not help
> with other cases and is off by default.) The alternative, of not
> expanding the alias, was rejected as it was more difficult to achieve
> in the parser and also would silently change the shell's behaviur
> between versions. A new option, ALIAS_FUNC_DEF, has been added, which
> can be set to make the shell behave as in previous versions. It is in
> any case recommended to use the "function" keyword, as aliases are not
> expanded afterwards.
The common error message triggered by this change looks as follows:
> zsh: defining function based on alias `foo'
> zsh: parse error near `()'
See https://bugs.debian.org/871816 for more information.
-- Axel Beckert <abe at debian.org> Fri, 11 Aug 2017 21:43:25 +0200
Regards, Axel
--
,''`. | Axel Beckert <abe at debian.org>, http://people.debian.org/~abe/
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5
`- | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
More information about the Pkg-zsh-devel
mailing list