make-type character-type
make-type string-type
make-type nil-type
+make-type none-type
make-type pair-type
make-type symbol-type
make-type primitive-proc-type
: nil 0 nil-type ;
: nil? nil-type istype? ;
+: none 0 none-type ;
+: none? none-type istype? ;
+
: objvar create nil swap , , ;
: value@ ( objvar -- val ) @ ;
character-type istype? if true exit then
string-type istype? if true exit then
nil-type istype? if true exit then
+ none-type istype? if true exit then
false
;
2swap ( env explist )
\ Abort on empty list
- 2dup nil objeq? if 2swap exit then
+ 2dup nil objeq? if
+ 2drop none
+ 2swap exit
+ then
begin
2dup cdr ( env explist nextexplist )
then
begin? if
- \ TODO
+ begin-actions 2swap
+ eval-sequence
+ ['] eval goto-deferred
then
application? if
: printcomp ( primobj -- )
2drop ." <compound procedure>" ;
+: printnone ( noneobj -- )
+ 2drop ." Unspecified return value" ;
+
:noname ( obj -- )
fixnum-type istype? if printfixnum exit then
realnum-type istype? if printrealnum exit then
pair-type istype? if ." (" printpair ." )" exit then
primitive-proc-type istype? if printprim exit then
compound-proc-type istype? if printcomp exit then
+ none-type istype? if printnone exit then
bold fg red ." Error printing expression - unrecognized type. Aborting" reset-term cr
abort