You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Facade grammar: a destroyer whose resource is not its first parameter (20 functions, 6 libraries: BZ2_bzReadClose(int*, BZFILE*)) #3177
Part of #3115; cluster from the #3116 survey: 'destroyer whose resource is not its first parameter (§16.2b.13)', 20 functions in 6 libraries (bzip2 BZ2_bzReadClose/BZ2_bzWriteClose, libxml2 xmlSwitchInputEncoding, …), plus 5 destroyers with an undescribed parameter (an allocator pointer, a callback: xz_utils lzma_index_hash_end, libxml2 xmlHashFree). The facade's drop names a function and assumes param 0; it needs the parameter index and the other parameters' values (an out-pointer for the error, NULL for the allocator).
Needs Eric: this is grammar, and §31 words are his.
Facts. §31's destruction = "drop" c_name | "destroys" c_name | "abandon" c_name names a function and takes its first parameter as the resource (drop f: "taking only the representation"; destroys f: an operation with further arguments). BZ2_bzReadClose(int *bzerror, BZFILE *b) puts the resource second, so no line can state it and the function stays raw (20 functions in 6 libraries by the #3116 survey).
The spelling already in the grammar for the same problem on the producing side:from f(out param N) and init f(self), and the profile rule pattern [ "(" ( "out" param_ref | "self" ) ")" ].
Proposal for a ruling:destroys f(param N) (and drop f(param N) where the other parameters are fixed by param M fixed … lines on fn f): the parenthesized parameter is the one that receives the resource; without it, the first, as today. One new production, mirroring from f(out param N); a wrong N is checked against the parameter's type as the first parameter is today. Prediction: yes, 75%.
Not implemented: the clause is a grant (it says which pointer is destroyed), so its words come first.
Labelled human attn needed (2026-11-20): the proposal above (destroys f(param N) / drop f(param N), one production mirroring from f(out param N)) is new contract grammar that grants which pointer is destroyed, so its words are Eric's. Nothing else blocks it; implementation follows the ruling.
Activity
ehartford commentedon Nov 18, 2026
Needs Eric: this is grammar, and §31 words are his.
Facts. §31's
destruction = "drop" c_name | "destroys" c_name | "abandon" c_namenames a function and takes its first parameter as the resource (drop f: "taking only the representation";destroys f: an operation with further arguments).BZ2_bzReadClose(int *bzerror, BZFILE *b)puts the resource second, so no line can state it and the function stays raw (20 functions in 6 libraries by the #3116 survey).The spelling already in the grammar for the same problem on the producing side:
from f(out param N)andinit f(self), and the profile rulepattern [ "(" ( "out" param_ref | "self" ) ")" ].Proposal for a ruling:
destroys f(param N)(anddrop f(param N)where the other parameters are fixed byparam M fixed …lines onfn f): the parenthesized parameter is the one that receives the resource; without it, the first, as today. One new production, mirroringfrom f(out param N); a wrong N is checked against the parameter's type as the first parameter is today. Prediction: yes, 75%.Not implemented: the clause is a grant (it says which pointer is destroyed), so its words come first.
A destroyer names the parameter that receives the resource; 'param p …
ehartford commentedon Nov 20, 2026
Labelled
human attn needed(2026-11-20): the proposal above (destroys f(param N)/drop f(param N), one production mirroringfrom f(out param N)) is new contract grammar that grants which pointer is destroyed, so its words are Eric's. Nothing else blocks it; implementation follows the ruling.abandon f(param N): the abandonment path names the parameter that rec…