30156 armpit> (- 0.0) ; a negative zero is o.k.
-0.0
30156 armpit> (/ 0.0 -1.0) ; division gives a positive zero only (when result is zero)
0.0
30156 armpit> (atan 0.0 -1.0) ; atan thinks (0 -1) is in the 1st quadrant
0.0
30156 armpit> (/ 1e-20 -1.0) ; division properly gives a negative number
-1.e-20
30156 armpit> (atan 1e-20 -1.0) ; atan finds the right quadrant
3.14159
32176 armpit> (expt 2 3)
7.99998
32176 armpit> (* 2.0 2.0 2.0)
8.
32176 armpit> (/ (- (expt 2 3) 8) 8)
-1.90735e-6
32176 armpit> (expt 2 9)
5.11998e2
32176 armpit> (/ (- (expt 2 9) 512) 512)
-4.76837e-6
3504 armpit> 500000000 ; 5e8 is o.k. for a 30-bit integer
500000000
3504 armpit> 600000000 ; 6e8 is above the largest 30-bit integer and becomes nan
nan
3504 armpit> 3.141592 ; pi is o.k. with 7 digits
3.14159
3504 armpit> 3.14159265 ; 9 digits are also o.k. for pi (trailing digits are not stored)
3.14159
3504 armpit> 3.141592653 ; 10 digits is too many
-7.96328e-2
3504 armpit> 1/2 ; interpreted as 1e2
1.e2
3504 armpit> 1/-2 ; interpreted as 1e-2
1.e-2
32108 armpit> (case (* 2 3) ; doesn't work because (* 2 3) returns float 6.
((2 3 5 7) 'prime)
((1 4 6 8 9) 'composite))
32108 armpit> (case (round (* 2 3)) ; a possible workaround
((2 3 5 7) 'prime)
((1 4 6 8 9) 'composite))
composite
3504 armpit> (eqv? 'hello 'HeLlO)
#f
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: )
7
32176 armpit> (9 10)
(apply error: 9)
32108 armpit> (string-length 10 20)
32104 armpit> (number->string (read (pinsel 0)) 16)
"00008005"
32104 armpit> (number->string (read (pinsel 1)) 2)
"00000101010000000000000000000000"
and the pinsel ports can similarly be used to set alternative functions for MCU pins,
using, for example: (write #x0123abcd (pinsel 1)) -- but do refer to the LPC2xxx manual before
setting arbitrary values into these MCU registers (scheme ports). Additionally, because 30-bit tagged integers
are used in Armpit Scheme, the top 2 MSBs of pin assignments written to or read from pinsel ports
are always equal to the 3rd MSB (hence exercise caution when modifying bits 29, 30 and 31 in
pinsel ports as bits 30 and 31 will be set to the same value as bit 29).