zsh-users
 help / color / mirror / code / Atom feed
* How do you decide whether to make something a function or a script?
@ 2018-09-09  1:22 TJ Luoma
  2018-09-09  1:55 ` Grant Taylor
  2018-09-09  3:24 ` Bart Schaefer
  0 siblings, 2 replies; 7+ messages in thread
From: TJ Luoma @ 2018-09-09  1:22 UTC (permalink / raw)
  To: Zsh-Users List

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

I've been moving some of my more elaborate functions into their own files
and using the autoload feature to import them into other scripts.

But it's gotten me to wonder:

Why make any functions at all? Why not just make them all scripts? If they
are scripts in the $PATH then you can just call them by name and they work
in the login shell or in scripts. If they are functions, you have to
autoload them first.

So I've gotten to wonder… what makes you make something a function vs a
script?

TjL

--
TJ Luoma
TJ @ MacStories <http://www.macstories.net/author/tjluoma/>
Personal Website: luo.ma <http://luo.ma/> (aka RhymesWithDiploma.com
<http://rhymeswithdiploma.com/>)
Twitter: @tjluoma <http://twitter.com/tjluoma>

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

end of thread, other threads:[~2018-09-09 22:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-09  1:22 How do you decide whether to make something a function or a script? TJ Luoma
2018-09-09  1:55 ` Grant Taylor
2018-09-09  2:21   ` Daniel Shahaf
2018-09-09  2:51     ` Grant Taylor
2018-09-09 19:34     ` TJ Luoma
2018-09-09 22:54       ` Bart Schaefer
2018-09-09  3:24 ` 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).