- Number of input arguments to functions:
Armpit Scheme does not object to receiving more input arguments to a function
than the function actually needs. The additional input arguments are discarded quietly.
The following trace examplifies.
30900 armpit> (define (five) 5) ; the function five takes no input argument
30824 armpit> (five) ; five is normally called with no input argument
30824 armpit> (five 1e23) ; here, five is called with one input argument that is discarded quietly
- Negative zeros and the atan function:
The treatment of negative zeros is not entirely consistent in Armpit Scheme.
One consequence is that the atan function can return an incorrect value when
called with zero as its first argument.
The following trace examplifies.
30156 armpit> (- 0.0) ; a negative zero is o.k.
30156 armpit> (/ 0.0 -1.0) ; division gives a positive zero only (when result is zero)
30156 armpit> (atan 0.0 -1.0) ; atan thinks (0 -1) is in the 1st quadrant
30156 armpit> (/ 1e-20 -1.0) ; division properly gives a negative number
30156 armpit> (atan 1e-20 -1.0) ; atan finds the right quadrant
- Reading numbers with many digits:
Armpit Scheme uses 30 bits to represent integers (two's complement) and floats.
This limits float accuracy to 6 or 7 decimal digits.
The parser was designed to work within this limit and entering numbers with more than 8 digits at the REP
can generate incorrect results. The following examplifies.
3504 armpit> 500000000 ; 5e8 is o.k. for a 30-bit integer
3504 armpit> 600000000 ; 6e8 is above the largest 30-bit integer and becomes nan
3504 armpit> 3.141592 ; pi is o.k. with 7 digits
3504 armpit> 3.14159265 ; 9 digits are also o.k. for pi (trailing digits are not stored)
3504 armpit> 3.141592653 ; 10 digits is too many
Scheme fractions are not implemented in Armpit Scheme.
The division sign (/) in a fraction is assumed to represent an exponent sign (normally: e):
3504 armpit> 1/2 ; interpreted as 1e2
3504 armpit> 1/-2 ; interpreted as 1e-2
- Upper and lower case characters in symbols:
In Armpit Scheme, symbols can have upper and lower case characters and are not considered
equivalent if their case differs.
3504 armpit> (eqv? 'hello 'HeLlO)
- Comments and parentheses:
Armpit Scheme counts parentheses and double-quotes inside comments when identifying
whether an expression entered at the REP is complete or not.
It is necessary to close these parentheses and double-quote (within a comment) for proper operation.
3440 armpit> (+ 3 4) ; this comment opens a parenthesis (
; which needs to be closed
; before Armpit evaluates the sum (+ 3 4)
; let's close the parenthesis here: )
- Error handling:
The only error currently handled by Armpit Scheme is an apply error.
When such an error is encountered, the current return (continuation) and data stacks are cleared
and the system jumps back to the REP. This may cause unknown problems if an apply error occurs in a thread
other than the top-level REP. The example below illustrates handling of an apply error.
32176 armpit> (9 10)
(apply error: 9)
- System Lock Up:
Armpit Scheme can lock-up if improper arguments are given as function inputs.
If this arises, reset the MCU.
The example code below causes such a lock-up.
32108 armpit> (string-length 10 20)
- Reset at end of memory:
When Armpit Scheme runs out of heap space, it performs a soft reset of the Scheme environment.
However, not all functions are properly reinitialized such that it is best to manually perform
a hard reset prior to continuing its use.