More module system hackery

darcs
slava 2006-06-19 01:31:20 +00:00
parent 6368e3b4d1
commit 1e2dcfae12
17 changed files with 40 additions and 26 deletions

View File

@ -1,3 +1,3 @@
REQUIRE: crypto ;
REQUIRES: crypto ;
PROVIDE: aim { "net-bytes.factor" "aim.factor" } ;

View File

@ -1,10 +1,10 @@
USING: modules words ;
USING: kernel modules words ;
REQUIRE: aim cairo concurrency coroutines crypto dlists
REQUIRES: aim cairo concurrency coroutines crypto dlists
embedded gap-buffer httpd math postgresql process random-tester
splay-trees sqlite units ;
"x11" vocab [
"factory" require
"x11" require
]
"factory" (require)
"x11" (require)
] when

View File

@ -1,5 +1,7 @@
! Copyright (C) 2006 Eduardo Cavazos.
REQUIRES: slate ;
USING: parser kernel hashtables namespaces sequences math io
math-contrib threads strings arrays prettyprint gadgets slate ;
@ -129,4 +131,6 @@ interesting get random-item set-rule 1000 sleep run-rule ;
: automata-gallery ( -- )
<slate> dup self set open-window 1000 sleep init-interesting init-rule
random-interesting-gallery ;
random-interesting-gallery ;
PROVIDE: automata ;

View File

@ -2,6 +2,8 @@
! To run the demo do: USE: boids boids-go
REQUIRES: slate ;
USING: generic threads namespaces math kernel sequences arrays gadgets slate ;
IN: boids
@ -278,3 +280,5 @@ iterate-boids draw-boids 1 sleep run-boids ;
! : execute-with ( item [ word word ... ] -- results ... )
! [ over >r execute r> ] each drop ;
PROVIDE: boids ;

View File

@ -2,4 +2,4 @@ USING: alien ;
"cairo" "libcairo" add-simple-library
PROVIDE: cairo { "/contrib/cairo/cairo.factor" } ;
PROVIDE: cairo { "cairo.factor" } ;

View File

@ -1,4 +1,4 @@
REQUIRE: dlists ;
REQUIRES: dlists ;
PROVIDE: concurrency
{ "concurrency.factor" }

View File

@ -1,4 +1,4 @@
REQUIRE: math ;
REQUIRES: math ;
PROVIDE: crypto {
"common.factor"

View File

@ -1,3 +1,3 @@
REQUIRE: process concurrency x11 ;
REQUIRES: process concurrency x11 ;
PROVIDE: factory { "factory.factor" } ;

View File

@ -11,14 +11,13 @@ PROVIDE: httpd {
"callback-responder.factor"
"prototype-js.factor"
"html.factor"
"embedded.factor"
"file-responder.factor"
"help-responder.factor"
"inspect-responder.factor"
"browser-responder.factor"
"default-responders.factor"
"http-client.factor"
} {
"test/html.factor"
"test/http-client.factor"
"test/httpd.factor"

View File

@ -3,5 +3,5 @@ USING: alien ;
"postgresql" "libpq" add-simple-library
PROVIDE: postgresql
{ "libpq" "postgresql" }
{ "libpq.factor" "postgresql.factor" }
{ "postgresql-test" } ;

View File

@ -78,4 +78,6 @@ GL_LINES glBegin first2 glVertex2f first2 glVertex2f glEnd ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: reset-slate ( -- ) [ ] set-action reset-dlist ;
: reset-slate ( -- ) [ ] set-action reset-dlist ;
PROVIDE: slate ;

View File

@ -31,7 +31,6 @@
IN: sqlite
USE: kernel
USE: alien
USE: compiler
USE: errors
USE: strings
USE: namespaces
@ -258,6 +257,3 @@ END-STRUCT
: sqlite-map ( statement quot -- )
[ ] (sqlite-map) ;
{ "sqlite" } compile-vocabs

View File

@ -3,7 +3,7 @@
#! "contrib/httpd/embedded.factor" run-file
#! "contrib/vim/load.factor" run-file
REQUIRE: embedded ;
REQUIRES: embedded ;
USING: embedded io ;

View File

@ -1,4 +1,4 @@
REQUIRE: concurrency ;
REQUIRES: concurrency ;
PROVIDE: x11 {
"rectangle.factor" "x.factor" "draw-string.factor" "concurrent-widgets.factor" "gl.factor"

View File

@ -117,7 +117,6 @@ vectors words ;
"/library/test/test.factor"
"/library/modules.factor"
"/library/threads.factor"
"/library/io/server.factor"
@ -158,6 +157,7 @@ vectors words ;
"/library/io/buffer.factor"
"/library/cli.factor"
"/library/modules.factor"
"/library/bootstrap/init.factor"
"/library/bootstrap/image.factor"

View File

@ -1,7 +1,8 @@
! Copyright (C) 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
IN: modules
USING: hashtables io kernel namespaces parser sequences words ;
USING: compiler hashtables io kernel namespaces parser sequences
words ;
TUPLE: module name files tests ;
@ -26,7 +27,7 @@ H{ } clone modules set-global
: module modules get hash ;
: require ( name -- )
: (require) ( name -- )
dup module [
drop
] [
@ -34,6 +35,10 @@ H{ } clone modules set-global
module-def run-resource
] if ;
: require ( name -- )
[ \ require on (require) ] with-scope
\ require get [ compile-all ] unless ;
: run-resources ( seq -- )
bootstrapping? get
[ parse-resource % ] [ run-resource ] ? each ;
@ -47,3 +52,5 @@ H{ } clone modules set-global
: reload-module ( name -- ) module load-module ;
: test-module ( name -- ) module module-tests run-resources ;
: test-modules ( -- ) modules hash-keys [ test-module ] each ;

View File

@ -73,6 +73,8 @@ DEFER: PRIMITIVE: parsing
: PROVIDE:
scan [ { { } { } } append first2 provide ] f ; parsing
: REQUIRE:
: REQUIRE: scan require ; parsing
: REQUIRES:
string-mode on
[ string-mode off [ require ] each ] f ; parsing
[ string-mode off [ (require) ] each ] f ; parsing