+
+ eof? if
+ bold fg blue ." Moriturus te saluto." reset-term ." ok" cr
+ quit
+ then
+
+ bold fg red ." Error parsing string starting at character '"
+ nextchar emit
+ ." '. Aborting." reset-term cr
+ abort
+
+; is read
+
+\ ---- Eval ----
+
+: 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
+ string-type istype? if true exit then
+ nil-type istype? if true exit then
+ false ;
+
+: eval
+ \ self-evaluating? if
+ \ exit
+ \ then
+ exit
+
+ bold fg red ." Error evaluating expression - unrecognized type. Aborting." reset-term cr
+ abort
+;
+
+\ ---- Print ----
+
+: printnum ( numobj -- ) drop 0 .R ;
+
+: printbool ( numobj -- )
+ drop if
+ ." #t"
+ else
+ ." #f"
+ then