Liste des Groupes | Revenir à cl c |
On 21.04.2025 17:36, bart wrote:Alternatively, you might describe it as "Perform the task on each element" :On 21/04/2025 14:51, Waldek Hebisch wrote:No. That's just *your* _transcription_ of the original code>>
[ sqlite3.c code ]
You have to analyse it first. The kind of loop this expresses is:
p = startvalue()You are *not* describing _the task_, you are merely translating the
>
while (p) {
<body>
p = nextvalue()
}
>
Notice how I chose to express it: it reflects how I would describe it in
English:
_chosen commands_ of the procedural language [that you have chosen]
>Whatever programming language and constructs you use, this is not
* Set P to Start Value
* While P isn't Null:
* Execute the body
* Set P to Next Value
more than a rephrasing the used language constructs (as opposed to
the task).
(It's not surprising; you can observe that folks that are familiar
only with imperative languages tend to this sort of fallacy.)
So, how would /you/ describe it in English? (Or in any language if like,Iterate over the elements and sequentially perform <the task> on
as the ordering is more important.)
the elements. Or a bit more formally
iterate (elements, task)
in some functional programming language. Or any other variant on
any abstraction level that is appropriate.
Les messages affichés proviennent d'usenet.