Re: Fixed a typo in comment in compress_lz4.c

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fixed a typo in comment in compress_lz4.c
Date: 2025-10-14 00:27:27
Message-ID: B6C167ED-DE33-4B67-AB9A-AB08904E14F9@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Oct 14, 2025, at 08:12, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Chao Li <li(dot)evan(dot)chao(at)gmail(dot)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” is needed?
>
> 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

Okay, I see. In other words, if we were replacing “iff”, “only when” would be more precise than “if”.

I think we can leave existing “iff” there. I withdraw this patch.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-10-14 00:36:07 Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward
Previous Message Tom Lane 2025-10-14 00:12:11 Re: Fixed a typo in comment in compress_lz4.c