Re: Fixed a typo in comment in compress_lz4.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fixed a typo in comment in compress_lz4.c
Date
Msg-id 842688.1760400731@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixed a typo in comment in compress_lz4.c  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Fixed a typo in comment in compress_lz4.c
List pgsql-hackers
Chao Li <li.evan.chao@gmail.com> writes:
> Look at this instance. The comment says:

>   * LZ4 equivalent to feof() or gzeof().  Return true iff there is no
>   * more buffered data and the end of the input file has been reached.

> It just states when the function should return true. In this case, why “if” is not good enough and “if and only if”
isneeded? 

Saying "if" here wouldn't fully specify the behavior.  As an example,
returning constant-true would formally satisfy such a definition.
Yeah, most people would understand what is meant, but if you want
to be precise then you must make clear that the function doesn't
return true when the condition is not satisfied.

I believe that the abbreviation "iff" arose among mathematicians,
who are much more likely to be concerned about such precision than
many of us.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward
Next
From: Chao Li
Date:
Subject: Re: Fixed a typo in comment in compress_lz4.c