[Fluent Inc. Logo] return to home search
next up previous contents index

3.2.7 Evaluation

All responses to prompts (except filenames, see above) are evaluated by the Scheme interpreter before they are used. You can therefore enter any valid Scheme expression as the response to a prompt. For example, to enter a unit vector with one component equal to $1/3$ (without using your calculator),

 /foo> set-xy

 x-component [1.0] (/ 1 3)

 y-component [0.0] (sqrt (/ 8 9))

or, you could first define a utility function to compute the second component of a unit vector,

 > (define (unit-y x) (sqrt (- 1.0 (* x x))))

 unit-y
 /foo> set-xy

 x-component [1.0] (/ 1 3)

 y-component [0.0] (unit-y (/ 1 3))


next up previous contents index Previous: 3.2.6 Lists
Up: 3.2 Text Prompt System
Next: 3.2.8 Default Value Binding
© Fluent Inc. 2006-09-20