* Yet another silly zsh-ism
@ 2011-06-09 16:16 Bart Schaefer
0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2011-06-09 16:16 UTC (permalink / raw)
To: zsh-workers
I was thinking about the question of simulating anonymous functions in an
older version of zsh, and stumbled upon this: You can create a function
whose name is the empty string.
torch% setopt functionargzero
torch% ""() { print Hi, my name is ${(qqqq)0} }
torch% ''
Hi, my name is $''
torch% print $functions[]
print Hi, my name is ${(qqqq)0}
torch% typeset -f ""
'' () {
print Hi, my name is ${(qqqq)0}
}
Other shells complain that the empty string is not a valid identifier.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-09 16:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-09 16:16 Yet another silly zsh-ism Bart Schaefer
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).