zsh-workers
 help / color / mirror / code / Atom feed
* zsh function declaration bug
@ 2019-01-30 17:46 Mitchell Gildenberg
  2019-01-31 13:11 ` dana
  0 siblings, 1 reply; 3+ messages in thread
From: Mitchell Gildenberg @ 2019-01-30 17:46 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

Hello,

I noticed some interesting behavior when declaring zsh functions without
specifying the `function` keyword. When I declare a function that is a
prefix of some other item in my path or another alias, the function that is
a prefix is called instead.  For example:

------------
(macbook) ➜ mgild $ zsh --version
zsh 5.3 (x86_64-apple-darwin17.0)
(macbook) ➜ mgild $ ls
Applications/ Desktop/      Documents/    Downloads/    Library/
Movies/       Music/        Pictures/     Public/
(macbook) ➜ mgild $ l(){echo "hello"}
(macbook) ➜ mgild $ ls
hello
(macbook) ➜ mgild $
-------------- (zsh 5.5 exhibits different behavior)
➜ mgild $ zsh --version
zsh 5.5 (x86_64-debian-linux-gnu)
➜ mgild $ ls
Desktop Documents
➜ mgild $ l(){ echo "hello"}
zsh: defining function based on alias `ls'
zsh: parse error near `()'
--------------
zsh 5.5 seems to exhibit different behavior, but it is still unexpectedly
failing to create the function.

Let me know if any more information is required.

Thank you.

Mitchell Gildenberg
mgild@google.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-31 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 17:46 zsh function declaration bug Mitchell Gildenberg
2019-01-31 13:11 ` dana
2019-01-31 14:00   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).