From 90e92c642041f4a3174c29373d2dc4d366d746e1 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Wed, 12 Oct 2016 23:20:57 +1300 Subject: [PATCH] Fixed broken realnum? procedure. --- scheme.4th | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scheme.4th b/scheme.4th index bac3283..46c2969 100644 --- a/scheme.4th +++ b/scheme.4th @@ -513,16 +513,16 @@ parse-idx-stack parse-idx-sp ! ; : realnum? ( -- bool ) - \ Record starting parse idx: - \ Want to detect whether any characters were eaten. - parse-idx @ - push-parse-idx minus? plus? or if inc-parse-idx then + \ Record starting parse idx: + \ Want to detect whether any characters (following +/-) were eaten. + parse-idx @ + begin digit? while inc-parse-idx repeat @@ -541,6 +541,10 @@ parse-idx-stack parse-idx-sp ! inc-parse-idx then + digit? invert if + drop pop-parse-idx false exit + then + begin digit? while inc-parse-idx repeat -- 2.20.1