I learned the term “Frame” from Hurley, Dennett and Adams’ Inside Jokes. Jeff Hawkins mentioned the idea that our brain predicts expected sensory input by being in some state. I do not recall what he called these states. Some of Hofsdtadter’s recent work refers to concepts. In another direction computer assembler programs and the computer language C’s pre-processor preprocessor has a facility to repeat text patterns mutatis mutandis. John McCarthy broached such an idea to me in 1959 under the name “Cliché”.
What has all this to do with the head? Your frame conditions your reflexes. If you are riding a bicycle then your reflexes to keep balanced appear, observe and control without thinking about it.
The macro idea would seem out of place here but it fits mainly backwards. In the computer science context one invokes the macro supplying argument values and gets a ‘situation’ from the macro with many details filled in from the arguments. In the psychology context it is mainly the other way round. Some magic brain mechanism recognizes a situation and proposes argument values. “Here is a family and that it the mother and that is a son.” This idea is at the heart of the pattern matching syntax of the OCaml and Haskell programming languages which essentially runs the macro expansion backwards to produce argument values from some concrete example of a pattern. Several such macros can be in place at the same time—some playing the role of argument values of others. Several modern languages have pattern matching where parameter values are produced by the computation, rather than consumed.
If a frame has a strong valence, there is likely to be a link to frames that lead to this frame, so as to be able to bring about or avoid this frame. This leads by evolutionary stages to this phenomenon.