Added .(, ." no longer applies in immediate mode.
authorTim Vaughan <tgvaughan@gmail.com>
Mon, 2 May 2016 11:44:46 +0000 (23:44 +1200)
committerTim Vaughan <tgvaughan@gmail.com>
Mon, 2 May 2016 11:44:46 +0000 (23:44 +1200)
src/lib.4th

index 9e40b2d..38a8d14 100644 (file)
 ;
 
 : ." IMMEDIATE          ( -- )
-        STATE @ IF      ( compiling? )
-                [COMPILE] S"    ( read the string, and compile LITSTRING, etc. )
-                ['] TELL ,        ( compile the final TELL )
-        ELSE
-                ( In immediate mode, just read characters and print them until we get
-                  to the ending double quote. )
-                KEY DROP
-                BEGIN
-                        KEY
-                        DUP '"' = IF
-                                DROP    ( drop the double quote character )
-                                EXIT    ( return from this function )
-                        THEN
-                        EMIT
-                AGAIN
-        THEN
+        [COMPILE] S"    ( read the string, and compile LITSTRING, etc. )
+        ['] TELL ,      ( compile the final TELL )
+;
+
+: .( 
+        KEY DROP
+        BEGIN
+                KEY
+                DUP ')' = IF
+                        DROP    ( drop the double quote character )
+                        EXIT    ( return from this function )
+                THEN
+                EMIT
+        AGAIN
 ;