2005-01-29 16:39:30 -05:00
|
|
|
! Copyright (C) 2004, 2005 Slava Pestov.
|
|
|
|
! See http://factor.sf.net/license.txt for BSD license.
|
2004-12-15 16:57:29 -05:00
|
|
|
IN: image
|
2005-12-25 22:18:25 -05:00
|
|
|
USING: alien arrays generic hashtables help io kernel
|
2005-12-13 17:33:58 -05:00
|
|
|
kernel-internals lists math namespaces parser sequences strings
|
|
|
|
vectors words ;
|
2005-08-19 21:46:12 -04:00
|
|
|
|
|
|
|
! Some very tricky code creating a bootstrap embryo in the
|
|
|
|
! host image.
|
2005-07-31 23:38:33 -04:00
|
|
|
|
2005-12-16 21:12:35 -05:00
|
|
|
"Creating primitives and basic runtime structures..." print flush
|
2004-12-15 16:57:29 -05:00
|
|
|
|
2005-12-13 17:33:58 -05:00
|
|
|
H{ } clone c-types set
|
|
|
|
"/library/alien/primitive-types.factor" parse-resource
|
|
|
|
|
2005-08-22 15:33:18 -04:00
|
|
|
! These symbols need the same hashcode in the target as in the
|
2005-04-10 18:58:30 -04:00
|
|
|
! host.
|
2005-12-25 22:18:25 -05:00
|
|
|
{
|
|
|
|
vocabularies typemap builtins c-types
|
|
|
|
cell crossref articles terms
|
|
|
|
}
|
2005-04-10 18:58:30 -04:00
|
|
|
|
2004-12-15 16:57:29 -05:00
|
|
|
! Bring up a bare cross-compiling vocabulary.
|
2005-08-22 15:33:18 -04:00
|
|
|
"syntax" vocab
|
2004-12-15 16:57:29 -05:00
|
|
|
|
2005-10-29 23:25:38 -04:00
|
|
|
H{ } clone vocabularies set
|
2005-12-25 22:18:25 -05:00
|
|
|
H{ } clone articles set
|
|
|
|
H{ } clone terms set
|
|
|
|
|
2005-12-10 01:02:13 -05:00
|
|
|
crossref off
|
2005-03-07 22:11:36 -05:00
|
|
|
|
2005-08-22 15:33:18 -04:00
|
|
|
vocabularies get [ "syntax" set [ reveal ] each ] bind
|
2004-12-15 16:57:29 -05:00
|
|
|
|
2005-12-13 17:33:58 -05:00
|
|
|
! Call the quotation parsed from primitive-types.factor
|
|
|
|
call
|
|
|
|
|
2005-10-29 23:25:38 -04:00
|
|
|
: make-primitive ( { vocab word } n -- )
|
2006-01-06 02:04:42 -05:00
|
|
|
>r first2 create f r> define ;
|
2005-04-07 20:02:59 -04:00
|
|
|
|
2005-10-29 23:25:38 -04:00
|
|
|
{
|
|
|
|
{ "execute" "words" }
|
|
|
|
{ "call" "kernel" }
|
|
|
|
{ "if" "kernel" }
|
|
|
|
{ "dispatch" "kernel-internals" }
|
|
|
|
{ "cons" "lists" }
|
|
|
|
{ "<vector>" "vectors" }
|
|
|
|
{ "rehash-string" "strings" }
|
|
|
|
{ "<sbuf>" "strings" }
|
|
|
|
{ ">fixnum" "math" }
|
|
|
|
{ ">bignum" "math" }
|
|
|
|
{ ">float" "math" }
|
|
|
|
{ "(fraction>)" "math-internals" }
|
|
|
|
{ "string>float" "math-internals" }
|
|
|
|
{ "float>string" "math-internals" }
|
|
|
|
{ "float>bits" "math" }
|
|
|
|
{ "double>bits" "math" }
|
|
|
|
{ "bits>float" "math" }
|
|
|
|
{ "bits>double" "math" }
|
|
|
|
{ "<complex>" "math-internals" }
|
|
|
|
{ "fixnum+" "math-internals" }
|
|
|
|
{ "fixnum-" "math-internals" }
|
|
|
|
{ "fixnum*" "math-internals" }
|
|
|
|
{ "fixnum/i" "math-internals" }
|
|
|
|
{ "fixnum/f" "math-internals" }
|
|
|
|
{ "fixnum-mod" "math-internals" }
|
|
|
|
{ "fixnum/mod" "math-internals" }
|
|
|
|
{ "fixnum-bitand" "math-internals" }
|
|
|
|
{ "fixnum-bitor" "math-internals" }
|
|
|
|
{ "fixnum-bitxor" "math-internals" }
|
|
|
|
{ "fixnum-bitnot" "math-internals" }
|
|
|
|
{ "fixnum-shift" "math-internals" }
|
|
|
|
{ "fixnum<" "math-internals" }
|
|
|
|
{ "fixnum<=" "math-internals" }
|
|
|
|
{ "fixnum>" "math-internals" }
|
|
|
|
{ "fixnum>=" "math-internals" }
|
|
|
|
{ "bignum=" "math-internals" }
|
|
|
|
{ "bignum+" "math-internals" }
|
|
|
|
{ "bignum-" "math-internals" }
|
|
|
|
{ "bignum*" "math-internals" }
|
|
|
|
{ "bignum/i" "math-internals" }
|
|
|
|
{ "bignum/f" "math-internals" }
|
|
|
|
{ "bignum-mod" "math-internals" }
|
|
|
|
{ "bignum/mod" "math-internals" }
|
|
|
|
{ "bignum-bitand" "math-internals" }
|
|
|
|
{ "bignum-bitor" "math-internals" }
|
|
|
|
{ "bignum-bitxor" "math-internals" }
|
|
|
|
{ "bignum-bitnot" "math-internals" }
|
|
|
|
{ "bignum-shift" "math-internals" }
|
|
|
|
{ "bignum<" "math-internals" }
|
|
|
|
{ "bignum<=" "math-internals" }
|
|
|
|
{ "bignum>" "math-internals" }
|
|
|
|
{ "bignum>=" "math-internals" }
|
|
|
|
{ "float=" "math-internals" }
|
|
|
|
{ "float+" "math-internals" }
|
|
|
|
{ "float-" "math-internals" }
|
|
|
|
{ "float*" "math-internals" }
|
|
|
|
{ "float/f" "math-internals" }
|
|
|
|
{ "float<" "math-internals" }
|
|
|
|
{ "float<=" "math-internals" }
|
|
|
|
{ "float>" "math-internals" }
|
|
|
|
{ "float>=" "math-internals" }
|
|
|
|
{ "facos" "math-internals" }
|
|
|
|
{ "fasin" "math-internals" }
|
|
|
|
{ "fatan" "math-internals" }
|
|
|
|
{ "fatan2" "math-internals" }
|
|
|
|
{ "fcos" "math-internals" }
|
|
|
|
{ "fexp" "math-internals" }
|
|
|
|
{ "fcosh" "math-internals" }
|
|
|
|
{ "flog" "math-internals" }
|
|
|
|
{ "fpow" "math-internals" }
|
|
|
|
{ "fsin" "math-internals" }
|
|
|
|
{ "fsinh" "math-internals" }
|
|
|
|
{ "fsqrt" "math-internals" }
|
|
|
|
{ "<word>" "words" }
|
|
|
|
{ "update-xt" "words" }
|
|
|
|
{ "compiled?" "words" }
|
|
|
|
{ "drop" "kernel" }
|
|
|
|
{ "2drop" "kernel" }
|
|
|
|
{ "3drop" "kernel" }
|
|
|
|
{ "dup" "kernel" }
|
|
|
|
{ "2dup" "kernel" }
|
|
|
|
{ "3dup" "kernel" }
|
|
|
|
{ "rot" "kernel" }
|
|
|
|
{ "-rot" "kernel" }
|
|
|
|
{ "dupd" "kernel" }
|
|
|
|
{ "swapd" "kernel" }
|
|
|
|
{ "nip" "kernel" }
|
|
|
|
{ "2nip" "kernel" }
|
|
|
|
{ "tuck" "kernel" }
|
|
|
|
{ "over" "kernel" }
|
|
|
|
{ "pick" "kernel" }
|
|
|
|
{ "swap" "kernel" }
|
|
|
|
{ ">r" "kernel" }
|
|
|
|
{ "r>" "kernel" }
|
|
|
|
{ "eq?" "kernel" }
|
|
|
|
{ "getenv" "kernel-internals" }
|
|
|
|
{ "setenv" "kernel-internals" }
|
|
|
|
{ "stat" "io" }
|
|
|
|
{ "(directory)" "io" }
|
|
|
|
{ "gc" "memory" }
|
|
|
|
{ "gc-time" "memory" }
|
|
|
|
{ "save-image" "memory" }
|
|
|
|
{ "datastack" "kernel" }
|
|
|
|
{ "callstack" "kernel" }
|
|
|
|
{ "set-datastack" "kernel" }
|
|
|
|
{ "set-callstack" "kernel" }
|
|
|
|
{ "exit" "kernel" }
|
|
|
|
{ "room" "memory" }
|
|
|
|
{ "os-env" "kernel" }
|
|
|
|
{ "millis" "kernel" }
|
|
|
|
{ "type" "kernel" }
|
|
|
|
{ "tag" "kernel-internals" }
|
|
|
|
{ "cwd" "io" }
|
|
|
|
{ "cd" "io" }
|
|
|
|
{ "compiled-offset" "assembler" }
|
|
|
|
{ "set-compiled-offset" "assembler" }
|
|
|
|
{ "literal-top" "assembler" }
|
|
|
|
{ "set-literal-top" "assembler" }
|
|
|
|
{ "address" "memory" }
|
|
|
|
{ "dlopen" "alien" }
|
|
|
|
{ "dlsym" "alien" }
|
|
|
|
{ "dlclose" "alien" }
|
|
|
|
{ "<alien>" "alien" }
|
|
|
|
{ "<byte-array>" "arrays" }
|
|
|
|
{ "<displaced-alien>" "alien" }
|
|
|
|
{ "alien-signed-cell" "alien" }
|
|
|
|
{ "set-alien-signed-cell" "alien" }
|
|
|
|
{ "alien-unsigned-cell" "alien" }
|
|
|
|
{ "set-alien-unsigned-cell" "alien" }
|
|
|
|
{ "alien-signed-8" "alien" }
|
|
|
|
{ "set-alien-signed-8" "alien" }
|
|
|
|
{ "alien-unsigned-8" "alien" }
|
|
|
|
{ "set-alien-unsigned-8" "alien" }
|
|
|
|
{ "alien-signed-4" "alien" }
|
|
|
|
{ "set-alien-signed-4" "alien" }
|
|
|
|
{ "alien-unsigned-4" "alien" }
|
|
|
|
{ "set-alien-unsigned-4" "alien" }
|
|
|
|
{ "alien-signed-2" "alien" }
|
|
|
|
{ "set-alien-signed-2" "alien" }
|
|
|
|
{ "alien-unsigned-2" "alien" }
|
|
|
|
{ "set-alien-unsigned-2" "alien" }
|
|
|
|
{ "alien-signed-1" "alien" }
|
|
|
|
{ "set-alien-signed-1" "alien" }
|
|
|
|
{ "alien-unsigned-1" "alien" }
|
|
|
|
{ "set-alien-unsigned-1" "alien" }
|
|
|
|
{ "alien-float" "alien" }
|
|
|
|
{ "set-alien-float" "alien" }
|
|
|
|
{ "alien-double" "alien" }
|
|
|
|
{ "set-alien-double" "alien" }
|
2005-12-12 18:51:45 -05:00
|
|
|
{ "alien>string" "alien" }
|
|
|
|
{ "string>alien" "alien" }
|
2005-10-29 23:25:38 -04:00
|
|
|
{ "throw" "errors" }
|
|
|
|
{ "string>memory" "kernel-internals" }
|
|
|
|
{ "memory>string" "kernel-internals" }
|
|
|
|
{ "alien-address" "alien" }
|
|
|
|
{ "slot" "kernel-internals" }
|
|
|
|
{ "set-slot" "kernel-internals" }
|
|
|
|
{ "integer-slot" "kernel-internals" }
|
|
|
|
{ "set-integer-slot" "kernel-internals" }
|
|
|
|
{ "char-slot" "kernel-internals" }
|
|
|
|
{ "set-char-slot" "kernel-internals" }
|
|
|
|
{ "resize-array" "arrays" }
|
|
|
|
{ "resize-string" "strings" }
|
2005-11-27 17:45:48 -05:00
|
|
|
{ "(hashtable)" "hashtables-internals" }
|
2005-10-29 23:25:38 -04:00
|
|
|
{ "<array>" "arrays" }
|
|
|
|
{ "<tuple>" "kernel-internals" }
|
|
|
|
{ "begin-scan" "memory" }
|
|
|
|
{ "next-object" "memory" }
|
|
|
|
{ "end-scan" "memory" }
|
|
|
|
{ "size" "memory" }
|
|
|
|
{ "die" "kernel" }
|
|
|
|
{ "flush-icache" "assembler" }
|
|
|
|
{ "fopen" "io-internals" }
|
|
|
|
{ "fgetc" "io-internals" }
|
|
|
|
{ "fwrite" "io-internals" }
|
|
|
|
{ "fflush" "io-internals" }
|
|
|
|
{ "fclose" "io-internals" }
|
|
|
|
{ "expired?" "alien" }
|
|
|
|
{ "<wrapper>" "kernel" }
|
|
|
|
{ "(clone)" "kernel-internals" }
|
2006-01-09 17:56:19 -05:00
|
|
|
{ "array>tuple" "kernel-internals" }
|
2005-10-29 23:25:38 -04:00
|
|
|
{ "tuple>array" "generic" }
|
|
|
|
{ "array>vector" "vectors" }
|
2005-12-24 18:29:31 -05:00
|
|
|
{ "<string>" "strings" }
|
2005-10-29 23:25:38 -04:00
|
|
|
} dup length 3 swap [ + ] map-with [ make-primitive ] 2each
|
|
|
|
|
2005-04-07 20:02:59 -04:00
|
|
|
FORGET: make-primitive
|
2005-08-19 21:46:12 -04:00
|
|
|
|
|
|
|
! Okay, now we have primitives fleshed out. Bring up the generic
|
|
|
|
! word system.
|
|
|
|
: builtin-predicate ( class predicate -- )
|
2005-09-09 16:45:18 -04:00
|
|
|
[
|
2005-09-16 02:39:33 -04:00
|
|
|
over "type" word-prop dup
|
2005-09-09 16:45:18 -04:00
|
|
|
tag-mask < \ tag \ type ? , , \ eq? ,
|
2005-09-09 22:34:24 -04:00
|
|
|
] [ ] make define-predicate ;
|
2005-08-19 21:46:12 -04:00
|
|
|
|
|
|
|
: register-builtin ( class -- )
|
2005-09-16 02:39:33 -04:00
|
|
|
dup "type" word-prop builtins get set-nth ;
|
2005-08-19 21:46:12 -04:00
|
|
|
|
|
|
|
: define-builtin ( symbol type# predicate slotspec -- )
|
|
|
|
>r >r >r
|
|
|
|
dup intern-symbol
|
2005-09-16 02:39:33 -04:00
|
|
|
dup r> "type" set-word-prop
|
|
|
|
dup define-class
|
2005-08-19 21:46:12 -04:00
|
|
|
dup r> builtin-predicate
|
|
|
|
dup r> intern-slots 2dup "slots" set-word-prop
|
|
|
|
define-slots
|
|
|
|
register-builtin ;
|
|
|
|
|
2005-10-29 23:25:38 -04:00
|
|
|
H{ } clone typemap set
|
2005-12-24 18:29:31 -05:00
|
|
|
num-types f <array> builtins set
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-16 02:39:33 -04:00
|
|
|
! These symbols are needed by the code that executes below
|
|
|
|
"object" "generic" create drop
|
|
|
|
"null" "generic" create drop
|
2005-08-22 16:01:13 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"fixnum?" "math" create t "inline" set-word-prop
|
2005-10-29 23:25:38 -04:00
|
|
|
"fixnum" "math" create 0 "fixnum?" "math" create { } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
"fixnum" "math" create 0 "math-priority" set-word-prop
|
2005-12-17 14:52:27 -05:00
|
|
|
"fixnum" "math" create ">fixnum" "math" lookup unit "coercer" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"bignum?" "math" create t "inline" set-word-prop
|
2005-10-29 23:25:38 -04:00
|
|
|
"bignum" "math" create 1 "bignum?" "math" create { } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
"bignum" "math" create 1 "math-priority" set-word-prop
|
2005-12-17 14:52:27 -05:00
|
|
|
"bignum" "math" create ">bignum" "math" lookup unit "coercer" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"cons?" "lists" create t "inline" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
"cons" "lists" create 2 "cons?" "lists" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ { 0 { "car" "lists" } f } { 1 { "cdr" "lists" } f } } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"ratio?" "math" create t "inline" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
"ratio" "math" create 4 "ratio?" "math" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ { 0 { "numerator" "math" } f } { 1 { "denominator" "math" } f } } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
"ratio" "math" create 2 "math-priority" set-word-prop
|
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"float?" "math" create t "inline" set-word-prop
|
2005-10-29 23:25:38 -04:00
|
|
|
"float" "math" create 5 "float?" "math" create { } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
"float" "math" create 3 "math-priority" set-word-prop
|
2005-12-17 14:52:27 -05:00
|
|
|
"float" "math" create ">float" "math" lookup unit "coercer" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"complex?" "math" create t "inline" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
"complex" "math" create 6 "complex?" "math" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ { 0 { "real" "math" } f } { 1 { "imaginary" "math" } f } } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
"complex" "math" create 4 "math-priority" set-word-prop
|
|
|
|
|
2005-10-29 23:25:38 -04:00
|
|
|
"displaced-alien" "alien" create 7 "displaced-alien?" "alien" create { } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-11 20:46:55 -04:00
|
|
|
"array?" "arrays" create t "inline" set-word-prop
|
|
|
|
"array" "arrays" create 8 "array?" "arrays" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
|
|
|
"f" "!syntax" create 9 "not" "kernel" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"hashtable?" "hashtables" create t "inline" set-word-prop
|
|
|
|
"hashtable" "hashtables" create 10 "hashtable?" "hashtables" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{
|
2005-11-27 17:45:48 -05:00
|
|
|
{ 1 { "hash-count" "hashtables" } { "set-hash-count" "hashtables-internals" } }
|
|
|
|
{ 2 { "hash-deleted" "hashtables" } { "set-hash-deleted" "hashtables-internals" } }
|
|
|
|
{ 3 { "underlying" "sequences-internals" } { "set-underlying" "sequences-internals" } }
|
2005-10-29 23:25:38 -04:00
|
|
|
} define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"vector?" "vectors" create t "inline" set-word-prop
|
|
|
|
"vector" "vectors" create 11 "vector?" "vectors" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{
|
|
|
|
{ 1 { "length" "sequences" } { "set-fill" "sequences-internals" } }
|
|
|
|
{ 2 { "underlying" "sequences-internals" } { "set-underlying" "sequences-internals" } }
|
|
|
|
} define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"string?" "strings" create t "inline" set-word-prop
|
|
|
|
"string" "strings" create 12 "string?" "strings" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{
|
|
|
|
{ 1 { "length" "sequences" } f }
|
2005-12-25 21:05:31 -05:00
|
|
|
{ 2 { "string-hashcode" "kernel-internals" } { "set-string-hashcode" "kernel-internals" } }
|
2005-10-29 23:25:38 -04:00
|
|
|
} define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"sbuf?" "strings" create t "inline" set-word-prop
|
|
|
|
"sbuf" "strings" create 13 "sbuf?" "strings" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{
|
|
|
|
{ 1 { "length" "sequences" } { "set-fill" "sequences-internals" } }
|
|
|
|
{ 2 { "underlying" "sequences-internals" } { "set-underlying" "sequences-internals" } }
|
|
|
|
} define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"wrapper?" "kernel" create t "inline" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
"wrapper" "kernel" create 14 "wrapper?" "kernel" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ { 1 { "wrapped" "kernel" } f } } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"dll?" "alien" create t "inline" set-word-prop
|
2005-08-19 21:46:12 -04:00
|
|
|
"dll" "alien" create 15 "dll?" "alien" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ { 1 { "dll-path" "alien" } f } } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"alien?" "alien" create t "inline" set-word-prop
|
2005-10-29 23:25:38 -04:00
|
|
|
"alien" "alien" create 16 "alien?" "alien" create { } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"word?" "words" create t "inline" set-word-prop
|
|
|
|
"word" "words" create 17 "word?" "words" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{
|
|
|
|
{ 1 { "hashcode" "kernel" } f }
|
|
|
|
{ 2 { "word-name" "words" } f }
|
|
|
|
{ 3 { "word-vocabulary" "words" } { "set-word-vocabulary" "words" } }
|
|
|
|
{ 4 { "word-primitive" "words" } { "set-word-primitive" "words" } }
|
|
|
|
{ 5 { "word-def" "words" } { "set-word-def" "words" } }
|
|
|
|
{ 6 { "word-props" "words" } { "set-word-props" "words" } }
|
|
|
|
} define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-09 22:34:24 -04:00
|
|
|
"tuple?" "kernel" create t "inline" set-word-prop
|
|
|
|
"tuple" "kernel" create 18 "tuple?" "kernel" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ } define-builtin
|
2005-08-19 21:46:12 -04:00
|
|
|
|
2005-09-11 20:46:55 -04:00
|
|
|
"byte-array?" "arrays" create t "inline" set-word-prop
|
|
|
|
"byte-array" "arrays" create 19
|
|
|
|
"byte-array?" "arrays" create
|
2005-10-29 23:25:38 -04:00
|
|
|
{ } define-builtin
|
2005-08-21 01:17:37 -04:00
|
|
|
|
2005-09-05 17:36:20 -04:00
|
|
|
! Define general-t type, which is any object that is not f.
|
|
|
|
"general-t" "kernel" create dup define-symbol
|
2005-09-09 22:34:24 -04:00
|
|
|
f "f" "!syntax" lookup builtins get remove [ ] subset
|
2005-09-05 17:36:20 -04:00
|
|
|
define-union
|
|
|
|
|
2005-09-16 02:39:33 -04:00
|
|
|
! Catch-all class for providing a default method.
|
|
|
|
"object" "generic" create [ drop t ] "predicate" set-word-prop
|
|
|
|
"object" "generic" create dup define-symbol
|
|
|
|
f builtins get [ ] subset define-union
|
|
|
|
|
|
|
|
! Null class with no instances.
|
|
|
|
"null" "generic" create [ drop f ] "predicate" set-word-prop
|
2005-10-29 23:25:38 -04:00
|
|
|
"null" "generic" create dup define-symbol f { } define-union
|
2005-09-16 02:39:33 -04:00
|
|
|
|
2005-08-19 21:46:12 -04:00
|
|
|
FORGET: builtin-predicate
|
|
|
|
FORGET: register-builtin
|
|
|
|
FORGET: define-builtin
|