|
![]() |
![]() |
![]() |
The basic structure of a Spyce script is an HTML file with embeddings. There are six types of possible embeddings among the plain HTML text:
Since [[ and ]] are special Spyce delimeters, one would escape them as \[[ and \]] for use in HTML text. They can not be escaped within Python code, but the string expressions ("["*2) and ("]"*2), or equivalent expressions, can be used instead, or the brackets can be conveniently separated with a space in the case of list or slicing expressions. In addition, Spyce scripts are first-class members of the Spyce language: you can create a Spyce lambda out of a Spyce string using the syntax below, in any of the Spyce Python elements (statements, chunks and expressions). A Spyce lambda can be invoked like a regular Python function, and its execution context (i.e. modules) is that of its caller. Spyce lambdas do not currently support nested variable scoping, nor default parameters, which Python users may be accustomed to.
Note that braces in "[parameters]" above indicate that a Spyce lambda may have zero or more parameters. Consider the parameter list of a Spyce lambda to be the same as the parameter list of a Python lambda definition.
Sub-sections:
| |||||||||||||||
|