programming /thuhnk/ 1. "A piece of coding which provides an
address", according to P. Z. Ingerman, who invented thunks in
is called with an expression in the place of a
formalparameter, the compiler generates a thunk which computes the
expression and leaves the address of the result in some
standard location.
2. The term was later generalised to mean an expression,
frozen together with its
environment (variable values), for
later evaluation if and when needed (similar to a
"
closure"). The process of unfreezing these thunks is
called "forcing".
that loads and jumps to the correct overlay.
There are a couple of onomatopoeic myths circulating about the
origin of this term. The most common is that it is the sound
made by data hitting the
stack; another holds that the sound
is that of the data hitting an
accumulator. Yet another
suggests that it is the sound of the expression being unfrozen
at argument-evaluation time. In fact, according to the
inventors, it was coined after they realised (in the wee hours
after hours of discussion) that the type of an argument in
ALGOL 60 could be figured out in advance with a little
In other words, it had "already been thought of"; thus it was
christened a "thunk", which is "the past tense of "think" at
two in the morning".
(1997-10-11)