zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: Zsh Users <zsh-users@zsh.org>
Subject: order of sourcing
Date: Sun, 16 Apr 2023 09:14:42 -0700	[thread overview]
Message-ID: <b0a81f81-5604-a798-60ab-f64a7d83ab1e@eastlink.ca> (raw)

I'd like to clear up a little bother:

file aa:

aa ()
{
     bb "howdy!"
}

file bb:

bb ()
{
     echo $1
}

4 /aWorking/Zsh/Source/Wk/Test 0 $ . *    # Just sourcing 'aa' and 'bb'.

4 /aWorking/Zsh/Source/Wk/Test 0 $ aa
aa:2: permission denied: bb

4 /aWorking/Zsh/Source/Wk/Test 0 $ . bb; aa
howdy!

... I think I get it:  'aa' is sourced first and thus 'aa ()' doesn't 
know what 'bb ()' looks like so throws an error until 'bb' is sourced 
again.  But shouldn't 'aa ()' sorta find 'bb ()'  in real time?  It's 
easy enough to deal with but I'm betting there's an easy and better 
solution that doesn't involve ad hoc re-sourcing.




             reply	other threads:[~2023-04-16 16:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16 16:14 Ray Andrews [this message]
2023-04-16 16:17 ` Roman Perepelitsa
2023-04-16 16:48   ` Ray Andrews
2023-04-16 20:22     ` Ray Andrews
  -- strict thread matches above, loose matches on Subject: below --
2023-01-17 21:07 Ray Andrews
2023-01-17 21:24 ` Roman Perepelitsa
2023-01-17 21:34   ` Bart Schaefer
2023-01-17 21:42     ` Roman Perepelitsa
2023-01-17 21:48     ` Ray Andrews
2023-01-18 21:23       ` Bart Schaefer
2023-01-18 23:44         ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0a81f81-5604-a798-60ab-f64a7d83ab1e@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).