Gregor's Answer

Gregor's Answer is an unfinished esoteric programming language created by Tanner Swett in 2013.

Syntax
 ::= [whitespace] { whitespace} [] [whitespace] ::=    |   |  "("  ")"   ::= |   ::= letter  ::= letter | "!" | "@"

In the above, "whitespace" means one or more whitespace characters, and "letter" means a lowercase English letter. Whitespace cannot occur where it is not expressly permitted.

Operation
Objects in Gregor's Answer have one method (which is a sequence of statements) and 26 instance variables, one denoted by each letter of the English alphabet. Each instance variable contains a reference, which points to an object, a job, or nothing. When an object is created, all of its instance variables contain references to nothing. References are mutable; a reference pointing to a job can mutate to point to anything else. Within an object's method,  denotes a reference to the object ("self"),   denotes the method's current argument, and each lowercase letter of the English alphabet denotes the corresponding instance variable.

The statement  creates a new pending job whose target reference is   and whose argument is. (The target reference and the argument are determined at the time the job is created, not at the time it runs.)  then becomes a reference to the new job. The new job is eligible to execute whenever its target reference points to an object. When the new job is executed, its target object's method is executed ("target object" meaning the object that the target reference points to).

The statement  creates a new object whose method is. then becomes a reference to the new object.

The statement  creates a new pending job. then becomes a reference to the new job. The new job also has a forced reference, which is. The new job is eligible to execute whenever  points to an object. When the new job is executed,  is executed, with letters denoting the same instance variables as in the surrounding code, and   and   denoting the same references. (This means that the new job can modify the object's instance variables.)

Finally, the statement, which can only legally appear as the last statement in an inner block, causes all references which point to the current job to mutate to point to the referent of.

Initially, there is exactly one job, which is eligible to execute. When this job is executed, the program's source code is executed. The operation of a program is as follows: An unspecified pending job which is eligible to execute is selected. This job ceases to be pending, and is executed. This repeats until there are no pending jobs that are eligible to execute.