Whitespace defines a command as a sequence of whitespace characters. For example, [Tab][Space][Space][Space] performs arithmetic addition of the top two elements on the stack. A command is written as an instruction modification parameter (IMP) followed by an operation and then any parameters. IMP sequences include: Operator sequences, organized by IMP, include: • Due to Haskell being lazily evaluated, the effect of the stack being too small may only show when, for example, invoking the
outputting a number side-effect. • The
copy and
slide operations were added in Whitespace 0.3.
Comments Characters other than space, tab and linefeed are ignored and thus can be used for comments.
Numbers A numeric value is represented as a sequence of space and tab characters that represent 0 and 1 respectively and terminated by a linefeed. The first character represents the
sign of the value space for positive and tab for negative. Subsequent characters before the terminator represent the binary digits of a value. For example: • [space][tab][space][space][tab][space][tab][tab][linefeed] (STSSTSTTL) is positive since it starts with space and represents 1001011 in binary, which is 75 in decimal. • [tab][tab][tab][space][space][tab][space][linefeed] (TTTSSTSL) is negative since it starts with tab and represents -110010 in binary which is −50 in decimal.
Labels A label is used for
control flow. It is a linefeed-terminated sequence of spaceand tab characters. As there is only one namespace, all labels must be unique. ==Sample code==