March 2001
Intermediate to advanced
400 pages
8h 35m
English
When you create an imperative language, you often want to provide your users the ability to compose functions in your language. For example, Sling allows a user to type an expression such as abs(sin(2*pi*t)). One way to represent this function is as a new method—say, absSin2PiT()—that accepts a variable t and returns Math.abs(Math.sin(2*Math.PI*t)). The Sling environment does not create a new method but rather creates an object that represents this new function.
The desire to create new functions while a parser is running creates a paradox: You want to create a new method at runtime, but you must know all method names at compile time. A resolution to this paradox is as follows:
Design ...
Read now
Unlock full access