Added draft readflonum.
[scheme.forth.jl.git] / src / scheme.4th
index c1d42e8..c448b02 100644 (file)
@@ -853,7 +853,7 @@ parse-idx-stack parse-idx-sp !
 : string? ( -- bool )
     nextchar [char] " = ;
 
-: readfixnum ( -- num-atom )
+: readfixnum ( -- fixnum )
     plus? minus? or if
         minus?
         inc-parse-idx
@@ -873,6 +873,26 @@ parse-idx-stack parse-idx-sp !
     fixnum-type
 ;
 
+: readflonum ( -- flonum )
+    \ DRAFT!!!
+    readfixnum drop i->f
+
+    [char] . netchar = if
+        10 i->f
+        begin digit? while
+            nextchar [char] 0 - i->f over f/ f+
+            inc-parse-idx
+        repeat
+    then
+
+    [char] e nextchar = [char] E nextchar = or if
+        readfixnum drop i->f
+        f^
+    then
+
+    flonum-type
+;
+
 : readbool ( -- bool-obj )
     inc-parse-idx