archives

« Bugzilla Issues Index

#2523 — 13.11.5: suggested restructuring


In 13.11.5 "Runtime Semantics: CaseBlockEvaluation":

13.11.5 / group 1

I suggest restructuring steps 4 and 5 to:

Repeat, letting C be each CaseClause in A
If /searching/ is *true*, then
[steps 4.b - 4.e]
else
[step 5.b]
Return NormalCompletion(/V/).

Reasons:

-- Currently, steps 4.a and 5.a say "Let C be the next CaseClause in A. ..."
I think these are the only points where an algorithm asks for the
'next' element in a List, as if the List carries around a cursor.
Eliminating them simplifies the implicit data model for Lists.

-- It's more obvious that each CaseClause in A is being processed exactly
once (modulo an early return via ReturnIfAbrupt).

-- It makes this algorithm closer in structure to (the first 4 steps of)
the algorithm in group 2. (And you could easily make them even closer.)


fixed in rev25 editor's draft


confirmed fixed.