help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thanks for the feedback


From: David Ongaro
Subject: Re: Thanks for the feedback
Date: Fri, 03 May 2024 09:23:01 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

Matheus Afonso Martins Moreira
<matheus.a.m.moreira@gmail.com> writes:

> I agree with you: adding to the complexity of source is not a good idea.
>
> Bash is powerful enough to do it with a function, no doubt about it.
> The thing is that approach begs the question of how to source that
> function which is also a reusable library function. This chicken and
> egg problem is why I believe a library facility is something that's
> better off as a native feature of the language.

I don't see a 'chicken and egg problem'. You have to define somewhere a
BASH_IMPORT_PATH to make use of that feature. So you could as well
define an import function at that very same place (and as shown it can
be pretty small, as to not require its own 'library').

> I just sent to the bug-bash mailing list a patch set that implements
> this feature by adding a new builtin named import which behaves almost
> exactly like source except for the fact it searches the paths in
> BASH_IMPORT_PATH and returns executable files only.

I don't understand why you require these imports to be executable. In
fact marking scripts intended to be sourced as executable is an
antipattern.

> I believe that addresses the concerns over the overloading of source.

Yeah, it's surely the better solution.

> Please let me know what you think.

I still don't see the need, but I'm just a user not a maintainer. Still,
I wish you good luck on your journey of getting a patch in.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]