More module system work

slava 2006-09-06 21:19:41 +00:00
parent b4291dd6c6
commit b47d1d79fb
16 changed files with 43 additions and 14 deletions

View File

@ -1,5 +1,6 @@
+ 0.85:
- C+S+END doesn't work
- \ <buffer> help --> shows infer-effect
- pane output in UI should use less memory
- signal 4 on datastack underflow on mac intel??

View File

@ -1,6 +1,6 @@
! Simple IRC bot written in Factor.
REQUIRES: httpd ;
REQUIRES: contrib/httpd ;
USING: errors generic hashtables help html http io kernel math
memory namespaces parser prettyprint sequences strings threads
@ -110,3 +110,5 @@ IN: factorbot-commands
: quit ( text -- )
drop speaker get "slava" = [ disconnect ] when ;
PROVIDE: examples/factorbot ;

View File

@ -14,3 +14,5 @@ USING: sequences kernel math io ;
3 [ 2dup lcd-row terpri ] repeat drop ;
"31337" lcd
PROVIDE: examples/lcd ;

View File

@ -59,3 +59,5 @@ SYMBOL: costs
second [ word-name ] keep [ help ] write-outliner
terpri
] each ;
PROVIDE: examples/levenshtein ;

View File

@ -114,6 +114,6 @@ SYMBOL: cols
"Generating " write dup write "..." print
<file-writer> [ run write ] with-stream ;
\ render compile
[ "mandel.pnm" run>file ] time
PROVIDE: examples/mandel ;

View File

@ -23,3 +23,5 @@ USING: kernel math parser io ;
[ numbers-game-loop ] [ drop ] if ;
: numbers-game number-to-guess numbers-game-loop ;
PROVIDE: examples/numbers-game ;

View File

@ -161,6 +161,6 @@ DEFER: create ( level c r -- scene )
"Generating " write dup write "..." print
<file-writer> [ run write ] with-stream ;
\ run compile
[ "raytracer.pnm" run>file ] time
PROVIDE: examples/raytracer ;

View File

@ -68,3 +68,5 @@ SYMBOL: tape
: n
#! Do one step and print new state.
turing-step c ;
PROVIDE: examples/turing ;

View File

@ -292,7 +292,7 @@ M: hashtable '
{
vocabularies typemap builtins c-types crossref
articles parent-graph term-index changed-words
class<map
modules class<map
} [ dup get swap bootstrap-word set ] each
] make-hash '
global-offset fixup ;

View File

@ -2,8 +2,8 @@
! See http://factorcode.org/license.txt for BSD license.
IN: image
USING: alien arrays generic hashtables help io kernel
kernel-internals math namespaces parser sequences strings
vectors words ;
kernel-internals math modules namespaces parser sequences
strings vectors words ;
! Some very tricky code creating a bootstrap embryo in the
! host image.
@ -18,6 +18,7 @@ H{ } clone c-types set
H{ } clone vocabularies set
H{ } clone class<map set
H{ } clone modules set
vocabularies get [ "syntax" set ] bind

View File

@ -0,0 +1,7 @@
REQUIRES: library/compiler/x86 library/compiler/pentium4 ;
PROVIDE: library/compiler/amd64 {
"architecture.factor"
"alien.factor"
"intrinsics.factor"
} ;

View File

@ -0,0 +1,3 @@
REQUIRES: library/compiler/x86 ;
PROVIDE: library/compiler/pentium4 { "intrinsics.factor" } ;

View File

@ -0,0 +1,5 @@
PROVIDE: library/compiler/ppc {
"assembler.factor"
"architecture.factor"
"intrinsics.factor"
} ;

View File

@ -0,0 +1,5 @@
PROVIDE: library/compiler/x86 {
"assembler.factor"
"architecture.factor"
"intrinsics.factor"
} ;

View File

@ -20,8 +20,6 @@ C: module ( name files tests -- module )
SYMBOL: modules
H{ } clone modules set-global
: module modules get hash ;
: load-module ( name -- )
@ -35,10 +33,6 @@ H{ } clone modules set-global
: require ( name -- ) (require) recompile ;
: contrib ( name -- ) "contrib/" swap append require ;
: example ( name -- ) "examples/" swap append require ;
: run-resources ( seq -- )
[
bootstrapping? get
@ -58,3 +52,6 @@ H{ } clone modules set-global
: test-module ( name -- ) module module-tests run-resources ;
: test-modules ( -- ) modules hash-keys [ test-module ] each ;
: modules. ( -- )
modules get hash-keys natural-sort [ print ] each ;