From b55ff7670194e5464cd8e26204da09782a128a8f Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 24 Oct 2016 01:41:39 +0000 Subject: [PATCH] Issue #112 - Final version of the reader --- scheme/read.sld | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scheme/read.sld b/scheme/read.sld index 46956f50..7dbcfad9 100644 --- a/scheme/read.sld +++ b/scheme/read.sld @@ -532,14 +532,13 @@ (define (parse-atom a) (if (token-numeric? a) (string->number (list->string a)) - (let ((atom (string->symbol (list->string a)))) - (if (or (eq? atom +inf.0) - (eq? atom -inf.0)) - (expt 2 1000000) - (if (or (eq? atom +nan.0) - (eq? atom -nan.0)) - (/ 0.0 0.0) - atom))))) + (if (or (equal? a '(#\+ #\i #\n #\f #\. #\0)) + (equal? a '(#\- #\i #\n #\f #\. #\0))) + (expt 2 1000000) + (if (or (equal? a '(#\+ #\n #\a #\n #\. #\0)) + (equal? a '(#\- #\n #\a #\n #\. #\0))) + (/ 0.0 0.0) + (string->symbol (list->string a)))))) ;;;;; ;; Read next character from port, using buffered char if available