X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;ds=sidebyside;f=scheme.4th;h=e1126ff0868bcc7a6bca3bdbefc1889d13a34ad1;hb=7c4b983db5c13783ed581b302becb7e8419123dc;hp=d93e722b1493323c2aac9254fd67332c3e122fd2;hpb=c91efd8c4adc50172e831c9cf22cc66cdc3fa6ad;p=scheme.forth.jl.git diff --git a/scheme.4th b/scheme.4th index d93e722..e1126ff 100644 --- a/scheme.4th +++ b/scheme.4th @@ -11,15 +11,23 @@ defer print \ ------ Types ------ -0 constant fixnum-type -1 constant boolean-type -2 constant character-type -3 constant string-type -4 constant nil-type -5 constant pair-type -6 constant symbol-type -7 constant primitive-proc-type -8 constant compound-proc-type +variable nexttype +0 nexttype ! +: make-type + create nexttype @ , + nexttype @ 1+ nexttype ! + does> @ ; + +make-type fixnum-type +make-type real-type +make-type boolean-type +make-type character-type +make-type string-type +make-type nil-type +make-type pair-type +make-type symbol-type +make-type primitive-proc-type +make-type compound-proc-type : istype? ( obj type -- obj bool ) over = ;