8.14
3.3 Conscript Style Guide
These are some best practices you should follow to prevent common errors, and to make your code more consistent and readable.
3.3.1 Study provides
Each study defined with defstudy should have a corresponding provide statement at the top of the file, before any other definitions.
#lang conscript (provide my-study) ; var definitions... (defvar ...) ; step definitions (defstep intro ...) ; study definition (defstudy my-study ...)
Without the provide, you may not notice any problem during testing, but the Congame server will not be able to access your study when you upload it.
Placing provide statements at the top makes it clear, when reading the source code, exactly what the file makes available to other modules.
For more about why provide should go at the top of the file, see Provide in the Racket style guide.
3.3.2 Indentation
|
|