Wolf (1906) on the false Quijotes of Avellaneda and Lesage

Earlier this year I joined a book club reading Don Quijote and got deep enough into it to seek out the “false second volume of Quijote” of Alonso Fernández de Avellaneda, the book that Don Quixote catches Don Jerónimo and Don Juan reading in Chapter 59 of Cervantes’ actual Part II.

“Why do you want us to read all that nonsense, Don Juan? Nobody who has read the first part of the history of Don Quixote de la Mancha can possibly derive any pleasure from reading this second part.”

“All the same,” said Don Juan, “it’ll be as well to read it, because there’s no book so bad that there isn’t something good in it.”

Read More

Why don’t compilers warn for const T f()?

The other day I got an intriguing question from Sándor Dargó. In const all the things?” (2022-01-23) I had written:

Returning “by const value” is always wrong. Full stop.

Sándor writes: “I was wondering — given that it’s really the case, even the Core Guidelines says so, and it seems to be easy to identify — do you know why we don’t have compiler warnings for such return types?”

Read More

Playing A Serf’s Tale (1986)

The other week I was contacted by a fellow digital antiquarian re an erratum in the “Adventure Family Tree” (managed by Nathanael Culver and hosted by Mike Arnautov). That page had listed under “No known download”:

BROO_XXX: “Enhanced” version of WOOD0350, with “added locations, text added, puzzles reworked,” by Nigel Brooks. […] This version was later renamed “A Serf’s Tale, A Retelling of the Original Adventure”.

In fact, wrote our correspondent, A Serf’s Tale is very much alive and well; the ZX Spectrum tape image survives, and is playable in any Spectrum emulator, such as in JSSpeccy on spectrumcomputing.co.uk. Ctrl+F “speccy” on that page, or (modulo link-rot) click here, to play A Serf’s Tale online.

So I spent a few days trying to beat A Serf’s Tale — and eventually succeeded, with the help of several vintage walkthroughs and hint files. Spoilers galore below the break.

Read More

The red right arm of Jove

In Milton’s Paradise Lost, book II (1667), Belial counsels against an assault on Heaven:

What if the breath that kindl’d those grim fires
Awak’d should blow them into sevenfold rage
And plunge us in the flames? or from above
Should intermitted vengeance arm again
His red right hand to plague us?

This last image is lifted from Horace’s Odes I.2:

Iam satis terris nivis atque dirae
grandinis misit Pater et rubente
dextera sacras iaculatus arces
terruit urbem […]

Read More

noexcept affects libstdc++’s unordered_set

The other day I learned a new place where adding or removing noexcept can change the performance of your program: GNU libstdc++’s hash-based associative containers change the struct layout of their nodes depending on the noexceptness of your hash function. This is laid out fairly clearly in the docs; it’s simply bizarre enough that I’d never thought to look for such a thing in the docs!

Read More

Make things simpler than possible

A quotation from the preface to Donald Knuth’s The TeXBook (Amazon, archive.org):

[A] noteworthy characteristic of this manual is that it doesn’t always tell the truth. When certain concepts of TeX are introduced informally, general rules will be stated; afterwards you will find that the rules aren’t strictly true. […] The author feels that this technique of deliberate lying will actually make it easier for you to learn the ideas. Once you understand a simple but false rule, it will not be hard to supplement that rule with its exceptions.

Read More

A priority_tag-like pattern for type-based metaprogramming

Via Enrico Mauro, an interesting variation on the priority_tag trick. Compare the following example to the HasSomeKindOfSwap example in priority_tag for ad-hoc tag dispatch” (2021-07-09).

template<class T, int N = 2, class = void>
struct HasSomeKindOfValueType
  : HasSomeKindOfValueType<T, N-1> {};

template<class T>
struct HasSomeKindOfValueType<T, 2, std::void_t<typename T::value_type>>
  : std::true_type {};
Read More

How the STL uses explicit

One of the papers on the docket for this week’s WG21 meeting in St Louis is P3116 “Policy for explicit (Zach Laine, 2024). The idea of “policy,” in this context, is that LEWG wants to have something like a “style guide” for proposal-authors. If a proposal comes in with noexcept in the wrong places, or explicit, or [[nodiscard]], we want to be able to quickly tell the author how it ought to be, without a lot of the same discussion happening on every paper. Like a house style guide in newspaper-editing: if our newspaper uses the Oxford comma, and you bring in an article without it, then we can just point to the style guide, make the fix, and move on [see?], without a lot of repeated discussion of the pros and cons of the comma except insofar as you can argue that it belongs in this particular article for a really good reason.

Read More