\r
- flushing optimization\r
- compile-byte/cell: instantiating aliens\r
-- changing a word to be 'inline' after it was already defined doesn't\r
- work properly\r
- inference needs to be more robust with heavily recursive code\r
- fix fixnum<< and /i overflow on PowerPC\r
- simplifier:\r
\r
+ kernel:\r
\r
-- split, group: return vectors\r
+- split: return vectors\r
- specialized arrays\r
- clear special word props when redefining words\r
- there is a problem with hashcodes of words and bootstrapping\r
! The make-list form creates a boot quotation
[
+ [
+ [ hashtable? ] instances
+ [ dup hash-size 1 max swap set-bucket-count ] each
+
+ boot
+ ] %
+
{
"/version.factor"
"/library/generic/generic.factor"
"/library/generic/standard-combination.factor"
"/library/generic/slots.factor"
- "/library/generic/object.factor"
- "/library/generic/null.factor"
"/library/generic/math-combination.factor"
"/library/generic/predicate.factor"
"/library/generic/union.factor"
"/library/bootstrap/init.factor"
} [ dup print parse-resource % ] each
- [
- boot
-
- "Rehashing hash tables..." print
-
- [ hashtable? ] instances
- [ dup hash-size 1 max swap set-bucket-count ] each
-
- "/library/bootstrap/boot-stage2.factor" run-resource
- ] %
+ [ "/library/bootstrap/boot-stage2.factor" run-resource ] %
] make-list
vocabularies get [
! generate the minimal image, and writing the cons cells, words,
! strings etc to the image file in the CFactor object memory
! format.
-!
-! What is a bootstrap image? It basically contains enough code
-! to parse a source file. See platform/native/boot.factor --
-! It initializes the core interpreter services, and proceeds to
-! run platform/native/boot-stage2.factor.
IN: image
USING: errors generic hashtables kernel lists
! Object cache
SYMBOL: objects
-! Boot quotation, set by boot.factor
-SYMBOL: boot-quot
-
! Image output format
SYMBOL: big-endian
SYMBOL: 64-bits
] make-hash '
global-offset fixup ;
-: boot, ( quot -- )
- boot-quot get swap append ' boot-quot-offset fixup ;
+: boot, ( quot -- ) ' boot-quot-offset fixup ;
: heap-size image get length header-size - cell * ;
: make-image ( name -- )
#! Make a bootstrap image.
[
- boot-quot off
"/library/bootstrap/boot-stage1.factor" run-resource
+ namespace global [ "foobar" set ] bind
] with-image
swap write-image ;
define-slots
register-builtin ;
-! Hack
-{{ [[ { } null ]] }} typemap set
-
+<namespace> typemap set
num-types empty-vector builtins set
+! Catch-all metaclass for providing a default method.
+object num-types >vector "types" set-word-prop
+object [ drop t ] "predicate" set-word-prop
+object object define-class
+
+! Null metaclass with no instances.
+null { } "types" set-word-prop
+null [ drop f ] "predicate" set-word-prop
+null null define-class
+
"fixnum" "math" create 0 "fixnum?" "math" create { } define-builtin
"fixnum" "math" create 0 "math-priority" set-word-prop
"fixnum" "math" create ">fixnum" [ "math" ] search unit "coercer" set-word-prop
: define-class ( class metaclass -- )
dupd "metaclass" set-word-prop
dup types [ - ] sort typemap get set-hash ;
-
-typemap get [ <namespace> typemap set ] unless
+++ /dev/null
-! Copyright (C) 2004, 2005 Slava Pestov.
-! See http://factor.sf.net/license.txt for BSD license.
-IN: generic
-USING: kernel words ;
-
-! Null metaclass with no instances.
-null { } "types" set-word-prop
-null [ drop f ] "predicate" set-word-prop
-null null define-class
+++ /dev/null
-! Copyright (C) 2004, 2005 Slava Pestov.
-! See http://factor.sf.net/license.txt for BSD license.
-IN: generic
-USING: kernel lists math sequences vectors words ;
-
-! Catch-all metaclass for providing a default method.
-object num-types >vector "types" set-word-prop
-object [ drop t ] "predicate" set-word-prop
-object object define-class
: error-method ( picker word -- method )
[ swap % literalize , \ no-method , ] make-list ;
-DEFER: delegate
-
: empty-method ( picker word -- method )
over [ dup ] = [
[
! word does when invoked.
: define ( word primitive parameter -- )
- pick uncrossref
- pick set-word-def
- swap set-word-primitive ;
+ pick uncrossref pick set-word-def swap set-word-primitive ;
GENERIC: definer ( word -- word )
#! Return the parsing word that defined this word.
: reset-generic ( word -- )
#! Make a word no longer be generic.
- { "methods" "combination" "picker" } reset-props ;
+ { "methods" "combination" } reset-props ;
: define-compound ( word def -- )
over reset-generic (define-compound) ;