From 6169ab10105a4124552fc75ce1022c3e17909b17 Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Sun, 24 May 2009 22:10:56 -0500 Subject: [PATCH] updated modules.util to use manifests --- extra/file-trees/file-trees.factor | 3 ++- extra/modules/using/tests/tests.factor | 4 ---- extra/modules/util/util.factor | 6 +++--- .../modules/remote-loading/authors.txt | 0 .../modules/remote-loading/remote-loading.factor | 0 .../modules/remote-loading/summary.txt | 0 {extra => unmaintained}/modules/rpc-server/authors.txt | 0 .../modules/rpc-server/rpc-server.factor | 2 +- {extra => unmaintained}/modules/rpc-server/summary.txt | 0 {extra => unmaintained}/modules/rpc/authors.txt | 0 {extra => unmaintained}/modules/rpc/rpc-docs.factor | 0 {extra => unmaintained}/modules/rpc/rpc.factor | 4 ++-- {extra => unmaintained}/modules/rpc/summary.txt | 0 {extra => unmaintained}/modules/uploads/authors.txt | 0 {extra => unmaintained}/modules/uploads/summary.txt | 0 {extra => unmaintained}/modules/uploads/uploads.factor | 0 {extra => unmaintained}/modules/using/authors.txt | 0 {extra => unmaintained}/modules/using/summary.txt | 0 {extra => unmaintained}/modules/using/tests/tags.txt | 0 .../modules/using/tests/test-server.factor | 0 unmaintained/modules/using/tests/tests.factor | 4 ++++ {extra => unmaintained}/modules/using/using-docs.factor | 5 +++-- {extra => unmaintained}/modules/using/using.factor | 8 ++++---- 23 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 extra/modules/using/tests/tests.factor rename {extra => unmaintained}/modules/remote-loading/authors.txt (100%) rename {extra => unmaintained}/modules/remote-loading/remote-loading.factor (100%) rename {extra => unmaintained}/modules/remote-loading/summary.txt (100%) rename {extra => unmaintained}/modules/rpc-server/authors.txt (100%) rename {extra => unmaintained}/modules/rpc-server/rpc-server.factor (91%) rename {extra => unmaintained}/modules/rpc-server/summary.txt (100%) rename {extra => unmaintained}/modules/rpc/authors.txt (100%) rename {extra => unmaintained}/modules/rpc/rpc-docs.factor (100%) rename {extra => unmaintained}/modules/rpc/rpc.factor (83%) rename {extra => unmaintained}/modules/rpc/summary.txt (100%) rename {extra => unmaintained}/modules/uploads/authors.txt (100%) rename {extra => unmaintained}/modules/uploads/summary.txt (100%) rename {extra => unmaintained}/modules/uploads/uploads.factor (100%) rename {extra => unmaintained}/modules/using/authors.txt (100%) rename {extra => unmaintained}/modules/using/summary.txt (100%) rename {extra => unmaintained}/modules/using/tests/tags.txt (100%) rename {extra => unmaintained}/modules/using/tests/test-server.factor (100%) create mode 100644 unmaintained/modules/using/tests/tests.factor rename {extra => unmaintained}/modules/using/using-docs.factor (82%) rename {extra => unmaintained}/modules/using/using.factor (80%) diff --git a/extra/file-trees/file-trees.factor b/extra/file-trees/file-trees.factor index d92309ca77..a3108aa922 100644 --- a/extra/file-trees/file-trees.factor +++ b/extra/file-trees/file-trees.factor @@ -1,6 +1,7 @@ USING: accessors arrays delegate delegate.protocols io.pathnames kernel locals sequences -ui.frp vectors make strings ; +vectors make strings ; +EXCLUDE: ui.frp => , ; IN: file-trees TUPLE: walkable-vector vector father ; diff --git a/extra/modules/using/tests/tests.factor b/extra/modules/using/tests/tests.factor deleted file mode 100644 index 894075acf8..0000000000 --- a/extra/modules/using/tests/tests.factor +++ /dev/null @@ -1,4 +0,0 @@ -USING: modules.using ; -IN: modules.using.tests -USING: tools.test localhost::modules.test-server ; -[ "hello world" ] [ rpc-hello ] unit-test \ No newline at end of file diff --git a/extra/modules/util/util.factor b/extra/modules/util/util.factor index ef5a3f3e76..4e92d4139f 100644 --- a/extra/modules/util/util.factor +++ b/extra/modules/util/util.factor @@ -1,7 +1,7 @@ USING: accessors assocs kernel lexer locals namespaces sequences vocabs vocabs.parser ; IN: modules.util -SYNTAX: EXPORT-FROM: [let | v [ in get ] | - v vocab words>> ";" parse-tokens - [ load-vocab vocab-words [ clone v >>vocabulary ] assoc-map ] map +SYNTAX: EXPORT-FROM: [let | v [ current-vocab ] | + v words>> ";" parse-tokens + [ load-vocab vocab-words [ clone v name>> >>vocabulary ] assoc-map ] map assoc-combine update ] ; \ No newline at end of file diff --git a/extra/modules/remote-loading/authors.txt b/unmaintained/modules/remote-loading/authors.txt similarity index 100% rename from extra/modules/remote-loading/authors.txt rename to unmaintained/modules/remote-loading/authors.txt diff --git a/extra/modules/remote-loading/remote-loading.factor b/unmaintained/modules/remote-loading/remote-loading.factor similarity index 100% rename from extra/modules/remote-loading/remote-loading.factor rename to unmaintained/modules/remote-loading/remote-loading.factor diff --git a/extra/modules/remote-loading/summary.txt b/unmaintained/modules/remote-loading/summary.txt similarity index 100% rename from extra/modules/remote-loading/summary.txt rename to unmaintained/modules/remote-loading/summary.txt diff --git a/extra/modules/rpc-server/authors.txt b/unmaintained/modules/rpc-server/authors.txt similarity index 100% rename from extra/modules/rpc-server/authors.txt rename to unmaintained/modules/rpc-server/authors.txt diff --git a/extra/modules/rpc-server/rpc-server.factor b/unmaintained/modules/rpc-server/rpc-server.factor similarity index 91% rename from extra/modules/rpc-server/rpc-server.factor rename to unmaintained/modules/rpc-server/rpc-server.factor index 525ff35a09..d818170372 100644 --- a/extra/modules/rpc-server/rpc-server.factor +++ b/unmaintained/modules/rpc-server/rpc-server.factor @@ -25,7 +25,7 @@ MEMO: mem-do-rpc ( args word -- bytes ) do-rpc ; inline : (service) ( -- ) serving-vocabs get-global empty? [ start-serving-vocabs ] when current-vocab serving-vocabs get-global adjoin "get-words" create-in - in get [ vocab vocab-words [ stack-effect ] { } assoc-map-as ] curry + current-vocab name>> [ vocab vocab-words [ stack-effect ] { } assoc-map-as ] curry (( -- words )) define-inline ; SYNTAX: service \ do-rpc "executer" set (service) ; diff --git a/extra/modules/rpc-server/summary.txt b/unmaintained/modules/rpc-server/summary.txt similarity index 100% rename from extra/modules/rpc-server/summary.txt rename to unmaintained/modules/rpc-server/summary.txt diff --git a/extra/modules/rpc/authors.txt b/unmaintained/modules/rpc/authors.txt similarity index 100% rename from extra/modules/rpc/authors.txt rename to unmaintained/modules/rpc/authors.txt diff --git a/extra/modules/rpc/rpc-docs.factor b/unmaintained/modules/rpc/rpc-docs.factor similarity index 100% rename from extra/modules/rpc/rpc-docs.factor rename to unmaintained/modules/rpc/rpc-docs.factor diff --git a/extra/modules/rpc/rpc.factor b/unmaintained/modules/rpc/rpc.factor similarity index 83% rename from extra/modules/rpc/rpc.factor rename to unmaintained/modules/rpc/rpc.factor index c6b00efc49..fe65c9cb37 100644 --- a/extra/modules/rpc/rpc.factor +++ b/unmaintained/modules/rpc/rpc.factor @@ -1,12 +1,12 @@ USING: accessors compiler.units combinators fry generalizations io -io.encodings.binary io.sockets kernel namespaces +io.encodings.binary io.sockets kernel parser sequences serialize vocabs vocabs.parser words ; IN: modules.rpc DEFER: get-words : with-in-vocab ( vocab quot -- vocab ) over - [ '[ _ set-in @ ] in get swap dip set-in ] dip vocab ; inline + [ '[ _ set-current-vocab @ ] current-vocab name>> swap dip set-current-vocab ] dip vocab ; inline : remote-quot ( addrspec vocabspec effect str -- quot ) '[ _ 5000 binary diff --git a/extra/modules/rpc/summary.txt b/unmaintained/modules/rpc/summary.txt similarity index 100% rename from extra/modules/rpc/summary.txt rename to unmaintained/modules/rpc/summary.txt diff --git a/extra/modules/uploads/authors.txt b/unmaintained/modules/uploads/authors.txt similarity index 100% rename from extra/modules/uploads/authors.txt rename to unmaintained/modules/uploads/authors.txt diff --git a/extra/modules/uploads/summary.txt b/unmaintained/modules/uploads/summary.txt similarity index 100% rename from extra/modules/uploads/summary.txt rename to unmaintained/modules/uploads/summary.txt diff --git a/extra/modules/uploads/uploads.factor b/unmaintained/modules/uploads/uploads.factor similarity index 100% rename from extra/modules/uploads/uploads.factor rename to unmaintained/modules/uploads/uploads.factor diff --git a/extra/modules/using/authors.txt b/unmaintained/modules/using/authors.txt similarity index 100% rename from extra/modules/using/authors.txt rename to unmaintained/modules/using/authors.txt diff --git a/extra/modules/using/summary.txt b/unmaintained/modules/using/summary.txt similarity index 100% rename from extra/modules/using/summary.txt rename to unmaintained/modules/using/summary.txt diff --git a/extra/modules/using/tests/tags.txt b/unmaintained/modules/using/tests/tags.txt similarity index 100% rename from extra/modules/using/tests/tags.txt rename to unmaintained/modules/using/tests/tags.txt diff --git a/extra/modules/using/tests/test-server.factor b/unmaintained/modules/using/tests/test-server.factor similarity index 100% rename from extra/modules/using/tests/test-server.factor rename to unmaintained/modules/using/tests/test-server.factor diff --git a/unmaintained/modules/using/tests/tests.factor b/unmaintained/modules/using/tests/tests.factor new file mode 100644 index 0000000000..a0adca2646 --- /dev/null +++ b/unmaintained/modules/using/tests/tests.factor @@ -0,0 +1,4 @@ +QUALIFIED-WITH: modules.using m +IN: modules.using.tests +m:USING: tools.test localhost::modules.test-server ; +[ "hello world" ] [ rpc-hello ] unit-test \ No newline at end of file diff --git a/extra/modules/using/using-docs.factor b/unmaintained/modules/using/using-docs.factor similarity index 82% rename from extra/modules/using/using-docs.factor rename to unmaintained/modules/using/using-docs.factor index c78e546525..15f99964d8 100644 --- a/extra/modules/using/using-docs.factor +++ b/unmaintained/modules/using/using-docs.factor @@ -1,4 +1,5 @@ -USING: modules.using modules.rpc-server help.syntax help.markup strings ; +USING: modules.rpc-server help.syntax help.markup strings ; +QUALIFIED-WITH: modules.using m IN: modules HELP: service @@ -6,7 +7,7 @@ HELP: service { $description "Starts a server for requests for remote procedure calls." } ; ARTICLE: { "modules" "remote-loading" } "Using the remote-loading vocabulary" -"If loaded, starts serving vocabularies, accessable through a " { $link POSTPONE: USING: } " form" ; +"If loaded, starts serving vocabularies, accessable through a " { $link POSTPONE: m:USING: } " form" ; HELP: USING: { $syntax "USING: rpc-server::module fetch-sever::module { module qualified-name } { module => word ... } ... ;" } diff --git a/extra/modules/using/using.factor b/unmaintained/modules/using/using.factor similarity index 80% rename from extra/modules/using/using.factor rename to unmaintained/modules/using/using.factor index b0891aa391..57bf3c67cd 100644 --- a/extra/modules/using/using.factor +++ b/unmaintained/modules/using/using.factor @@ -1,4 +1,4 @@ -USING: assocs kernel modules.remote-loading modules.rpc +USING: accessors assocs kernel modules.remote-loading modules.rpc namespaces peg peg.ebnf peg-lexer sequences vocabs vocabs.parser strings ; IN: modules.using @@ -9,9 +9,9 @@ IN: modules.using : >partial-vocab ( words assoc -- assoc ) [ dupd at [ no-word-error ] unless* ] curry { } map>assoc ; -: remote-load ( addr vocabspec -- voab ) [ "modules.remote-loading" remote-vocab (use+) ] dip get-vocab ; +: remote-load ( addr vocabspec -- voab ) [ "modules.remote-loading" remote-vocab use-vocab ] dip get-vocab ; -: load'em ( vocab words/? -- ) [ swap >partial-vocab ] when* use get push ; +: load'em ( vocab words/? -- ) [ swap >partial-vocab ] when* manifest get qualified-vocabs>> push ; EBNF: modulize tokenpart = (!(':').)+ => [[ >string ]] @@ -30,7 +30,7 @@ qualified = modspec sym => [[ first2 >qualified ]] unqualified = modspec => [[ vocab-words ]] words = ("=>" sym+ )? => [[ [ f ] [ second ] if-empty ]] long = "{" ( qualified | unqualified ) words "}" => [[ rest first2 load'em ignore ]] -short = modspec => [[ use+ ignore ]] +short = modspec => [[ use-vocab ignore ]] wordSpec = long | short using = wordSpec+ ";" => [[ drop ignore ]] ;ON-BNF \ No newline at end of file