[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/8] builtins/source: parse the -i option
From: |
Koichi Murase |
Subject: |
Re: [PATCH v2 5/8] builtins/source: parse the -i option |
Date: |
Wed, 15 May 2024 05:48:22 +0900 |
2024年5月15日(水) 4:51 Chet Ramey <chet.ramey@case.edu>:
> What do folks think about forcing an option to enable using
> BASH_SOURCE_PATH? Should it be required? Is it necessary? (I personally
> think it is not.) We discussed this briefly last week but without any
> conclusion.
Either works for me (suppose the `source' builtin considers
BASH_SOURCE_PATH even without specifying the option in non-POSIX
mode). I personally think both decisions to include and not to include
the suggested option are understandable.
To talk about its necessity, I actually agree with the others. I don't
think we need it.
However, at the same time, I think the new option could be justified
from the viewpoint of language design. If we have a new namespace
``BASH_SOURCE_PATH'' for the scripts to be sourced, it would be neat
to have an option to specify the namespace exclusively. It is similar
to `unset -v'. As far as the shell script is properly designed so that
the target variable is ensured to exist, `unset var' is sufficient
because the `unset' builtin first checks the variable name and falls
back to the function name only when the variable doesn't exist. In
this sense, `unset -v var' is not required. It's not necessary, yet I
think it can be a part of a language.
--
Koichi
- Re: [PATCH v2 1/8] findcmd: parameterize path variable in functions, (continued)
[PATCH v2 2/8] findcmd: define find_in_path_var function, Matheus Afonso Martins Moreira, 2024/05/13
[PATCH v2 3/8] builtins/source: extract file executor function, Matheus Afonso Martins Moreira, 2024/05/13
[PATCH v2 4/8] builtins/source: refactor file searching function, Matheus Afonso Martins Moreira, 2024/05/13
[PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/13
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Chet Ramey, 2024/05/14
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Greg Wooledge, 2024/05/14
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Lawrence Velázquez, 2024/05/14
- Re: [PATCH v2 5/8] builtins/source: parse the -i option,
Koichi Murase <=
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Koichi Murase, 2024/05/14
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Chet Ramey, 2024/05/15
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Koichi Murase, 2024/05/15
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Chet Ramey, 2024/05/16
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Greg Wooledge, 2024/05/16
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Koichi Murase, 2024/05/20
Re: [PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/16
Re: [PATCH v2 5/8] builtins/source: parse the -i option, Greg Wooledge, 2024/05/16
Re: [PATCH v2 5/8] builtins/source: parse the -i option, Chet Ramey, 2024/05/17
Re: [PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/17