#lang scribble/manual @title{Indentation} Pyret enforces indentation. A valid piece of code will not run if it is not indented properly. Most of the time, this will not be a problem, since the majority of expressions can be typed in just one line. Some syntaxes, such as @tt[]{fun} and @tt[]{if}, require multiple lines, which must follow one of two indentation rules. The first rule is same-line/greater-column (SLGC). Two pieces of code obey this rule when the second piece of code is either on the same line as the first, or is indented at least 2 spaces. For example, both @verbatim|{ fun plus1(x): x + 1 }| and @verbatim|{ fun plus1(x): x + 1 }| are well-indented. However, @verbatim|{ fun plus1(x): x+1 }| is not well-indented, and will result in an error. The documentation of each syntactic form specifies all indentation rules that it follows. The second rule is same-line/same-column (SLSC). Either the two pieces of code must be on the same line, or they must be indented by the same amount. For example, in an @tt[]{if} statement, all branches must be lined up at the same level: @verbatim|{ fun sgn(x): if x < 0: -1 elif x = 0: 0 else: 1 }|