klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit 76b5100d7620d70420d5dc457182e0fc6b8d0537
parent 9b7bbd963ec3dc395e50651a001986154d4f4891
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Wed, 19 Oct 2011 15:35:44 -0300

Added some commented out tests after fixing the strict arithmetic bug.

Diffstat:
Msrc/tests/numbers.k | 30+++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/tests/numbers.k b/src/tests/numbers.k @@ -10,14 +10,9 @@ ;; Shutt for clarification (but I warn you that while he is very cooperative ;; with this kind of things he sometimes takes a while to answer). ;; -;; The operations that throw an error instead of returning #real do so because -;; the strict-arithmetic flag is true which apparently is caused by a bug, as -;; it starts as false when the interpreter starts but is true after running the -;; test (Which is a thing that shouldn't be possible, the flag is a dynamic -;; variable). I'm on it. -;; -;; The round thing is obviously a bug too, but (round 1.1) doesn't hang so -;; I'm inclined to think that it's related to the previous bug, I'm on it. +;; The round thing is obviously a bug, (round 1.1) doesn't hang so, +;; I'm inclined to think that it's related to some memory issue like the strict +;; arithmetic one. ;; ;; Andres Navarro ;; @@ -117,19 +112,19 @@ ($check equal? (+ . #0=(0 . #0#)) 0) ($check equal? (+ . #0=(1 . #0#)) #e+infinity) ($check equal? (+ . #0=(-1 . #0#)) #e-infinity) -;---- ($check equal? (+ . #0=(1 -1 . #0#)) #real) ; FAIL +($check equal? (+ . #0=(1 -1 . #0#)) #real) ;; 12.5.5 * ($check equal? (* 2 3) 6) ($check equal? (*) 1) -;---- ($check equal? (* 0 #e+infinity) #real) ; FAIL -;---- ($check equal? (* 0 #e-infinity) #real) ; FAIL +($check equal? (* 0 #e+infinity) #real) +($check equal? (* 0 #e-infinity) #real) ($check equal? (* . #0=(1 . #0#)) 1) ($check equal? (* . #0=(2 . #0#)) #e+infinity) ($check equal? (* . #0=(1/2 . #0#)) 0) -;---- ($check equal? (* . #0=(1/2 2 . #0#)) #real) ; FAIL -;---- ($check equal? (* . #0=(-1 . #0#)) #real) ; FAIL +($check equal? (* . #0=(1/2 2 . #0#)) #real) +($check equal? (* . #0=(-1 . #0#)) #real) ;; 12.5.5 - @@ -163,6 +158,11 @@ ;; If real2 is negative, then such integer n does not exist. ;; interpretation : result shall be #undefined ;; +;; I followed Scheme r6rs and r7rs draft here. The definition in the +;; Kernel report didn't make much sense to me. I'm still waiting the +;; next installement of the report to see if this is changed. +;; +;; Andres Navarro ;--- ($check equal? (div 10 -7) #undefined) ; FAIL ;--- ($check equal? (div -10 -7) #undefined) ; FAIL @@ -249,7 +249,7 @@ ;; negative infinity (...)" ;; ;; Andres Navarro -;; ($check-predicate (robust? 3.14)) ; FAIL +;; was ($check-predicate (robust? 3.14)) ; FAIL ($check-not-predicate (robust? #real)) ($check-not-predicate (robust? #undefined)) @@ -348,7 +348,7 @@ ($check equal? (round 0) 0) ($check equal? (round 1/2) 0) -;-- ($check equal? (round 1.1) 1) ; FREEZES INTERPRETER +;($check equal? (round 1.1) 1) ; FREEZES INTERPRETER ($check equal? (round 3/2) 2) ;--($check equal? (round 1.9) 2) ($check equal? (round -1/2) 0)