3

In the Python programming language, "yield" and "return" are keywords with specific meanings.

A function can either yield a result (sending that result back and then continuing to work), or return it (sending the result back and then being done). So for example, a function to find prime numbers might yield each one as it found it, while a procedure to multiply numbers together would just return the product once the calculation was finished.

How would one best express this distinction in Latin?

1 Answer 1

5

How about redde for "return" and ede for "yield"? These keywords are orders ("do so and so"), and therefore I find imperatives most natural.

The verb reddere means giving back, and I think that captures the idea of "return" pretty well. One might also consider the simple da, but that would bring it closer to giving than returning. Whether a value is returned or not, a function returns also the thread of execution, so I think redde is better than da. I assume that the keyword "return" is read as "give back" instead of "go back"; the latter would only make sense for some uses of the keyword, so giving is probably a better interpretation.

On the other hand, edere means giving out, which is reasonably close to yielding. It sounds sensible to me for a function to either give back once or keep giving out repeatedly. I also find it convenient that similar things are expressed with the same verb with a different prefix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.