Subject: Re: bug#32803: 26.1.50; cl-do: Add more literature in docstring

From: Eric Abrahamsen <[email-masked]>
Date: Wed, 26 Sep 2018 21:08:38 -0700

Tino Calancha <[email-masked]> writes:

> On Mon, 24 Sep 2018, Eric Abrahamsen wrote:
>
>> Eli Zaretskii <[email-masked]> writes:
>>
>>>> From: Eric Abrahamsen <[email-masked]>
>>>> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
>>>> Date: Mon, 24 Sep 2018 09:43:49 -0700
>>>>
>>>>> +Then, in each iteration of the loop, the END-TEST is evaluated; if true,
>>>>          ^^^^^^^
>>>>
>>>>> From the peanut gallery: Without looking at the code, I'm not sure if
>>>> this means the test is evaluated *before* BODY (ie, BODY may never run),
>>>> or *after* BODY (ie, BODY always runs at least once).
>>>
>>> You've removed the answer to that question.  The full text says:
>>>
>>>                                                           Then, in each
>>>      iteration of the loop, the END-TEST is evaluated; if true, the loop
>>>      is finished.  Otherwise, the body FORMS are evaluated, then each
>>>      VAR is set to the associated STEP expression [...]
>>>
>>> which clearly tells that the test is done _before_ the BODY is run.
>>> Right?
>>
>> I guess you're right, yes. "In" still seems unnecessarily vague, though,
>> when it could simply be replaced with "before". But not that big a deal,
>> I guess.
> Thank you for the feedback Eric.
> In some sense, the endtest is part of the loop, that's why the "in".
> It behaves similar like this:
>
> [initialize/update VARS]
> (if endtest
>   (return RESULT)
>  body)
>
>
> I am OK to rephrase it to make it more obvious if you have something
> in mind.

I don't have a serious objection! It just seems to me that the key
question about any test-and-loop construct is: does it test first, or
loop first? As Eli points out, the rest of the docstring makes it clear
that it tests first. It just seems to me that nothing is lost (and
something gained) by replacing "in" with "before".

It really doesn't matter all that much.

Thanks,
Eric