Parents : Recursion Programming Software Architecture
| Date and time note was created | $= dv.current().file.ctime |
| Date and time note was modified | $= dv.current().file.mtime |
Expression
Syntax
(<primitive> <expression>)
Everything in BSL is formed of atomic units known as primitives based upon which the other units are developed (Same as you see in Physics (atoms)).Also as atoms cannot be broken down into more simplified units same is with primitives.
Examples
- (+ 2 3) , (+ 2 3 4 ) , (* 2 3 4 5 ) (- 3 4)
- Two other operations that come very often are (sqr 2) and (sqrt (2))
RULES FOR EVALUATION
Rule 1 (primitive call)
Each expression is a primitive call ( + 2 (+ 3 4) ) The + is operator and the 2 is operand(but can be regarded as a value) and the bold portion is itself another expression(but can be regarded as another operand) formed of operators and operands.
To evaluate a primitive call
- Reduce the operands(which are not values) to values.
- Apply primitives to values. This process is done from left to right and from inside to outside in each expression that is if we need to evaluate the outside expression we need to evaluate the inside expression first.