This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: The nature of truth


Chris Dean wrote:

In this lucky case it happens to be our code doing some JDBC transforms
so it's easy enough to change.  The real annoyance is the the Java
Boolean constructors exists at all (this has irritated me for years,
grrr).

The JDK 1.4.0 docs say (in boldface) about Boolean(boolean):


Note: It is rarely appropriate to use this constructor. Unless a new instance is required, the static factory valueOf(boolean) is generally a better choice. It is likely to yield significantly better space and time performance.

There isn't the same note for Boolean(Sting), though.


Anyway, the docs basically say what to expect:

    The type `boolean' matches any object, and the result is `false' if
    and only if the actual argument is `#f'.

I suggest we extend this and say that #f corresponds to Boolean.FALSE
and #t corresponds to Boolean.TRUE.

I'll mention that in the manual. -- --Per Bothner per@bothner.com http://per.bothner.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]