On Sat, 28 Aug 1999 16:46:11 MST, Doug wrote:

> Hoping I'm running out of nits,

:-)

Hi Doug,

I've had a week-end away from a keyboard to think about this. The only
reason we have to use case statements for case-insensitive variable
testing is because sh(1) doesn't offer any upper/lower case handling
parameter expansions (something like ${foo~lower} for example).

When sh(1) _does_ offer something like this, a lot more work will be
involved in using it once your proposed changes have gone in.

Therefore, I propose that we create functions isyes() and isno() to wrap
up the case-handling logic. This means we end up using

        if isyes(${foo}); then
                ...
        fi

Later, when upper/lower case handling is available, we could either
change the internals of the isyes() and isno() functions, or replace
their invocations with

        case ${foo~lower} in
        yes)
                ...
                ;;
        *)
                ...
                ;;
        esac

Wotchathink?

Ciao,
Sheldon.

PS: I just finished off rc.network; what a bitch. :-)


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to