Language basics - Sketch
Description: Sketch

Next: Drawables, Previous: Input language, Up: Input language

### 3.1 Basics

`Sketch` input is plain ASCII text, usually stored in an input file. It describes a scene, so the sketch language is a scene description language. `Sketch` input is also declarative. It merely declares what the scene ought to look like when drawing is complete and says very little about how `sketch` should do its work. `Sketch` commands are not executed sequentially as in the usual programming language. They merely contribute to that declaration.

A few syntactic details are important. Case is significant in the `sketch` language. With a few exceptions, white space is not. This includes line breaks. Comments begin with `%` or `#` and extend to the end of the line. You can disable a chunk of syntactically correct `sketch` code by enclosing it in a `def`. There is a simple “include file” mechanism. The command

      input{otherfile.sk}

causes the contents of otherfile.sk to be inserted as though they were part of the current file.