# How to resolve issue of circular definition for an If statement

I am trying to define an If statement, but am stuck because the definition/implementation of If is circular from what I have tried. For example, here is one definition:

class If {
provide: Condition
provide: TrueBlock
body:
If (Condition) {
call(TrueBlock)
}
}

You can then use it like this:

If (true) {
Something()
}

But the thing is, the definition itself uses If to define it:

class If {
...
If (Condition) {
call(TrueBlock)
}
}

The only other way I can think of defining it is by saying that an If statement is an "atomic statement", and so it doesn't have an implementation. (The compiler or whatever would then have special instructions to treat it uniquely).

class If {
provide: Condition
provide: TrueBlock
}

That would be the whole definition of If. No implementation required.

Wondering if this is sort of the right approach to this problem. The problem being that you can't really implement an If statement without resorting to using If itself. And so you define it as atomic.

• The main obstacle is perhaps that you're attempting to define the semantics of a syntactic construct in the very same syntax. This fails often. Other examples of this failure include M Spivey's first book on the Z specification language. (Its essence was that everything meant $\bot$ even though that wasn't intended.) – Kai Jul 1 '18 at 12:33