zsh-users
 help / color / mirror / code / Atom feed
* Ways of delivering code for execution
@ 2017-11-26 15:01 Sebastian Gniazdowski
  2017-11-26 17:06 ` Ray Andrews
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2017-11-26 15:01 UTC (permalink / raw)
  To: Zsh Users

Hello,
I know following methods of loading a code for execution:

a) source file
b) autoload file && file
c) eval $(<file)

This is one of impossible questions that I sometimes ask. I'm wondering if there is any other method to do what a,b,c are doing?

If not, then maybe there are significant pros and cons of each method? So that it makes sense to choose between them according to specific situation. I cannot see any. source is just the best method and other have flaws.

I would add method-selection to Zplugin, so that user can load plugin in multiple ways, depending on what plugin does.

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org


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

* Re: Ways of delivering code for execution
  2017-11-26 15:01 Ways of delivering code for execution Sebastian Gniazdowski
@ 2017-11-26 17:06 ` Ray Andrews
  2017-11-26 18:17   ` Sebastian Gniazdowski
  0 siblings, 1 reply; 3+ messages in thread
From: Ray Andrews @ 2017-11-26 17:06 UTC (permalink / raw)
  To: zsh-users

On 26/11/17 07:01 AM, Sebastian Gniazdowski wrote:
> Hello,
> I know following methods of loading a code for execution:
>
> a) source file
> b) autoload file && file
> c) eval $(<file)
>
> This is one of impossible questions that I sometimes ask. I'm wondering if there is any other method to do what a,b,c are doing?

Just curious: why do you look for other methods?


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

* Re: Ways of delivering code for execution
  2017-11-26 17:06 ` Ray Andrews
@ 2017-11-26 18:17   ` Sebastian Gniazdowski
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Gniazdowski @ 2017-11-26 18:17 UTC (permalink / raw)
  To: Ray Andrews, zsh-users

On 26 Nov 2017 at 18:06:47, Ray Andrews (rayandrews@eastlink.ca) wrote:
>  
> Just curious: why do you look for other methods?

For Zplugin, I mentioned this already in first post. I want to make Zplugin even more sophisticated than it is currently – example Zplugin swiss-knife invocation:

% zplugin ice atclone"dircolors -b LS_COLORS > c.zsh" atpull'%atclone' pick"c.zsh"
% zplugin light trapd00r/LS_COLORS

This way, `dircolors' will be ran only on install and on `git pull' (update of plugin), not on every shell startup.

If someone has ideas for other swiss army knife tricks I will be very grateful for sharing them.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org


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

end of thread, other threads:[~2017-11-26 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-26 15:01 Ways of delivering code for execution Sebastian Gniazdowski
2017-11-26 17:06 ` Ray Andrews
2017-11-26 18:17   ` Sebastian Gniazdowski

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).