boolean values in krb5.conf

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

boolean values in krb5.conf

Weijun Wang
I see

static const char *const conf_yes[] = {
    "y", "yes", "true", "t", "1", "on",
    0,
};

static const char *const conf_no[] = {
    "n", "no", "false", "nil", "0", "off",
    0,
};

at src/util/profile/prof_get.c#L337. So the opposite of "t" is "nil" instead of "f". Is there a history here? Why not support "f" being "false"?

Thanks
Max


_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: boolean values in krb5.conf

Greg Hudson
On 02/08/2014 04:51 AM, Wang Weijun wrote:
> at src/util/profile/prof_get.c#L337. So the opposite of "t" is "nil" instead of "f". Is there a history here?

Yeah, in LISP, nil is the empty list, which is the only value which
evaluates as false, and t is a boolean true.

Did you run into a case where someone expected "f" to work as a boolean
false value?
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: boolean values in krb5.conf

Weijun Wang

On Feb 8, 2014, at 23:52, Greg Hudson <[hidden email]> wrote:

> On 02/08/2014 04:51 AM, Wang Weijun wrote:
>> at src/util/profile/prof_get.c#L337. So the opposite of "t" is "nil" instead of "f". Is there a history here?
>
> Yeah, in LISP, nil is the empty list, which is the only value which
> evaluates as false, and t is a boolean true.

OK, so this 't' is that LISP *true*, and not just only an abbreviation of "true" in common sense.

>
> Did you run into a case where someone expected "f" to work as a boolean
> false value?

No. I just thought where there is a 't', there should also be a 'f' as its opposite.

Thanks
Max



_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: boolean values in krb5.conf

Derek Atkins
In reply to this post by Greg Hudson
Greg Hudson <[hidden email]> writes:

> On 02/08/2014 04:51 AM, Wang Weijun wrote:
>> at src/util/profile/prof_get.c#L337. So the opposite of "t" is "nil"
>> instead of "f". Is there a history here?
>
> Yeah, in LISP, nil is the empty list, which is the only value which
> evaluates as false, and t is a boolean true.
>
> Did you run into a case where someone expected "f" to work as a boolean
> false value?

In scheme it's '#f' -- nil is... different.  C.f:

guile> (if #f 1 2)
2
guile> (if #t 1 2)
1
guile> nil
ERROR: Unbound variable: nil
ABORT: (unbound-variable)


-derek
--
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [hidden email]                        PGP key available
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev