On May 7, 2018, at 2:43 PM, David Holmes <[email protected]> wrote: > > The grammar can be a bit subtle here. IIUC we would say: > > "Index %d out of bounds for length %d" > > but if we turn it around we'd say: > > "out-of-bounds index %d for length %d"
+1 And the hyphens could be dropped altogether, which I think reads better, usually. (Grammarian hat donned.) You _may_ use "out-of-bounds" when it modifies a noun. The form "out-of-bounds" is a compound adjective. It is the compound-adjective form of "out of bounds". See Rule 1 of this page: https://www.grammarbook.com/punctuation/hyphens.asp Rule 10 on the same page says compound adjectives that are well known do not need hyphens. A compound adjective usage can omit hyphens if it will be well understood. A compound-adjective usage can include hyphens if it might not be well-understood. Thus, hyphenating the compound adjective is sometimes a matter of taste. Here's bad grammar: "Hyphenating the compound-adjective is sometimes a matter-of-taste." Hyphenating nouns is only correct if the noun specifically requires it, like the numbers between twenty-one and ninety-nine, as the noted grammarian Salman Al-Azami might observe. (Grammarian hat doffed.)
