16.11. Sling Assemblers
The Sling parser needs assemblers for each of its allowable commands and for each base element of the language. The base elements include numbers, variables, pi, the sliders s1 and s2, negation, and the Sling functions. A single function assembler suffices to assemble all the different types of functions in Sling except for scale.
The scale function requires a special assembler because internally a Scale object takes five parameters in its constructor, and the Sling language allows for only two arguments in the scale function. The Sling parser always sets the first three parameters of a Scale object to 0, t, 1.
The three command assemblers needed by the environment are for the plot command, assignment command, and for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access