From: Tim Vaughan Date: Tue, 5 Jul 2016 06:40:49 +0000 (+0200) Subject: Almost done with characters. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=05e51ddd2d399b1a5c512aa355618a7d044e393f;p=scheme.forth.jl.git Almost done with characters. --- diff --git a/scheme.4th b/scheme.4th index ea02cd5..a4e2d07 100644 --- a/scheme.4th +++ b/scheme.4th @@ -134,11 +134,13 @@ parse-idx-stack parse-idx-sp ! ; : str-equiv? ( str -- bool ) + push-parse-idx - true + true -rot swap dup rot + swap + do i @ nextchar <> if drop false @@ -148,7 +150,7 @@ parse-idx-stack parse-idx-sp ! inc-parse-idx loop - delim? <> if drop false then + delim? false = if drop false then pop-parse-idx ; @@ -252,6 +254,7 @@ parse-idx-stack parse-idx-sp ! : self-evaluating? ( obj -- obj bool ) number-type istype? if true exit then boolean-type istype? if true exit then + character-type istype? if true exit then false ; : eval @@ -281,7 +284,11 @@ parse-idx-stack parse-idx-sp ! 9 of ." #\tab" endof bl of ." #\space" endof '\n' of ." #\newline" endof + + ." #\" emit endcase + + trace ; : print ( obj -- )