From: Slava Pestov Date: Thu, 18 Dec 2008 00:10:01 +0000 (-0600) Subject: Merge qualified, alias, symbols, constants into core X-Git-Tag: 0.94~2207^2~27^2~17 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=c5160d76e9d7738a63e5bee7676233a6ddabbb70 Merge qualified, alias, symbols, constants into core --- diff --git a/basis/alias/alias-docs.factor b/basis/alias/alias-docs.factor deleted file mode 100644 index 3f2eee6460..0000000000 --- a/basis/alias/alias-docs.factor +++ /dev/null @@ -1,26 +0,0 @@ -! Copyright (C) 2008 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: kernel words help.markup help.syntax ; -IN: alias - -HELP: ALIAS: -{ $syntax "ALIAS: new-word existing-word" } -{ $values { "new-word" word } { "existing-word" word } } -{ $description "Creates a " { $snippet "new" } " inlined word that calls the " { $snippet "existing" } " word." } -{ $examples - { $example "USING: alias prettyprint sequences ;" - "IN: alias.test" - "ALIAS: sequence-nth nth" - "0 { 10 20 30 } sequence-nth ." - "10" - } -} ; - -ARTICLE: "alias" "Word aliasing" -"The " { $vocab-link "alias" } " vocabulary implements a way to make many different names for the same word. Although creating new names for words is generally frowned upon, aliases are useful for the Win32 API and other cases where words need to be renamed for symmetry." $nl -"Make a new word that aliases another word:" -{ $subsection define-alias } -"Make an alias at parse-time:" -{ $subsection POSTPONE: ALIAS: } ; - -ABOUT: "alias" diff --git a/basis/alias/alias.factor b/basis/alias/alias.factor deleted file mode 100644 index 79914527ff..0000000000 --- a/basis/alias/alias.factor +++ /dev/null @@ -1,19 +0,0 @@ -! Copyright (C) 2008 Slava Pestov. -! See http://factorcode.org/license.txt for BSD license. -USING: accessors words quotations kernel effects sequences -parser definitions ; -IN: alias - -PREDICATE: alias < word "alias" word-prop ; - -: define-alias ( new old -- ) - [ [ 1quotation ] [ stack-effect ] bi define-inline ] - [ drop t "alias" set-word-prop ] 2bi ; - -: ALIAS: CREATE-WORD scan-word define-alias ; parsing - -M: alias reset-word - [ call-next-method ] [ f "alias" set-word-prop ] bi ; - -M: alias stack-effect - def>> first stack-effect ; diff --git a/basis/alias/authors.txt b/basis/alias/authors.txt deleted file mode 100644 index 1901f27a24..0000000000 --- a/basis/alias/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Slava Pestov diff --git a/basis/alias/summary.txt b/basis/alias/summary.txt deleted file mode 100644 index 15690a7b9b..0000000000 --- a/basis/alias/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Defining multiple words with the same name diff --git a/basis/alien/syntax/syntax.factor b/basis/alien/syntax/syntax.factor index 15d82884f9..a02d2f3cb4 100644 --- a/basis/alien/syntax/syntax.factor +++ b/basis/alien/syntax/syntax.factor @@ -4,7 +4,7 @@ USING: accessors arrays alien alien.c-types alien.structs alien.arrays alien.strings kernel math namespaces parser sequences words quotations math.parser splitting grouping effects assocs combinators lexer strings.parser alien.parser -fry ; +fry vocabs.parser ; IN: alien.syntax : DLL" lexer get skip-blank parse-string dlopen parsed ; parsing diff --git a/basis/bootstrap/stage2.factor b/basis/bootstrap/stage2.factor index d2b522581d..f0622726f5 100644 --- a/basis/bootstrap/stage2.factor +++ b/basis/bootstrap/stage2.factor @@ -1,11 +1,11 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors init namespaces words io kernel.private math -memory continuations kernel io.files io.pathnames io.backend -system parser vocabs sequences vocabs.loader combinators -splitting source-files strings definitions assocs -compiler.errors compiler.units math.parser generic sets -command-line ; +USING: accessors init namespaces words words.symbol io +kernel.private math memory continuations kernel io.files +io.pathnames io.backend system parser vocabs sequences +vocabs.loader combinators splitting source-files strings +definitions assocs compiler.errors compiler.units math.parser +generic sets command-line ; IN: bootstrap.stage2 SYMBOL: core-bootstrap-time diff --git a/basis/checksums/md5/md5.factor b/basis/checksums/md5/md5.factor index d919b0e313..7931828217 100644 --- a/basis/checksums/md5/md5.factor +++ b/basis/checksums/md5/md5.factor @@ -3,7 +3,7 @@ USING: kernel io io.binary io.files io.streams.byte-array math math.functions math.parser namespaces splitting grouping strings sequences byte-arrays locals sequences.private -io.encodings.binary symbols math.bitwise checksums +io.encodings.binary math.bitwise checksums checksums.common checksums.stream ; IN: checksums.md5 diff --git a/basis/checksums/sha1/sha1.factor b/basis/checksums/sha1/sha1.factor index 6cdc9270aa..ede8a8f653 100644 --- a/basis/checksums/sha1/sha1.factor +++ b/basis/checksums/sha1/sha1.factor @@ -3,7 +3,7 @@ USING: arrays combinators kernel io io.encodings.binary io.files io.streams.byte-array math.vectors strings sequences namespaces make math parser sequences assocs grouping vectors io.binary -hashtables symbols math.bitwise checksums checksums.common +hashtables math.bitwise checksums checksums.common checksums.stream ; IN: checksums.sha1 diff --git a/basis/checksums/sha2/sha2.factor b/basis/checksums/sha2/sha2.factor index beb657bd3e..898a695b34 100644 --- a/basis/checksums/sha2/sha2.factor +++ b/basis/checksums/sha2/sha2.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: kernel splitting grouping math sequences namespaces make -io.binary symbols math.bitwise checksums checksums.common +io.binary math.bitwise checksums checksums.common sbufs strings ; IN: checksums.sha2 diff --git a/basis/compiler/cfg/intrinsics/intrinsics.factor b/basis/compiler/cfg/intrinsics/intrinsics.factor index 5f75330865..3d0a7bec9c 100644 --- a/basis/compiler/cfg/intrinsics/intrinsics.factor +++ b/basis/compiler/cfg/intrinsics/intrinsics.factor @@ -1,7 +1,6 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: qualified words sequences kernel combinators -cpu.architecture +USING: words sequences kernel combinators cpu.architecture compiler.cfg.hats compiler.cfg.instructions compiler.cfg.intrinsics.alien diff --git a/basis/compiler/tree/debugger/debugger.factor b/basis/compiler/tree/debugger/debugger.factor index e75e7f6046..213a8357e6 100644 --- a/basis/compiler/tree/debugger/debugger.factor +++ b/basis/compiler/tree/debugger/debugger.factor @@ -4,7 +4,7 @@ USING: kernel assocs match fry accessors namespaces make effects sequences sequences.private quotations generic macros arrays prettyprint prettyprint.backend prettyprint.custom prettyprint.sections math words combinators -combinators.short-circuit io sorting hints qualified +combinators.short-circuit io sorting hints compiler.tree compiler.tree.recursive compiler.tree.normalization diff --git a/basis/compiler/tree/propagation/propagation-tests.factor b/basis/compiler/tree/propagation/propagation-tests.factor index b324dc0fc2..87152a8e2b 100644 --- a/basis/compiler/tree/propagation/propagation-tests.factor +++ b/basis/compiler/tree/propagation/propagation-tests.factor @@ -641,7 +641,7 @@ MIXIN: empty-mixin ] unit-test [ V{ POSTPONE: f } ] [ - [ { word object } declare eq? ] final-classes + [ { word object } declare equal? ] final-classes ] unit-test ! [ V{ string } ] [ diff --git a/basis/concurrency/distributed/distributed.factor b/basis/concurrency/distributed/distributed.factor index 99ad239011..ca1c5762f6 100644 --- a/basis/concurrency/distributed/distributed.factor +++ b/basis/concurrency/distributed/distributed.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: serialize sequences concurrency.messaging threads io io.servers.connection io.encodings.binary -qualified arrays namespaces kernel accessors ; +arrays namespaces kernel accessors ; FROM: io.sockets => host-name with-client ; IN: concurrency.distributed diff --git a/basis/constants/constants.factor b/basis/constants/constants.factor deleted file mode 100644 index bd2b3f188f..0000000000 --- a/basis/constants/constants.factor +++ /dev/null @@ -1,8 +0,0 @@ -! Copyright (C) 2008 Slava Pestov. -! See http://factorcode.org/license.txt for BSD license. -USING: parser kernel words ; -IN: constants - -: CONSTANT: - CREATE scan-object [ ] curry (( -- value )) - define-inline ; parsing diff --git a/basis/cpu/x86/assembler/syntax/syntax.factor b/basis/cpu/x86/assembler/syntax/syntax.factor index 6ddec4af07..343850f9e6 100644 --- a/basis/cpu/x86/assembler/syntax/syntax.factor +++ b/basis/cpu/x86/assembler/syntax/syntax.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel words sequences lexer parser fry ; +USING: kernel words words.symbol sequences lexer parser fry ; IN: cpu.x86.assembler.syntax : define-register ( name num size -- ) diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index 885e2e303c..1440e7ca5d 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -9,7 +9,7 @@ combinators generic.math classes.builtin classes compiler.units generic.standard vocabs init kernel.private io.encodings accessors math.order destructors source-files parser classes.tuple.parser effects.parser lexer compiler.errors -generic.parser strings.parser ; +generic.parser strings.parser vocabs.parser ; IN: debugger GENERIC: error. ( error -- ) diff --git a/basis/delegate/delegate.factor b/basis/delegate/delegate.factor index 57f9b35c96..4da2244114 100644 --- a/basis/delegate/delegate.factor +++ b/basis/delegate/delegate.factor @@ -2,7 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors parser generic kernel classes classes.tuple words slots assocs sequences arrays vectors definitions -math hashtables sets generalizations namespaces make ; +math hashtables sets generalizations namespaces make +words.symbol ; IN: delegate : protocol-words ( protocol -- words ) diff --git a/basis/functors/functors.factor b/basis/functors/functors.factor index 2029c0cf25..28bedc8360 100644 --- a/basis/functors/functors.factor +++ b/basis/functors/functors.factor @@ -3,7 +3,8 @@ USING: kernel quotations classes.tuple make combinators generic words interpolate namespaces sequences io.streams.string fry classes.mixin effects lexer parser classes.tuple.parser -effects.parser locals.types locals.parser locals.rewrite.closures ; +effects.parser locals.types locals.parser +locals.rewrite.closures vocabs.parser ; IN: functors : scan-param ( -- obj ) diff --git a/basis/furnace/chloe-tags/chloe-tags.factor b/basis/furnace/chloe-tags/chloe-tags.factor index 8ab70ded7b..f500acd7ab 100644 --- a/basis/furnace/chloe-tags/chloe-tags.factor +++ b/basis/furnace/chloe-tags/chloe-tags.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays kernel combinators assocs namespaces sequences splitting words -fry urls multiline present qualified +fry urls multiline present xml xml.data xml.entities diff --git a/basis/help/help.factor b/basis/help/help.factor index 5d12438e0d..cd80a73dad 100644 --- a/basis/help/help.factor +++ b/basis/help/help.factor @@ -1,10 +1,11 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays io io.styles kernel namespaces make -parser prettyprint sequences words assocs definitions generic -quotations effects slots continuations classes.tuple debugger -combinators vocabs help.stylesheet help.topics help.crossref -help.markup sorting classes vocabs.loader ; +parser prettyprint sequences words words.symbol assocs +definitions generic quotations effects slots continuations +classes.tuple debugger combinators vocabs help.stylesheet +help.topics help.crossref help.markup sorting classes +vocabs.loader ; IN: help GENERIC: word-help* ( word -- content ) diff --git a/basis/help/lint/lint.factor b/basis/help/lint/lint.factor index d5729f218b..9d4de09a87 100644 --- a/basis/help/lint/lint.factor +++ b/basis/help/lint/lint.factor @@ -5,7 +5,8 @@ help.topics words strings classes tools.vocabs namespaces make io io.streams.string prettyprint definitions arrays vectors combinators combinators.short-circuit splitting debugger hashtables sorting effects vocabs vocabs.loader assocs editors -continuations classes.predicate macros math sets eval ; +continuations classes.predicate macros math sets eval +vocabs.parser words.symbol ; IN: help.lint : check-example ( element -- ) diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index a7501dc242..bf933cd9f1 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -3,8 +3,7 @@ USING: accessors arrays definitions generic io kernel assocs hashtables namespaces make parser prettyprint sequences strings io.styles vectors words math sorting splitting classes slots -vocabs help.stylesheet help.topics vocabs.loader alias -quotations ; +vocabs help.stylesheet help.topics vocabs.loader quotations ; IN: help.markup ! Simple markup language. diff --git a/basis/help/syntax/syntax.factor b/basis/help/syntax/syntax.factor index 9a372174ba..9f98ba6d8d 100644 --- a/basis/help/syntax/syntax.factor +++ b/basis/help/syntax/syntax.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays kernel parser sequences words help -help.topics namespaces vocabs definitions compiler.units ; +help.topics namespaces vocabs definitions compiler.units +vocabs.parser ; IN: help.syntax : HELP: diff --git a/basis/http/http.factor b/basis/http/http.factor index bbb0335ae4..0aeb771c11 100644 --- a/basis/http/http.factor +++ b/basis/http/http.factor @@ -8,7 +8,7 @@ calendar.format present urls io io.encodings io.encodings.iana io.encodings.binary io.encodings.8-bit -unicode.case unicode.categories qualified +unicode.case unicode.categories http.parsers ; diff --git a/basis/io/backend/unix/unix.factor b/basis/io/backend/unix/unix.factor index e8ace90d73..e25550590f 100644 --- a/basis/io/backend/unix/unix.factor +++ b/basis/io/backend/unix/unix.factor @@ -3,7 +3,7 @@ USING: alien alien.c-types alien.syntax generic assocs kernel kernel.private math io.ports sequences strings sbufs threads unix vectors io.buffers io.backend io.encodings math.parser -continuations system libc qualified namespaces make io.timeouts +continuations system libc namespaces make io.timeouts io.encodings.utf8 destructors accessors summary combinators locals unix.time fry io.backend.unix.multiplexers ; QUALIFIED: io diff --git a/basis/io/backend/windows/nt/nt.factor b/basis/io/backend/windows/nt/nt.factor index b8887debed..493a735f7f 100755 --- a/basis/io/backend/windows/nt/nt.factor +++ b/basis/io/backend/windows/nt/nt.factor @@ -3,7 +3,7 @@ continuations destructors io io.backend io.ports io.timeouts io.backend.windows io.files.windows io.files.windows.nt io.files io.pathnames io.buffers io.streams.c libc kernel math namespaces sequences threads windows windows.errors windows.kernel32 -strings splitting qualified ascii system accessors locals ; +strings splitting ascii system accessors locals ; QUALIFIED: windows.winsock IN: io.backend.windows.nt diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index 1a1ffe0dc7..842f1ec84c 100755 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -4,7 +4,7 @@ USING: alien.c-types io.binary io.backend io.files io.files.types io.buffers io.encodings.utf16n io.ports io.backend.windows kernel math splitting fry alien.strings windows windows.kernel32 windows.time calendar combinators -math.functions sequences namespaces make words symbols system +math.functions sequences namespaces make words system destructors accessors math.bitwise continuations windows.errors arrays byte-arrays generalizations ; IN: io.files.windows diff --git a/basis/io/pipes/unix/unix.factor b/basis/io/pipes/unix/unix.factor index acf8b787ed..6a0015084b 100644 --- a/basis/io/pipes/unix/unix.factor +++ b/basis/io/pipes/unix/unix.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: system kernel unix math sequences qualified +USING: system kernel unix math sequences io.backend.unix io.ports specialized-arrays.int accessors ; IN: io.pipes.unix QUALIFIED: io.pipes diff --git a/basis/io/sockets/secure/secure.factor b/basis/io/sockets/secure/secure.factor index c0d70fc047..c4a1475f48 100644 --- a/basis/io/sockets/secure/secure.factor +++ b/basis/io/sockets/secure/secure.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors kernel symbols namespaces continuations +USING: accessors kernel namespaces continuations destructors io debugger io.sockets sequences summary calendar delegate system vocabs.loader combinators present ; IN: io.sockets.secure diff --git a/basis/io/sockets/sockets.factor b/basis/io/sockets/sockets.factor index 8268030ace..0ef485b74c 100644 --- a/basis/io/sockets/sockets.factor +++ b/basis/io/sockets/sockets.factor @@ -6,7 +6,7 @@ sequences arrays io.encodings io.ports io.streams.duplex io.encodings.ascii alien.strings io.binary accessors destructors classes byte-arrays system combinators parser alien.c-types math.parser splitting grouping math assocs summary -system vocabs.loader combinators present fry ; +system vocabs.loader combinators present fry vocabs.parser ; IN: io.sockets << { diff --git a/basis/io/sockets/unix/unix.factor b/basis/io/sockets/unix/unix.factor index 1dc92d7d08..f209df5862 100644 --- a/basis/io/sockets/unix/unix.factor +++ b/basis/io/sockets/unix/unix.factor @@ -5,7 +5,7 @@ namespaces threads sequences byte-arrays io.ports io.binary io.backend.unix io.streams.duplex io.backend io.ports io.pathnames io.files.private io.encodings.utf8 math.parser continuations libc combinators -system accessors qualified destructors unix locals init ; +system accessors destructors unix locals init ; EXCLUDE: io => read write close ; EXCLUDE: io.sockets => accept ; diff --git a/basis/lcs/diff2html/diff2html.factor b/basis/lcs/diff2html/diff2html.factor index b92eeb1250..ebbb0f3786 100644 --- a/basis/lcs/diff2html/diff2html.factor +++ b/basis/lcs/diff2html/diff2html.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: lcs html.elements kernel qualified ; +USING: lcs html.elements kernel ; FROM: accessors => item>> ; FROM: io => write ; FROM: sequences => each if-empty ; diff --git a/basis/listener/listener.factor b/basis/listener/listener.factor index f60403055e..88a90b72e2 100644 --- a/basis/listener/listener.factor +++ b/basis/listener/listener.factor @@ -4,7 +4,7 @@ USING: arrays hashtables io kernel math math.parser memory namespaces parser lexer sequences strings io.styles vectors words generic system combinators continuations debugger definitions compiler.units accessors colors prettyprint fry -sets ; +sets vocabs.parser ; IN: listener GENERIC: stream-read-quot ( stream -- quot/f ) diff --git a/basis/locals/parser/parser.factor b/basis/locals/parser/parser.factor index e6ab6c003c..c5b34556bc 100644 --- a/basis/locals/parser/parser.factor +++ b/basis/locals/parser/parser.factor @@ -3,7 +3,7 @@ USING: accessors arrays combinators effects.parser generic.parser kernel lexer locals.errors locals.rewrite.closures locals.types make namespaces parser -quotations sequences splitting words ; +quotations sequences splitting words vocabs.parser ; IN: locals.parser : make-local ( name -- word ) diff --git a/basis/logging/insomniac/insomniac.factor b/basis/logging/insomniac/insomniac.factor index 7c1db5b7c0..91baae631f 100644 --- a/basis/logging/insomniac/insomniac.factor +++ b/basis/logging/insomniac/insomniac.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: logging.analysis logging.server logging smtp kernel io.files io.streams.string namespaces make alarms assocs -io.encodings.utf8 accessors calendar sequences qualified ; +io.encodings.utf8 accessors calendar sequences ; QUALIFIED: io.sockets IN: logging.insomniac diff --git a/basis/logging/logging.factor b/basis/logging/logging.factor index 47de880559..fb6b328990 100644 --- a/basis/logging/logging.factor +++ b/basis/logging/logging.factor @@ -4,7 +4,7 @@ USING: logging.server sequences namespaces concurrency.messaging words kernel arrays shuffle tools.annotations prettyprint.config prettyprint debugger io.streams.string splitting continuations effects generalizations parser strings -quotations fry symbols accessors ; +quotations fry accessors ; IN: logging SYMBOLS: DEBUG NOTICE WARNING ERROR CRITICAL ; diff --git a/basis/opengl/gl/extensions/extensions.factor b/basis/opengl/gl/extensions/extensions.factor index ea37829d0e..fb2ddfaf3e 100644 --- a/basis/opengl/gl/extensions/extensions.factor +++ b/basis/opengl/gl/extensions/extensions.factor @@ -1,6 +1,6 @@ USING: alien alien.syntax alien.parser combinators kernel parser sequences system words namespaces hashtables init -math arrays assocs continuations lexer fry locals ; +math arrays assocs continuations lexer fry locals vocabs.parser ; IN: opengl.gl.extensions ERROR: unknown-gl-platform ; diff --git a/basis/opengl/gl/gl.factor b/basis/opengl/gl/gl.factor index a7337da353..c32f62bf33 100644 --- a/basis/opengl/gl/gl.factor +++ b/basis/opengl/gl/gl.factor @@ -4,7 +4,7 @@ ! This file is based on the gl.h that comes with xorg-x11 6.8.2 USING: alien alien.syntax combinators kernel parser sequences -system words opengl.gl.extensions alias constants ; +system words opengl.gl.extensions ; IN: opengl.gl diff --git a/basis/openssl/libssl/libssl.factor b/basis/openssl/libssl/libssl.factor index b8f897463a..e512e3134c 100644 --- a/basis/openssl/libssl/libssl.factor +++ b/basis/openssl/libssl/libssl.factor @@ -2,8 +2,7 @@ ! Portions copyright (C) 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.syntax combinators kernel system namespaces -assocs parser lexer sequences words quotations math.bitwise -alias constants ; +assocs parser lexer sequences words quotations math.bitwise ; IN: openssl.libssl diff --git a/basis/persistent/deques/deques.factor b/basis/persistent/deques/deques.factor index 83c4a196d9..657f7ce56a 100644 --- a/basis/persistent/deques/deques.factor +++ b/basis/persistent/deques/deques.factor @@ -1,6 +1,6 @@ ! Copyback (C) 2008 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. -USING: kernel accessors math qualified ; +USING: kernel accessors math ; QUALIFIED: sequences IN: persistent.deques diff --git a/basis/prettyprint/prettyprint.factor b/basis/prettyprint/prettyprint.factor index 6b49c4a35a..b3800babe8 100644 --- a/basis/prettyprint/prettyprint.factor +++ b/basis/prettyprint/prettyprint.factor @@ -2,13 +2,13 @@ ! See http://factorcode.org/license.txt for BSD license. USING: arrays generic generic.standard assocs io kernel math namespaces make sequences strings io.styles io.streams.string -vectors words prettyprint.backend prettyprint.custom +vectors words words.symbol prettyprint.backend prettyprint.custom prettyprint.sections prettyprint.config sorting splitting grouping math.parser vocabs definitions effects classes.builtin classes.tuple io.pathnames classes continuations hashtables classes.mixin classes.union classes.intersection classes.predicate classes.singleton combinators quotations sets -accessors colors parser summary ; +accessors colors parser summary vocabs.parser ; IN: prettyprint : make-pprint ( obj quot -- block in use ) @@ -357,12 +357,12 @@ M: builtin-class see-class* ] when drop ; M: word see - dup see-class - dup class? over symbol? not and [ - nl - ] when - dup [ class? ] [ symbol? ] bi and - [ drop ] [ call-next-method ] if ; + [ see-class ] + [ [ class? ] [ symbol? not ] bi and [ nl ] when ] + [ + dup [ class? ] [ symbol? ] bi and + [ drop ] [ call-next-method ] if + ] tri ; : see-all ( seq -- ) natural-sort [ nl ] [ see ] interleave ; diff --git a/basis/qualified/authors.txt b/basis/qualified/authors.txt deleted file mode 100644 index f990dd0ed2..0000000000 --- a/basis/qualified/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Daniel Ehrenberg diff --git a/basis/qualified/qualified-docs.factor b/basis/qualified/qualified-docs.factor deleted file mode 100644 index 828d811b46..0000000000 --- a/basis/qualified/qualified-docs.factor +++ /dev/null @@ -1,55 +0,0 @@ -USING: help.markup help.syntax ; -IN: qualified - -HELP: QUALIFIED: -{ $syntax "QUALIFIED: vocab" } -{ $description "Similar to " { $link POSTPONE: USE: } " but loads vocabulary with prefix." } -{ $examples { $example - "USING: prettyprint qualified ;" - "QUALIFIED: math" - "1 2 math:+ ." "3" -} } ; - -HELP: QUALIFIED-WITH: -{ $syntax "QUALIFIED-WITH: vocab word-prefix" } -{ $description "Works like " { $link POSTPONE: QUALIFIED: } " but uses " { $snippet "word-prefix" } " as prefix." } -{ $examples { $code - "USING: prettyprint qualified ;" - "QUALIFIED-WITH: math m" - "1 2 m:+ ." - "3" -} } ; - -HELP: FROM: -{ $syntax "FROM: vocab => words ... ;" } -{ $description "Imports " { $snippet "words" } " from " { $snippet "vocab" } "." } -{ $examples { $code - "FROM: math.parser => bin> hex> ; ! imports only bin> and hex>" } } ; - -HELP: EXCLUDE: -{ $syntax "EXCLUDE: vocab => words ... ;" } -{ $description "Imports everything from " { $snippet "vocab" } " excluding " { $snippet "words" } "." } -{ $examples { $code - "EXCLUDE: math.parser => bin> hex> ; ! imports everything but bin> and hex>" } } ; - -HELP: RENAME: -{ $syntax "RENAME: word vocab => newname " } -{ $description "Imports " { $snippet "word" } " from " { $snippet "vocab" } ", but renamed to " { $snippet "newname" } "." } -{ $examples { $example - "USING: prettyprint qualified ;" - "RENAME: + math => -" - "2 3 - ." - "5" -} } ; - -ARTICLE: "qualified" "Qualified word lookup" -"The " { $vocab-link "qualified" } " vocabulary provides a handful of parsing words which give more control over word lookup than is offered by " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } "." -$nl -"These words are useful when there is no way to avoid using two vocabularies with identical word names in the same source file." -{ $subsection POSTPONE: QUALIFIED: } -{ $subsection POSTPONE: QUALIFIED-WITH: } -{ $subsection POSTPONE: FROM: } -{ $subsection POSTPONE: EXCLUDE: } -{ $subsection POSTPONE: RENAME: } ; - -ABOUT: "qualified" diff --git a/basis/qualified/qualified-tests.factor b/basis/qualified/qualified-tests.factor deleted file mode 100644 index 78efec4861..0000000000 --- a/basis/qualified/qualified-tests.factor +++ /dev/null @@ -1,33 +0,0 @@ -USING: tools.test qualified eval accessors parser ; -IN: qualified.tests.foo -: x 1 ; -: y 5 ; -IN: qualified.tests.bar -: x 2 ; -: y 4 ; -IN: qualified.tests.baz -: x 3 ; - -QUALIFIED: qualified.tests.foo -QUALIFIED: qualified.tests.bar -[ 1 2 3 ] [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test - -QUALIFIED-WITH: qualified.tests.bar p -[ 2 ] [ p:x ] unit-test - -RENAME: x qualified.tests.baz => y -[ 3 ] [ y ] unit-test - -FROM: qualified.tests.baz => x ; -[ 3 ] [ x ] unit-test -[ 3 ] [ y ] unit-test - -EXCLUDE: qualified.tests.bar => x ; -[ 3 ] [ x ] unit-test -[ 4 ] [ y ] unit-test - -[ "USE: qualified IN: qualified.tests FROM: qualified.tests => doesnotexist ;" eval ] -[ error>> no-word-error? ] must-fail-with - -[ "USE: qualified IN: qualified.tests RENAME: doesnotexist qualified.tests => blah" eval ] -[ error>> no-word-error? ] must-fail-with diff --git a/basis/qualified/qualified.factor b/basis/qualified/qualified.factor deleted file mode 100644 index 2cd64e90bf..0000000000 --- a/basis/qualified/qualified.factor +++ /dev/null @@ -1,43 +0,0 @@ -! Copyright (C) 2007, 2008 Daniel Ehrenberg. -! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences assocs hashtables parser lexer -vocabs words namespaces vocabs.loader sets fry ; -IN: qualified - -: define-qualified ( vocab-name prefix-name -- ) - [ load-vocab vocab-words ] [ CHAR: : suffix ] bi* - '[ [ [ _ ] dip append ] dip ] assoc-map - use get push ; - -: QUALIFIED: - #! Syntax: QUALIFIED: vocab - scan dup define-qualified ; parsing - -: QUALIFIED-WITH: - #! Syntax: QUALIFIED-WITH: vocab prefix - scan scan define-qualified ; parsing - -: partial-vocab ( words vocab -- assoc ) - '[ dup _ lookup [ no-word-error ] unless* ] - { } map>assoc ; - -: FROM: - #! Syntax: FROM: vocab => words... ; - scan dup load-vocab drop "=>" expect - ";" parse-tokens swap partial-vocab use get push ; parsing - -: partial-vocab-excluding ( words vocab -- assoc ) - [ load-vocab vocab-words keys swap diff ] keep partial-vocab ; - -: EXCLUDE: - #! Syntax: EXCLUDE: vocab => words ... ; - scan "=>" expect - ";" parse-tokens swap partial-vocab-excluding use get push ; parsing - -: RENAME: - #! Syntax: RENAME: word vocab => newname - scan scan dup load-vocab drop - dupd lookup [ ] [ no-word-error ] ?if - "=>" expect - scan associate use get push ; parsing - diff --git a/basis/qualified/summary.txt b/basis/qualified/summary.txt deleted file mode 100644 index 94b44c6052..0000000000 --- a/basis/qualified/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Qualified naming for vocabularies diff --git a/basis/qualified/tags.txt b/basis/qualified/tags.txt deleted file mode 100644 index f4274299b1..0000000000 --- a/basis/qualified/tags.txt +++ /dev/null @@ -1 +0,0 @@ -extensions diff --git a/basis/regexp/classes/classes.factor b/basis/regexp/classes/classes.factor index eec0d309b1..4a807fa51b 100644 --- a/basis/regexp/classes/classes.factor +++ b/basis/regexp/classes/classes.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors kernel math math.order symbols -words regexp.utils unicode.categories combinators.short-circuit ; +USING: accessors kernel math math.order words regexp.utils +unicode.categories combinators.short-circuit ; IN: regexp.classes SINGLETONS: any-char any-char-no-nl diff --git a/basis/regexp/parser/parser.factor b/basis/regexp/parser/parser.factor index 4d8f3ddfbc..25509ec798 100644 --- a/basis/regexp/parser/parser.factor +++ b/basis/regexp/parser/parser.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs combinators io io.streams.string -kernel math math.parser namespaces qualified sets -quotations sequences splitting symbols vectors math.order +kernel math math.parser namespaces sets +quotations sequences splitting vectors math.order unicode.categories strings regexp.backend regexp.utils unicode.case words locals regexp.classes ; IN: regexp.parser diff --git a/basis/symbols/authors.txt b/basis/symbols/authors.txt deleted file mode 100644 index f372b574ae..0000000000 --- a/basis/symbols/authors.txt +++ /dev/null @@ -1,2 +0,0 @@ -Slava Pestov -Doug Coleman diff --git a/basis/symbols/summary.txt b/basis/symbols/summary.txt deleted file mode 100644 index 3093468c50..0000000000 --- a/basis/symbols/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Utility for defining multiple symbols at a time diff --git a/basis/symbols/symbols-docs.factor b/basis/symbols/symbols-docs.factor deleted file mode 100644 index 9f79b71365..0000000000 --- a/basis/symbols/symbols-docs.factor +++ /dev/null @@ -1,9 +0,0 @@ -USING: help.markup help.syntax ; -IN: symbols - -HELP: SYMBOLS: -{ $syntax "SYMBOLS: words... ;" } -{ $values { "words" "a sequence of new words to define" } } -{ $description "Creates a new word for every token until the ';'." } -{ $examples { $example "USING: prettyprint symbols ;" "IN: scratchpad" "SYMBOLS: foo bar baz ;\nfoo . bar . baz ." "foo\nbar\nbaz" } } -{ $see-also POSTPONE: SYMBOL: } ; diff --git a/basis/symbols/symbols-tests.factor b/basis/symbols/symbols-tests.factor deleted file mode 100644 index 274c4de85b..0000000000 --- a/basis/symbols/symbols-tests.factor +++ /dev/null @@ -1,21 +0,0 @@ -USING: kernel symbols tools.test parser generic words accessors -eval ; -IN: symbols.tests - -[ ] [ SYMBOLS: a b c ; ] unit-test -[ a ] [ a ] unit-test -[ b ] [ b ] unit-test -[ c ] [ c ] unit-test - -DEFER: blah - -[ ] [ "IN: symbols.tests GENERIC: blah" eval ] unit-test -[ ] [ "IN: symbols.tests USE: symbols SYMBOLS: blah ;" eval ] unit-test - -[ f ] [ \ blah generic? ] unit-test -[ t ] [ \ blah symbol? ] unit-test - -[ "IN: symbols.tests USE: symbols SINGLETONS: blah blah blah ;" eval ] -[ error>> error>> def>> \ blah eq? ] -must-fail-with - diff --git a/basis/symbols/symbols.factor b/basis/symbols/symbols.factor deleted file mode 100644 index 6cf8eac6fb..0000000000 --- a/basis/symbols/symbols.factor +++ /dev/null @@ -1,15 +0,0 @@ -! Copyright (C) 2008 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: parser lexer sequences words kernel classes.singleton -classes.parser ; -IN: symbols - -: SYMBOLS: - ";" parse-tokens - [ create-in dup reset-generic define-symbol ] each ; - parsing - -: SINGLETONS: - ";" parse-tokens - [ create-class-in define-singleton-class ] each ; - parsing diff --git a/basis/symbols/tags.txt b/basis/symbols/tags.txt deleted file mode 100644 index f4274299b1..0000000000 --- a/basis/symbols/tags.txt +++ /dev/null @@ -1 +0,0 @@ -extensions diff --git a/basis/tools/deploy/macosx/macosx.factor b/basis/tools/deploy/macosx/macosx.factor index 10e1566290..1dcc6fe4c1 100644 --- a/basis/tools/deploy/macosx/macosx.factor +++ b/basis/tools/deploy/macosx/macosx.factor @@ -5,7 +5,7 @@ io.directories io.directories.hierarchy kernel namespaces make sequences system tools.deploy.backend tools.deploy.config tools.deploy.config.editor assocs hashtables prettyprint io.backend.unix cocoa io.encodings.utf8 io.backend -cocoa.application cocoa.classes cocoa.plists qualified +cocoa.application cocoa.classes cocoa.plists combinators ; IN: tools.deploy.macosx diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 135679444b..c894a8931b 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors qualified io.backend io.streams.c init fry +USING: accessors io.backend io.streams.c init fry namespaces make assocs kernel parser lexer strings.parser vocabs sequences words words.private memory kernel.private continuations io vocabs.loader system strings sets diff --git a/basis/tools/disassembler/gdb/gdb.factor b/basis/tools/disassembler/gdb/gdb.factor index e97cc203a2..9076b67606 100755 --- a/basis/tools/disassembler/gdb/gdb.factor +++ b/basis/tools/disassembler/gdb/gdb.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: io.files io.files.temp io words alien kernel math.parser alien.syntax io.launcher system assocs arrays sequences -namespaces make qualified system math io.encodings.ascii +namespaces make system math io.encodings.ascii accessors tools.disassembler ; IN: tools.disassembler.gdb diff --git a/basis/tools/files/files.factor b/basis/tools/files/files.factor index 54882800b0..3670891e41 100755 --- a/basis/tools/files/files.factor +++ b/basis/tools/files/files.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays combinators io io.files io.files.info io.directories kernel math.parser sequences system vocabs.loader -calendar math symbols fry prettyprint ; +calendar math fry prettyprint ; IN: tools.files > append require >> diff --git a/basis/unix/kqueue/macosx/macosx.factor b/basis/unix/kqueue/macosx/macosx.factor index 0bc6ce5785..843a0afad9 100644 --- a/basis/unix/kqueue/macosx/macosx.factor +++ b/basis/unix/kqueue/macosx/macosx.factor @@ -1,4 +1,4 @@ -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.kqueue C-STRUCT: kevent diff --git a/basis/unix/kqueue/netbsd/netbsd.factor b/basis/unix/kqueue/netbsd/netbsd.factor index 5e23626e1d..7ba942d712 100644 --- a/basis/unix/kqueue/netbsd/netbsd.factor +++ b/basis/unix/kqueue/netbsd/netbsd.factor @@ -1,4 +1,4 @@ -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.kqueue C-STRUCT: kevent diff --git a/basis/unix/kqueue/openbsd/openbsd.factor b/basis/unix/kqueue/openbsd/openbsd.factor index fc2e7d20ca..c62ba05a4c 100644 --- a/basis/unix/kqueue/openbsd/openbsd.factor +++ b/basis/unix/kqueue/openbsd/openbsd.factor @@ -1,4 +1,4 @@ -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.kqueue C-STRUCT: kevent diff --git a/basis/unix/linux/epoll/epoll.factor b/basis/unix/linux/epoll/epoll.factor index ebc3ab8bd1..7c68dfa45a 100644 --- a/basis/unix/linux/epoll/epoll.factor +++ b/basis/unix/linux/epoll/epoll.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. IN: unix.linux.epoll -USING: alien.syntax math constants ; +USING: alien.syntax math ; FUNCTION: int epoll_create ( int size ) ; diff --git a/basis/unix/linux/inotify/inotify.factor b/basis/unix/linux/inotify/inotify.factor index 9084b41c50..e3d40b5b28 100644 --- a/basis/unix/linux/inotify/inotify.factor +++ b/basis/unix/linux/inotify/inotify.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax math math.bitwise constants ; +USING: alien.syntax math math.bitwise ; IN: unix.linux.inotify C-STRUCT: inotify-event diff --git a/basis/unix/linux/linux.factor b/basis/unix/linux/linux.factor index 61ced5c97b..0cf33be1bf 100644 --- a/basis/unix/linux/linux.factor +++ b/basis/unix/linux/linux.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax alias constants ; +USING: alien.syntax ; IN: unix ! Linux. diff --git a/basis/unix/process/process.factor b/basis/unix/process/process.factor index ec782f5164..6e83ea9a42 100644 --- a/basis/unix/process/process.factor +++ b/basis/unix/process/process.factor @@ -1,6 +1,6 @@ USING: kernel alien.c-types alien.strings sequences math alien.syntax unix vectors kernel namespaces continuations threads assocs vectors -io.backend.unix io.encodings.utf8 unix.utilities constants ; +io.backend.unix io.encodings.utf8 unix.utilities ; IN: unix.process ! Low-level Unix process launching utilities. These are used diff --git a/basis/unix/solaris/solaris.factor b/basis/unix/solaris/solaris.factor index fc7e152931..d91fbdfddc 100644 --- a/basis/unix/solaris/solaris.factor +++ b/basis/unix/solaris/solaris.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006 Patrick Mauritz. ! See http://factorcode.org/license.txt for BSD license. IN: unix -USING: alien.syntax system kernel layouts constants ; +USING: alien.syntax system kernel layouts ; ! Solaris. diff --git a/basis/unix/stat/stat.factor b/basis/unix/stat/stat.factor index 2164d89ac6..156be96190 100644 --- a/basis/unix/stat/stat.factor +++ b/basis/unix/stat/stat.factor @@ -1,5 +1,5 @@ USING: kernel system combinators alien.syntax alien.c-types -math io.backend.unix vocabs.loader unix constants ; +math io.backend.unix vocabs.loader unix ; IN: unix.stat ! File Types diff --git a/basis/unix/statfs/freebsd/freebsd.factor b/basis/unix/statfs/freebsd/freebsd.factor index 17b58aede6..e6a033e09d 100644 --- a/basis/unix/statfs/freebsd/freebsd.factor +++ b/basis/unix/statfs/freebsd/freebsd.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.statfs.freebsd CONSTANT: MFSNAMELEN 16 ! length of type name including null */ diff --git a/basis/unix/statfs/macosx/macosx.factor b/basis/unix/statfs/macosx/macosx.factor index 829a49c81f..f80eb29ccd 100644 --- a/basis/unix/statfs/macosx/macosx.factor +++ b/basis/unix/statfs/macosx/macosx.factor @@ -2,8 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: alien.c-types io.encodings.utf8 io.encodings.string kernel sequences unix.stat accessors unix combinators math -grouping system alien.strings math.bitwise alien.syntax -alias constants ; +grouping system alien.strings math.bitwise alien.syntax ; IN: unix.statfs.macosx CONSTANT: MNT_RDONLY HEX: 00000001 diff --git a/basis/unix/statfs/openbsd/openbsd.factor b/basis/unix/statfs/openbsd/openbsd.factor index d9e6b867b6..f495f2af4e 100644 --- a/basis/unix/statfs/openbsd/openbsd.factor +++ b/basis/unix/statfs/openbsd/openbsd.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.statfs.openbsd CONSTANT: MFSNAMELEN 16 diff --git a/basis/unix/statvfs/freebsd/freebsd.factor b/basis/unix/statvfs/freebsd/freebsd.factor index a2a3168464..3140b85004 100644 --- a/basis/unix/statvfs/freebsd/freebsd.factor +++ b/basis/unix/statvfs/freebsd/freebsd.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.statvfs.freebsd C-STRUCT: statvfs diff --git a/basis/unix/statvfs/linux/linux.factor b/basis/unix/statvfs/linux/linux.factor index 5c04468ad3..c92fef6aaa 100644 --- a/basis/unix/statvfs/linux/linux.factor +++ b/basis/unix/statvfs/linux/linux.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.statvfs.linux C-STRUCT: statvfs64 diff --git a/basis/unix/statvfs/macosx/macosx.factor b/basis/unix/statvfs/macosx/macosx.factor index fc85b9d9dc..0aafad69fa 100644 --- a/basis/unix/statvfs/macosx/macosx.factor +++ b/basis/unix/statvfs/macosx/macosx.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.statvfs.macosx C-STRUCT: statvfs diff --git a/basis/unix/statvfs/netbsd/netbsd.factor b/basis/unix/statvfs/netbsd/netbsd.factor index e3e54fb4e2..1adc1a3da8 100644 --- a/basis/unix/statvfs/netbsd/netbsd.factor +++ b/basis/unix/statvfs/netbsd/netbsd.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.statvfs.netbsd CONSTANT: _VFS_NAMELEN 32 diff --git a/basis/unix/statvfs/openbsd/openbsd.factor b/basis/unix/statvfs/openbsd/openbsd.factor index 76c2af9127..4ca8d0749d 100644 --- a/basis/unix/statvfs/openbsd/openbsd.factor +++ b/basis/unix/statvfs/openbsd/openbsd.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax constants ; +USING: alien.syntax ; IN: unix.statvfs.openbsd C-STRUCT: statvfs diff --git a/basis/unix/unix.factor b/basis/unix/unix.factor index c0e496a041..52e7473800 100644 --- a/basis/unix/unix.factor +++ b/basis/unix/unix.factor @@ -2,9 +2,9 @@ ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.syntax kernel libc sequences continuations byte-arrays strings math namespaces -system combinators vocabs.loader qualified accessors +system combinators vocabs.loader accessors stack-checker macros locals generalizations unix.types -io vocabs vocabs.loader constants ; +io vocabs vocabs.loader ; IN: unix CONSTANT: PROT_NONE 0 diff --git a/basis/unix/utmpx/utmpx.factor b/basis/unix/utmpx/utmpx.factor index 30dac2de1f..6b70ceee2e 100644 --- a/basis/unix/utmpx/utmpx.factor +++ b/basis/unix/utmpx/utmpx.factor @@ -3,7 +3,7 @@ USING: alien.c-types alien.syntax combinators continuations io.encodings.string io.encodings.utf8 kernel sequences strings unix calendar system accessors unix.time calendar.unix -vocabs.loader constants ; +vocabs.loader ; IN: unix.utmpx CONSTANT: EMPTY 0 diff --git a/basis/windows/advapi32/advapi32.factor b/basis/windows/advapi32/advapi32.factor index 0d95c06a87..f76e389dce 100644 --- a/basis/windows/advapi32/advapi32.factor +++ b/basis/windows/advapi32/advapi32.factor @@ -1,5 +1,4 @@ -USING: alias alien.syntax kernel math windows.types math.bitwise -constants ; +USING: alien.syntax kernel math windows.types math.bitwise ; IN: windows.advapi32 LIBRARY: advapi32 diff --git a/basis/windows/dinput/constants/constants.factor b/basis/windows/dinput/constants/constants.factor index e3bec6d7ac..0e9a03f075 100755 --- a/basis/windows/dinput/constants/constants.factor +++ b/basis/windows/dinput/constants/constants.factor @@ -1,6 +1,6 @@ USING: windows.dinput windows.kernel32 windows.ole32 windows.com windows.com.syntax alien alien.c-types alien.syntax kernel system namespaces -combinators sequences symbols fry math accessors macros words quotations +combinators sequences fry math accessors macros words quotations libc continuations generalizations splitting locals assocs init struct-arrays ; IN: windows.dinput.constants diff --git a/basis/windows/dinput/dinput.factor b/basis/windows/dinput/dinput.factor index 76cba4ff36..1cd22beb75 100755 --- a/basis/windows/dinput/dinput.factor +++ b/basis/windows/dinput/dinput.factor @@ -1,6 +1,5 @@ USING: windows.kernel32 windows.ole32 windows.com windows.com.syntax -alien alien.c-types alien.syntax kernel system namespaces math constants -alias ; +alien alien.c-types alien.syntax kernel system namespaces math ; IN: windows.dinput << diff --git a/basis/windows/errors/errors.factor b/basis/windows/errors/errors.factor index 7c19cbde53..56bba768de 100644 --- a/basis/windows/errors/errors.factor +++ b/basis/windows/errors/errors.factor @@ -1,4 +1,3 @@ -USING: kernel constants ; IN: windows.errors CONSTANT: ERROR_SUCCESS 0 diff --git a/basis/windows/gdi32/gdi32.factor b/basis/windows/gdi32/gdi32.factor index 9c16664de8..077adf1961 100755 --- a/basis/windows/gdi32/gdi32.factor +++ b/basis/windows/gdi32/gdi32.factor @@ -1,7 +1,7 @@ ! FUNCTION: AbortDoc ! Copyright (C) 2005, 2006 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.syntax kernel windows.types alias constants ; +USING: alien alien.syntax kernel windows.types ; IN: windows.gdi32 ! Stock Logical Objects diff --git a/basis/windows/kernel32/kernel32.factor b/basis/windows/kernel32/kernel32.factor index cdfb31cbf7..7fd90acbe8 100755 --- a/basis/windows/kernel32/kernel32.factor +++ b/basis/windows/kernel32/kernel32.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2005, 2006 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.syntax kernel windows.types alias constants ; +USING: alien alien.syntax kernel windows.types ; IN: windows.kernel32 CONSTANT: MAX_PATH 260 diff --git a/basis/windows/messages/messages.factor b/basis/windows/messages/messages.factor index bb30968217..10e6cd43c5 100755 --- a/basis/windows/messages/messages.factor +++ b/basis/windows/messages/messages.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2006 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: accessors assocs hashtables kernel math namespaces words -windows.types vocabs sequences constants alias ; +windows.types vocabs sequences ; IN: windows.messages SYMBOL: windows-messages diff --git a/basis/windows/shell32/shell32.factor b/basis/windows/shell32/shell32.factor index 1282d3b9a5..b8e6d2c2b0 100644 --- a/basis/windows/shell32/shell32.factor +++ b/basis/windows/shell32/shell32.factor @@ -3,7 +3,7 @@ USING: alien alien.c-types alien.strings alien.syntax combinators io.encodings.utf16n io.files io.pathnames kernel windows windows.com windows.com.syntax windows.ole32 -windows.user32 constants alias ; +windows.user32 ; IN: windows.shell32 CONSTANT: CSIDL_DESKTOP HEX: 00 diff --git a/basis/windows/user32/user32.factor b/basis/windows/user32/user32.factor index 88c6d54f0a..e2e2c7e150 100644 --- a/basis/windows/user32/user32.factor +++ b/basis/windows/user32/user32.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2006 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.syntax parser namespaces kernel math -windows.types generalizations math.bitwise alias constants ; +windows.types generalizations math.bitwise ; IN: windows.user32 ! HKL for ActivateKeyboardLayout diff --git a/basis/windows/winsock/winsock.factor b/basis/windows/winsock/winsock.factor index 5c70e82ea9..27069ed743 100644 --- a/basis/windows/winsock/winsock.factor +++ b/basis/windows/winsock/winsock.factor @@ -2,8 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.strings alien.syntax arrays byte-arrays kernel math sequences windows.types windows.kernel32 -windows.errors windows math.bitwise alias io.encodings.utf16n -alias constants ; +windows.errors windows math.bitwise io.encodings.utf16n ; IN: windows.winsock USE: libc diff --git a/basis/x11/xlib/xlib.factor b/basis/x11/xlib/xlib.factor index 07872fe576..f86c24b845 100644 --- a/basis/x11/xlib/xlib.factor +++ b/basis/x11/xlib/xlib.factor @@ -13,7 +13,7 @@ USING: kernel arrays alien alien.c-types alien.strings alien.syntax math math.bitwise words sequences namespaces -continuations io io.encodings.ascii alias ; +continuations io io.encodings.ascii ; IN: x11.xlib LIBRARY: xlib diff --git a/basis/xmode/marker/state/state.factor b/basis/xmode/marker/state/state.factor index 096230ff4e..7b28bcfcdf 100644 --- a/basis/xmode/marker/state/state.factor +++ b/basis/xmode/marker/state/state.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: xmode.marker.context xmode.rules symbols accessors +USING: xmode.marker.context xmode.rules accessors xmode.tokens namespaces make kernel sequences assocs math ; IN: xmode.marker.state diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index badc1f5218..9b2db4099f 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -40,7 +40,10 @@ IN: bootstrap.syntax "PRIVATE>" "SBUF\"" "SINGLETON:" + "SINGLETONS:" "SYMBOL:" + "SYMBOLS:" + "CONSTANT:" "TUPLE:" "SLOT:" "T{" @@ -48,6 +51,12 @@ IN: bootstrap.syntax "INTERSECTION:" "USE:" "USING:" + "QUALIFIED:" + "QUALIFIED-WITH:" + "FROM:" + "EXCLUDE:" + "RENAME:" + "ALIAS:" "V{" "W{" "[" diff --git a/core/classes/classes.factor b/core/classes/classes.factor index 2ce4b934c8..acff3d57e5 100644 --- a/core/classes/classes.factor +++ b/core/classes/classes.factor @@ -1,8 +1,9 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays definitions assocs kernel kernel.private -slots.private namespaces make sequences strings words vectors -math quotations combinators sorting effects graphs vocabs sets ; +slots.private namespaces make sequences strings words words.symbol +vectors math quotations combinators sorting effects graphs +vocabs sets ; IN: classes SYMBOL: class<=-cache diff --git a/core/classes/singleton/singleton-docs.factor b/core/classes/singleton/singleton-docs.factor index f647b006d9..d6911576dd 100644 --- a/core/classes/singleton/singleton-docs.factor +++ b/core/classes/singleton/singleton-docs.factor @@ -4,6 +4,7 @@ IN: classes.singleton ARTICLE: "singletons" "Singleton classes" "A singleton is a class with only one instance and with no state." { $subsection POSTPONE: SINGLETON: } +{ $subsection POSTPONE: SINGLETONS: } { $subsection define-singleton-class } "The set of all singleton classes is itself a class:" { $subsection singleton-class? } diff --git a/core/compiler/errors/errors-docs.factor b/core/compiler/errors/errors-docs.factor index cb896dbf53..aa4f8e329d 100644 --- a/core/compiler/errors/errors-docs.factor +++ b/core/compiler/errors/errors-docs.factor @@ -1,6 +1,6 @@ IN: compiler.errors USING: help.markup help.syntax vocabs.loader words io -quotations ; +quotations words.symbol ; ARTICLE: "compiler-errors" "Compiler warnings and errors" "The compiler saves various notifications in a global variable:" diff --git a/core/effects/effects.factor b/core/effects/effects.factor index db6b2461b5..8a06653eb8 100644 --- a/core/effects/effects.factor +++ b/core/effects/effects.factor @@ -44,8 +44,6 @@ M: effect effect>string ( effect -- string ) GENERIC: stack-effect ( word -- effect/f ) -M: symbol stack-effect drop (( -- symbol )) ; - M: word stack-effect { "declared-effect" "inferred-effect" } swap props>> [ at ] curry map [ ] find nip ; diff --git a/core/math/order/order-docs.factor b/core/math/order/order-docs.factor index c8d3095ce6..ef006bbc21 100644 --- a/core/math/order/order-docs.factor +++ b/core/math/order/order-docs.factor @@ -1,5 +1,5 @@ USING: help.markup help.syntax kernel math quotations -math.private words ; +math.private words words.symbol ; IN: math.order HELP: <=> diff --git a/core/parser/parser-docs.factor b/core/parser/parser-docs.factor index 92e5922802..625c1e9c43 100644 --- a/core/parser/parser-docs.factor +++ b/core/parser/parser-docs.factor @@ -1,78 +1,10 @@ USING: help.markup help.syntax kernel sequences words math strings vectors quotations generic effects classes vocabs.loader definitions io vocabs source-files -quotations namespaces compiler.units assocs lexer ; +quotations namespaces compiler.units assocs lexer +words.symbol words.alias words.constant vocabs.parser ; IN: parser -ARTICLE: "vocabulary-search-shadow" "Shadowing word names" -"If adding a vocabulary to the search path results in a word in another vocabulary becoming inaccessible due to the new vocabulary defining a word with the same name, we say that the old word has been " { $emphasis "shadowed" } "." -$nl -"Here is an example where shadowing occurs:" -{ $code - "IN: foe" - "USING: sequences io ;" - "" - ": append" - " \"foe::append calls sequences:append\" print append ;" - "" - "IN: fee" - "" - ": append" - " \"fee::append calls fee:append\" print append ;" - "" - "IN: fox" - "USE: foe" - "" - ": append" - " \"fox::append calls foe:append\" print append ;" - "" - "\"1234\" \"5678\" append print" - "" - "USE: fox" - "\"1234\" \"5678\" append print" -} -"When placed in a source file and run, the above code produces the following output:" -{ $code - "foe:append calls sequences:append" - "12345678" - "fee:append calls foe:append" - "foe:append calls sequences:append" - "12345678" -} -"The " { $vocab-link "qualified" } " vocabulary contains some tools for helping with shadowing." ; - -ARTICLE: "vocabulary-search-errors" "Word lookup errors" -"If the parser cannot not find a word in the current vocabulary search path, it attempts to look for the word in all loaded vocabularies." -$nl -"If " { $link auto-use? } " mode is off, a restartable error is thrown with a restart for each vocabulary in question, together with a restart which defers the word in the current vocabulary, as if " { $link POSTPONE: DEFER: } " was used." -$nl -"If " { $link auto-use? } " mode is on and only one vocabulary has a word with this name, the vocabulary is added to the search path and parsing continues." -$nl -"If any restarts were invoked, or if " { $link auto-use? } " is on, the parser will print the correct " { $link POSTPONE: USING: } " after parsing completes. This form can be copy and pasted back into the source file." -{ $subsection auto-use? } ; - -ARTICLE: "vocabulary-search" "Vocabulary search path" -"When the parser reads a token, it attempts to look up a word named by that token. The lookup is performed by searching each vocabulary in the search path, in order." -$nl -"For a source file the vocabulary search path starts off with one vocabulary:" -{ $code "syntax" } -"The " { $vocab-link "syntax" } " vocabulary consists of a set of parsing words for reading Factor data and defining new words." -$nl -"In the listener, the " { $vocab-link "scratchpad" } " is the default vocabulary for new word definitions. However, when loading source files, there is no default vocabulary. Defining words before declaring a vocabulary with " { $link POSTPONE: IN: } " results in an error." -$nl -"At the interactive listener, the default search path contains many more vocabularies. Details on the default search path and parser invocation are found in " { $link "parser" } "." -$nl -"Three parsing words deal with the vocabulary search path:" -{ $subsection POSTPONE: USE: } -{ $subsection POSTPONE: USING: } -{ $subsection POSTPONE: IN: } -"Private words can be defined; note that this is just a convention and they can be called from other vocabularies anyway:" -{ $subsection POSTPONE: } -{ $subsection "vocabulary-search-errors" } -{ $subsection "vocabulary-search-shadow" } -{ $see-also "words" "qualified" } ; - ARTICLE: "reading-ahead" "Reading ahead" "Parsing words can consume input:" { $subsection scan } diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index 6ddf299f7f..bdbd6b37a8 100644 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -502,3 +502,54 @@ DEFER: blah [ ] [ f lexer set f file set "Hello world" note. ] unit-test [ "CHAR: \\u9999999999999" eval ] must-fail + +SYMBOLS: a b c ; + +[ a ] [ a ] unit-test +[ b ] [ b ] unit-test +[ c ] [ c ] unit-test + +DEFER: blah + +[ ] [ "IN: symbols.tests GENERIC: blah" eval ] unit-test +[ ] [ "IN: symbols.tests USE: symbols SYMBOLS: blah ;" eval ] unit-test + +[ f ] [ \ blah generic? ] unit-test +[ t ] [ \ blah symbol? ] unit-test + +[ "IN: symbols.tests USE: symbols SINGLETONS: blah blah blah ;" eval ] +[ error>> error>> def>> \ blah eq? ] +must-fail-with + +IN: qualified.tests.foo +: x 1 ; +: y 5 ; +IN: qualified.tests.bar +: x 2 ; +: y 4 ; +IN: qualified.tests.baz +: x 3 ; + +QUALIFIED: qualified.tests.foo +QUALIFIED: qualified.tests.bar +[ 1 2 3 ] [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test + +QUALIFIED-WITH: qualified.tests.bar p +[ 2 ] [ p:x ] unit-test + +RENAME: x qualified.tests.baz => y +[ 3 ] [ y ] unit-test + +FROM: qualified.tests.baz => x ; +[ 3 ] [ x ] unit-test +[ 3 ] [ y ] unit-test + +EXCLUDE: qualified.tests.bar => x ; +[ 3 ] [ x ] unit-test +[ 4 ] [ y ] unit-test + +[ "USE: qualified IN: qualified.tests FROM: qualified.tests => doesnotexist ;" eval ] +[ error>> no-word-error? ] must-fail-with + +[ "USE: qualified IN: qualified.tests RENAME: doesnotexist qualified.tests => blah" eval ] +[ error>> no-word-error? ] must-fail-with diff --git a/core/parser/parser.factor b/core/parser/parser.factor index 4586cfe34e..81ed91290c 100644 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -1,11 +1,11 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays definitions generic assocs kernel math namespaces -sequences strings vectors words quotations io +sequences strings vectors words words.symbol quotations io combinators sorting splitting math.parser effects continuations io.files io.streams.string vocabs io.encodings.utf8 source-files classes hashtables compiler.errors compiler.units accessors sets -lexer ; +lexer vocabs.parser ; IN: parser : location ( -- loc ) @@ -29,27 +29,6 @@ t parser-notes set-global "Note: " write dup print ] when drop ; -SYMBOL: use -SYMBOL: in - -: (use+) ( vocab -- ) - vocab-words use get push ; - -: use+ ( vocab -- ) - load-vocab (use+) ; - -: add-use ( seq -- ) [ use+ ] each ; - -: set-use ( seq -- ) - [ vocab-words ] V{ } map-as sift use set ; - -: check-vocab-string ( name -- name ) - dup string? - [ "Vocabulary name must be a string" throw ] unless ; - -: set-in ( name -- ) - check-vocab-string dup in set create-vocab (use+) ; - M: parsing-word stack-effect drop (( parsed -- parsed )) ; TUPLE: no-current-vocab ; @@ -69,17 +48,6 @@ TUPLE: no-current-vocab ; : CREATE-WORD ( -- word ) CREATE dup reset-generic ; -: word-restarts ( name possibilities -- restarts ) - natural-sort - [ [ vocabulary>> "Use the " " vocabulary" surround ] keep ] { } map>assoc - swap "Defer word in current vocabulary" swap 2array - suffix ; - -ERROR: no-word-error name ; - -: ( name possibilities -- error restarts ) - [ drop \ no-word-error boa ] [ word-restarts ] 2bi ; - SYMBOL: amended-use SYMBOL: auto-use? diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index 7a1cb5fd92..54b8b1b401 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -1,7 +1,7 @@ USING: generic help.syntax help.markup kernel math parser words effects classes generic.standard classes.tuple generic.math generic.standard arrays io.pathnames vocabs.loader io sequences -assocs ; +assocs words.symbol words.alias words.constant ; IN: syntax ARTICLE: "parser-algorithm" "Parser algorithm" @@ -344,7 +344,41 @@ HELP: SYMBOL: { $description "Defines a new symbol word in the current vocabulary. Symbols push themselves on the stack when executed, and are used to identify variables (see " { $link "namespaces" } ") as well as for storing crufties in word properties (see " { $link "word-props" } ")." } { $examples { $example "USE: prettyprint" "IN: scratchpad" "SYMBOL: foo\nfoo ." "foo" } } ; -{ define-symbol POSTPONE: SYMBOL: } related-words +{ define-symbol POSTPONE: SYMBOL: POSTPONE: SYMBOLS: } related-words + +HELP: SYMBOLS: +{ $syntax "SYMBOLS: words... ;" } +{ $values { "words" "a sequence of new words to define" } } +{ $description "Creates a new symbol for every token until the " { $snippet ";" } "." } +{ $examples { $example "USING: prettyprint ;" "IN: scratchpad" "SYMBOLS: foo bar baz ;\nfoo . bar . baz ." "foo\nbar\nbaz" } } ; + +HELP: SINGLETONS: +{ $syntax "SINGLETONS: words... ;" } +{ $values { "words" "a sequence of new words to define" } } +{ $description "Creates a new singleton for every token until the " { $snippet ";" } "." } ; + +HELP: ALIAS: +{ $syntax "ALIAS: new-word existing-word" } +{ $values { "new-word" word } { "existing-word" word } } +{ $description "Creates a new inlined word that calls the existing word." } +{ $examples + { $example "USING: prettyprint sequences ;" + "IN: alias.test" + "ALIAS: sequence-nth nth" + "0 { 10 20 30 } sequence-nth ." + "10" + } +} ; + +{ define-alias POSTPONE: ALIAS: } related-words + +HELP: CONSTANT: +{ $syntax "CONSTANT: word value" } +{ $values { "word" word } { "value" object } } +{ $description "Creates a word which pushes a value on the stack." } +{ $examples { $code "CONSTANT: magic 1" "CONSTANT: science HEX: ff0f" } } ; + +{ define-constant POSTPONE: CONSTANT: } related-words HELP: \ { $syntax "\\ word" } @@ -376,6 +410,47 @@ HELP: USING: { $description "Adds a list of vocabularies to the front of the search path, with later vocabularies taking precedence." } { $errors "Throws an error if one of the vocabularies does not exist." } ; +HELP: QUALIFIED: +{ $syntax "QUALIFIED: vocab" } +{ $description "Similar to " { $link POSTPONE: USE: } " but loads vocabulary with prefix." } +{ $examples { $example + "USING: prettyprint qualified ;" + "QUALIFIED: math" + "1 2 math:+ ." "3" +} } ; + +HELP: QUALIFIED-WITH: +{ $syntax "QUALIFIED-WITH: vocab word-prefix" } +{ $description "Works like " { $link POSTPONE: QUALIFIED: } " but uses " { $snippet "word-prefix" } " as prefix." } +{ $examples { $code + "USING: prettyprint qualified ;" + "QUALIFIED-WITH: math m" + "1 2 m:+ ." + "3" +} } ; + +HELP: FROM: +{ $syntax "FROM: vocab => words ... ;" } +{ $description "Imports " { $snippet "words" } " from " { $snippet "vocab" } "." } +{ $examples { $code + "FROM: math.parser => bin> hex> ; ! imports only bin> and hex>" } } ; + +HELP: EXCLUDE: +{ $syntax "EXCLUDE: vocab => words ... ;" } +{ $description "Imports everything from " { $snippet "vocab" } " excluding " { $snippet "words" } "." } +{ $examples { $code + "EXCLUDE: math.parser => bin> hex> ; ! imports everything but bin> and hex>" } } ; + +HELP: RENAME: +{ $syntax "RENAME: word vocab => newname" } +{ $description "Imports " { $snippet "word" } " from " { $snippet "vocab" } ", but renamed to " { $snippet "newname" } "." } +{ $examples { $example + "USING: prettyprint qualified ;" + "RENAME: + math => -" + "2 3 - ." + "5" +} } ; + HELP: IN: { $syntax "IN: vocabulary" } { $values { "vocabulary" "a new vocabulary name" } } diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 9640aa9275..c81fc9201e 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -2,12 +2,13 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien arrays byte-arrays definitions generic hashtables kernel math namespaces parser lexer sequences strings -strings.parser sbufs vectors words quotations io assocs -splitting classes.tuple generic.standard generic.math -generic.parser classes io.pathnames vocabs classes.parser -classes.union classes.intersection classes.mixin -classes.predicate classes.singleton classes.tuple.parser -compiler.units combinators effects.parser slots ; +strings.parser sbufs vectors words words.symbol words.constant +words.alias quotations io assocs splitting classes.tuple +generic.standard generic.math generic.parser classes +io.pathnames vocabs vocabs.parser classes.parser classes.union +classes.intersection classes.mixin classes.predicate +classes.singleton classes.tuple.parser compiler.units +combinators effects.parser slots ; IN: bootstrap.syntax ! These words are defined as a top-level form, instead of with @@ -22,7 +23,8 @@ IN: bootstrap.syntax "syntax" lookup t "delimiter" set-word-prop ; : define-syntax ( name quot -- ) - [ "syntax" lookup dup ] dip define make-parsing ; + [ dup "syntax" lookup [ dup ] [ no-word-error ] ?if ] dip + define make-parsing ; [ { "]" "}" ";" ">>" } [ define-delimiter ] each @@ -51,6 +53,22 @@ IN: bootstrap.syntax "USING:" [ ";" parse-tokens add-use ] define-syntax + "QUALIFIED:" [ scan dup add-qualified ] define-syntax + + "QUALIFIED-WITH:" [ scan scan add-qualified ] define-syntax + + "FROM:" [ + scan "=>" expect ";" parse-tokens swap add-words-from + ] define-syntax + + "EXCLUDE:" [ + scan "=>" expect ";" parse-tokens swap add-words-excluding + ] define-syntax + + "RENAME:" [ + scan scan "=>" expect scan add-renamed-word + ] define-syntax + "HEX:" [ 16 parse-base ] define-syntax "OCT:" [ 8 parse-base ] define-syntax "BIN:" [ 2 parse-base ] define-syntax @@ -97,6 +115,24 @@ IN: bootstrap.syntax CREATE-WORD define-symbol ] define-syntax + "SYMBOLS:" [ + ";" parse-tokens + [ create-in dup reset-generic define-symbol ] each + ] define-syntax + + "SINGLETONS:" [ + ";" parse-tokens + [ create-class-in define-singleton-class ] each + ] define-syntax + + "ALIAS:" [ + CREATE-WORD scan-word define-alias + ] define-syntax + + "CONSTANT:" [ + CREATE scan-object define-constant + ] define-syntax + "DEFER:" [ scan current-vocab create dup old-definitions get [ delete-at ] with each diff --git a/core/vocabs/parser/authors.txt b/core/vocabs/parser/authors.txt new file mode 100644 index 0000000000..3095b9b26c --- /dev/null +++ b/core/vocabs/parser/authors.txt @@ -0,0 +1,3 @@ +Daniel Ehrenberg +Bruno Deferrari +Slava Pestov diff --git a/core/vocabs/parser/parser-docs.factor b/core/vocabs/parser/parser-docs.factor new file mode 100644 index 0000000000..b2e964962d --- /dev/null +++ b/core/vocabs/parser/parser-docs.factor @@ -0,0 +1,81 @@ +USING: help.markup help.syntax parser ; +IN: vocabs.parser + +ARTICLE: "vocabulary-search-shadow" "Shadowing word names" +"If adding a vocabulary to the search path results in a word in another vocabulary becoming inaccessible due to the new vocabulary defining a word with the same name, we say that the old word has been " { $emphasis "shadowed" } "." +$nl +"Here is an example where shadowing occurs:" +{ $code + "IN: foe" + "USING: sequences io ;" + "" + ": append" + " \"foe::append calls sequences:append\" print append ;" + "" + "IN: fee" + "" + ": append" + " \"fee::append calls fee:append\" print append ;" + "" + "IN: fox" + "USE: foe" + "" + ": append" + " \"fox::append calls foe:append\" print append ;" + "" + "\"1234\" \"5678\" append print" + "" + "USE: fox" + "\"1234\" \"5678\" append print" +} +"When placed in a source file and run, the above code produces the following output:" +{ $code + "foe:append calls sequences:append" + "12345678" + "fee:append calls foe:append" + "foe:append calls sequences:append" + "12345678" +} +"The " { $vocab-link "qualified" } " vocabulary contains some tools for helping with shadowing." ; + +ARTICLE: "vocabulary-search-errors" "Word lookup errors" +"If the parser cannot not find a word in the current vocabulary search path, it attempts to look for the word in all loaded vocabularies." +$nl +"If " { $link auto-use? } " mode is off, a restartable error is thrown with a restart for each vocabulary in question, together with a restart which defers the word in the current vocabulary, as if " { $link POSTPONE: DEFER: } " was used." +$nl +"If " { $link auto-use? } " mode is on and only one vocabulary has a word with this name, the vocabulary is added to the search path and parsing continues." +$nl +"If any restarts were invoked, or if " { $link auto-use? } " is on, the parser will print the correct " { $link POSTPONE: USING: } " after parsing completes. This form can be copy and pasted back into the source file." +{ $subsection auto-use? } ; + +ARTICLE: "vocabulary-search" "Vocabulary search path" +"When the parser reads a token, it attempts to look up a word named by that token. The lookup is performed by searching each vocabulary in the search path, in order." +$nl +"For a source file the vocabulary search path starts off with one vocabulary:" +{ $code "syntax" } +"The " { $vocab-link "syntax" } " vocabulary consists of a set of parsing words for reading Factor data and defining new words." +$nl +"In the listener, the " { $vocab-link "scratchpad" } " is the default vocabulary for new word definitions. However, when loading source files, there is no default vocabulary. Defining words before declaring a vocabulary with " { $link POSTPONE: IN: } " results in an error." +$nl +"At the interactive listener, the default search path contains many more vocabularies. Details on the default search path and parser invocation are found in " { $link "parser" } "." +$nl +"Three parsing words deal with the vocabulary search path:" +{ $subsection POSTPONE: IN: } +{ $subsection POSTPONE: USE: } +{ $subsection POSTPONE: USING: } +"There are some additional parsing words give more control over word lookup than is offered by " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } ":" +{ $subsection POSTPONE: QUALIFIED: } +{ $subsection POSTPONE: QUALIFIED-WITH: } +{ $subsection POSTPONE: FROM: } +{ $subsection POSTPONE: EXCLUDE: } +{ $subsection POSTPONE: RENAME: } +"These words are useful when there is no way to avoid using two vocabularies with identical word names in the same source file." +$nl +"Private words can be defined; note that this is just a convention and they can be called from other vocabularies anyway:" +{ $subsection POSTPONE: } +{ $subsection "vocabulary-search-errors" } +{ $subsection "vocabulary-search-shadow" } +{ $see-also "words" } ; + +ABOUT: "vocabulary-search" diff --git a/core/vocabs/parser/parser.factor b/core/vocabs/parser/parser.factor new file mode 100644 index 0000000000..35feae34bb --- /dev/null +++ b/core/vocabs/parser/parser.factor @@ -0,0 +1,59 @@ +! Copyright (C) 2007, 2008 Daniel Ehrenberg, Bruno Deferrari, +! Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: assocs hashtables kernel namespaces sequences +sets strings vocabs sorting accessors arrays ; +IN: vocabs.parser + +ERROR: no-word-error name ; + +: word-restarts ( name possibilities -- restarts ) + natural-sort + [ [ vocabulary>> "Use the " " vocabulary" surround ] keep ] { } map>assoc + swap "Defer word in current vocabulary" swap 2array + suffix ; + +: ( name possibilities -- error restarts ) + [ drop \ no-word-error boa ] [ word-restarts ] 2bi ; + +SYMBOL: use +SYMBOL: in + +: (use+) ( vocab -- ) + vocab-words use get push ; + +: use+ ( vocab -- ) + load-vocab (use+) ; + +: add-use ( seq -- ) [ use+ ] each ; + +: set-use ( seq -- ) + [ vocab-words ] V{ } map-as sift use set ; + +: add-qualified ( vocab prefix -- ) + [ load-vocab vocab-words ] [ CHAR: : suffix ] bi* + [ swap [ prepend ] dip ] curry assoc-map + use get push ; + +: partial-vocab ( words vocab -- assoc ) + load-vocab vocab-words + [ dupd at [ no-word-error ] unless* ] curry { } map>assoc ; + +: add-words-from ( words vocab -- ) + partial-vocab use get push ; + +: partial-vocab-excluding ( words vocab -- assoc ) + load-vocab [ vocab-words keys swap diff ] keep partial-vocab ; + +: add-words-excluding ( words vocab -- ) + partial-vocab-excluding use get push ; + +: add-renamed-word ( word vocab new-name -- ) + [ load-vocab vocab-words dupd at [ ] [ no-word-error ] ?if ] dip + associate use get push ; + +: check-vocab-string ( name -- name ) + dup string? [ "Vocabulary name must be a string" throw ] unless ; + +: set-in ( name -- ) + check-vocab-string dup in set create-vocab (use+) ; diff --git a/core/words/alias/alias-docs.factor b/core/words/alias/alias-docs.factor new file mode 100644 index 0000000000..d5696479cc --- /dev/null +++ b/core/words/alias/alias-docs.factor @@ -0,0 +1,12 @@ +USING: help.markup help.syntax words.alias ; +IN: words.alias + +ARTICLE: "words.alias" "Word aliasing" +"There is a syntax for defining new names for existing words. This useful for C library bindings, for example in the Win32 API, where words need to be renamed for symmetry." +$nl +"Define a new word that aliases another word:" +{ $subsection POSTPONE: ALIAS: } +"Define an alias at run-time:" +{ $subsection define-alias } ; + +ABOUT: "words.alias" diff --git a/core/words/alias/alias.factor b/core/words/alias/alias.factor new file mode 100644 index 0000000000..0615e8333e --- /dev/null +++ b/core/words/alias/alias.factor @@ -0,0 +1,16 @@ +! Copyright (C) 2008 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: quotations effects accessors sequences words kernel ; +IN: words.alias + +PREDICATE: alias < word "alias" word-prop ; + +: define-alias ( new old -- ) + [ [ 1quotation ] [ stack-effect ] bi define-inline ] + [ drop t "alias" set-word-prop ] 2bi ; + +M: alias reset-word + [ call-next-method ] [ f "alias" set-word-prop ] bi ; + +M: alias stack-effect + def>> first stack-effect ; diff --git a/core/words/alias/authors.txt b/core/words/alias/authors.txt new file mode 100644 index 0000000000..1901f27a24 --- /dev/null +++ b/core/words/alias/authors.txt @@ -0,0 +1 @@ +Slava Pestov diff --git a/core/words/alias/summary.txt b/core/words/alias/summary.txt new file mode 100644 index 0000000000..15690a7b9b --- /dev/null +++ b/core/words/alias/summary.txt @@ -0,0 +1 @@ +Defining multiple words with the same name diff --git a/core/words/constant/constant.factor b/core/words/constant/constant.factor new file mode 100644 index 0000000000..43b7f37599 --- /dev/null +++ b/core/words/constant/constant.factor @@ -0,0 +1,10 @@ +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors kernel sequences words ; +IN: words.constant + +PREDICATE: constant < word ( obj -- ? ) + def>> dup length 1 = [ first word? not ] [ drop f ] if ; + +: define-constant ( word value -- ) + [ ] curry (( -- value )) define-inline ; diff --git a/core/words/symbol/symbol-docs.factor b/core/words/symbol/symbol-docs.factor new file mode 100644 index 0000000000..1fcba9a3e2 --- /dev/null +++ b/core/words/symbol/symbol-docs.factor @@ -0,0 +1,28 @@ +USING: help.syntax help.markup words.symbol words compiler.units ; +IN: words.symbol + +HELP: symbol +{ $description "The class of symbols created by " { $link POSTPONE: SYMBOL: } "." } ; + +HELP: define-symbol +{ $values { "word" word } } +{ $description "Defines the word to push itself on the stack when executed. This is the run time equivalent of " { $link POSTPONE: SYMBOL: } "." } +{ $notes "This word must be called from inside " { $link with-compilation-unit } "." } +{ $side-effects "word" } ; + +ARTICLE: "words.symbol" "Symbols" +"A symbol pushes itself on the stack when executed. By convention, symbols are used as variable names (" { $link "namespaces" } ")." +{ $subsection symbol } +{ $subsection symbol? } +"Defining symbols at parse time:" +{ $subsection POSTPONE: SYMBOL: } +{ $subsection POSTPONE: SYMBOLS: } +"Defining symbols at run time:" +{ $subsection define-symbol } +"Symbols are just compound definitions in disguise. The following two lines are equivalent:" +{ $code + "SYMBOL: foo" + ": foo ( -- value ) \\ foo ;" +} ; + +ABOUT: "words.symbol" diff --git a/core/words/symbol/symbol.factor b/core/words/symbol/symbol.factor new file mode 100644 index 0000000000..a107808eec --- /dev/null +++ b/core/words/symbol/symbol.factor @@ -0,0 +1,15 @@ +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: kernel sequences accessors definitions +words words.constant ; +IN: words.symbol + +PREDICATE: symbol < constant ( obj -- ? ) + [ def>> ] [ [ ] curry ] bi sequence= ; + +M: symbol definer drop \ SYMBOL: f ; + +M: symbol definition drop f ; + +: define-symbol ( word -- ) + dup define-constant ; diff --git a/core/words/words-docs.factor b/core/words/words-docs.factor index 91b10936c0..02fb5cf54e 100644 --- a/core/words/words-docs.factor +++ b/core/words/words-docs.factor @@ -35,20 +35,6 @@ $nl $nl "All other types of word definitions, such as " { $link "symbols" } " and " { $link "generic" } ", are just special cases of the above." ; -ARTICLE: "symbols" "Symbols" -"A symbol pushes itself on the stack when executed. By convention, symbols are used as variable names (" { $link "namespaces" } ")." -{ $subsection symbol } -{ $subsection symbol? } -"Defining symbols at parse time:" -{ $subsection POSTPONE: SYMBOL: } -"Defining symbols at run time:" -{ $subsection define-symbol } -"Symbols are just compound definitions in disguise. The following two lines are equivalent:" -{ $code - "SYMBOL: foo" - ": foo ( -- value ) \\ foo ;" -} ; - ARTICLE: "primitives" "Primitives" "Primitives are words defined in the Factor VM. They provide the essential low-level services to the rest of the system." { $subsection primitive } @@ -91,7 +77,8 @@ ARTICLE: "word-definition" "Defining words" } "The latter is a more dynamic feature that can be used to implement code generation and such, and in fact parse time defining words are implemented in terms of run time defining words." { $subsection "colon-definition" } -{ $subsection "symbols" } +{ $subsection "words.symbol" } +{ $subsection "words.alias" } { $subsection "primitives" } { $subsection "deferred" } { $subsection "declarations" } @@ -193,9 +180,6 @@ HELP: deferred HELP: primitive { $description "The class of primitive words." } ; -HELP: symbol -{ $description "The class of symbols created by " { $link POSTPONE: SYMBOL: } "." } ; - HELP: word-prop { $values { "word" word } { "name" "a property name" } { "value" "a property value" } } { $description "Retrieves a word property. Word property names are conventionally strings." } ; @@ -214,12 +198,6 @@ HELP: word-xt ( word -- start end ) { $values { "word" word } { "start" "the word's start address" } { "end" "the word's end address" } } { $description "Outputs the machine code address of the word's definition." } ; -HELP: define-symbol -{ $values { "word" word } } -{ $description "Defines the word to push itself on the stack when executed. This is the run time equivalent of " { $link POSTPONE: SYMBOL: } "." } -{ $notes "This word must be called from inside " { $link with-compilation-unit } "." } -{ $side-effects "word" } ; - HELP: define { $values { "word" word } { "def" quotation } } { $description "Defines the word to call a quotation when executed. This is the run time equivalent of " { $link POSTPONE: : } "." } diff --git a/core/words/words.factor b/core/words/words.factor index f0beab1809..c75711ea39 100644 --- a/core/words/words.factor +++ b/core/words/words.factor @@ -28,11 +28,6 @@ PREDICATE: deferred < word ( obj -- ? ) M: deferred definer drop \ DEFER: f ; M: deferred definition drop f ; -PREDICATE: symbol < word ( obj -- ? ) - [ def>> ] [ [ ] curry ] bi sequence= ; -M: symbol definer drop \ SYMBOL: f ; -M: symbol definition drop f ; - PREDICATE: primitive < word ( obj -- ? ) [ def>> [ do-primitive ] tail? ] [ sub-primitive>> >boolean ] @@ -195,9 +190,6 @@ SYMBOL: visited : define-inline ( word def effect -- ) [ define-declared ] [ 2drop make-inline ] 3bi ; -: define-symbol ( word -- ) - dup [ ] curry (( -- word )) define-inline ; - GENERIC: reset-word ( word -- ) M: word reset-word diff --git a/extra/advice/advice.factor b/extra/advice/advice.factor index 383812e602..fbdfa9c66b 100644 --- a/extra/advice/advice.factor +++ b/extra/advice/advice.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 James Cash ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences symbols fry words assocs linked-assocs tools.annotations +USING: kernel sequences fry words assocs linked-assocs tools.annotations coroutines lexer parser quotations arrays namespaces continuations ; IN: advice diff --git a/extra/boolean-expr/boolean-expr.factor b/extra/boolean-expr/boolean-expr.factor index 5bf4bf3ad3..8cb5acf74b 100644 --- a/extra/boolean-expr/boolean-expr.factor +++ b/extra/boolean-expr/boolean-expr.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays classes kernel sequences sets -io prettyprint multi-methods symbols ; +io prettyprint multi-methods ; IN: boolean-expr ! Demonstrates the use of Unicode symbols in source files, and diff --git a/extra/cfdg/cfdg.factor b/extra/cfdg/cfdg.factor index e1c89374fd..e2acd6e5d5 100644 --- a/extra/cfdg/cfdg.factor +++ b/extra/cfdg/cfdg.factor @@ -6,7 +6,7 @@ USING: kernel alien.c-types combinators namespaces make arrays vars colors self self.slots random-weighted colors.hsv cfdg.gl accessors ui.gadgets.handler ui.gestures assocs ui.gadgets macros - qualified specialized-arrays.double ; + specialized-arrays.double ; QUALIFIED: syntax diff --git a/extra/crypto/passwd-md5/passwd-md5.factor b/extra/crypto/passwd-md5/passwd-md5.factor index 32a913ef23..e292981876 100644 --- a/extra/crypto/passwd-md5/passwd-md5.factor +++ b/extra/crypto/passwd-md5/passwd-md5.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel base64 checksums.md5 symbols sequences checksums +USING: kernel base64 checksums.md5 sequences checksums locals prettyprint math math.bitwise grouping io combinators fry make combinators.short-circuit math.functions splitting ; IN: crypto.passwd-md5 diff --git a/extra/dns/dns.factor b/extra/dns/dns.factor index be3ba40ac0..980af0fd81 100644 --- a/extra/dns/dns.factor +++ b/extra/dns/dns.factor @@ -7,7 +7,6 @@ USING: kernel byte-arrays combinators strings arrays sequences splitting accessors combinators.cleave newfx - symbols ; IN: dns diff --git a/extra/game-input/dinput/dinput.factor b/extra/game-input/dinput/dinput.factor index cb7b34d8a4..328e4ff013 100755 --- a/extra/game-input/dinput/dinput.factor +++ b/extra/game-input/dinput/dinput.factor @@ -1,4 +1,4 @@ -USING: windows.dinput windows.dinput.constants parser symbols +USING: windows.dinput windows.dinput.constants parser alien.c-types windows.ole32 namespaces assocs kernel arrays vectors windows.kernel32 windows.com windows.dinput shuffle windows.user32 windows.messages sequences combinators locals diff --git a/extra/game-input/game-input.factor b/extra/game-input/game-input.factor index 7699b8bd1e..fa70cef757 100755 --- a/extra/game-input/game-input.factor +++ b/extra/game-input/game-input.factor @@ -1,4 +1,4 @@ -USING: arrays accessors continuations kernel symbols system +USING: arrays accessors continuations kernel system combinators.lib sequences namespaces init vocabs vocabs.loader combinators ; IN: game-input diff --git a/extra/inverse/inverse.factor b/extra/inverse/inverse.factor index 0e3d48fe5b..c34fcf5f57 100755 --- a/extra/inverse/inverse.factor +++ b/extra/inverse/inverse.factor @@ -5,7 +5,7 @@ sequences assocs math arrays stack-checker effects generalizations continuations debugger classes.tuple namespaces make vectors bit-arrays byte-arrays strings sbufs math.functions macros sequences.private combinators mirrors -combinators.short-circuit fry qualified ; +combinators.short-circuit fry ; RENAME: _ fry => __ IN: inverse diff --git a/extra/irc/client/client-tests.factor b/extra/irc/client/client-tests.factor index 622b5eaa2c..c1cbdcf8b8 100644 --- a/extra/irc/client/client-tests.factor +++ b/extra/irc/client/client-tests.factor @@ -1,4 +1,4 @@ -USING: kernel tools.test accessors arrays sequences qualified +USING: kernel tools.test accessors arrays sequences io io.streams.duplex namespaces threads destructors calendar irc.client.private irc.client irc.messages.private concurrency.mailboxes classes assocs combinators ; diff --git a/extra/irc/client/client.factor b/extra/irc/client/client.factor index 8199347feb..0eba6f6af5 100755 --- a/extra/irc/client/client.factor +++ b/extra/irc/client/client.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Bruno Deferrari, Doug Coleman, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: concurrency.mailboxes kernel io.sockets io.encodings.8-bit calendar - accessors destructors namespaces io assocs arrays qualified fry + accessors destructors namespaces io assocs arrays fry continuations threads strings classes combinators splitting hashtables ascii irc.messages ; RENAME: join sequences => sjoin diff --git a/extra/irc/messages/messages-tests.factor b/extra/irc/messages/messages-tests.factor index 41272a43f2..ac1d003b1b 100644 --- a/extra/irc/messages/messages-tests.factor +++ b/extra/irc/messages/messages-tests.factor @@ -1,4 +1,4 @@ -USING: kernel tools.test accessors arrays qualified +USING: kernel tools.test accessors arrays irc.messages irc.messages.private ; EXCLUDE: sequences => join ; IN: irc.messages.tests diff --git a/extra/irc/messages/messages.factor b/extra/irc/messages/messages.factor index 8054dc8075..c88bbc072a 100755 --- a/extra/irc/messages/messages.factor +++ b/extra/irc/messages/messages.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Bruno Deferrari ! See http://factorcode.org/license.txt for BSD license. -USING: kernel fry splitting ascii calendar accessors combinators qualified +USING: kernel fry splitting ascii calendar accessors combinators arrays classes.tuple math.order ; RENAME: join sequences => sjoin EXCLUDE: sequences => join ; diff --git a/extra/irc/ui/ui.factor b/extra/irc/ui/ui.factor index fd64e9a07e..59e4cf6cb4 100755 --- a/extra/irc/ui/ui.factor +++ b/extra/irc/ui/ui.factor @@ -3,7 +3,7 @@ USING: accessors kernel threads combinators concurrency.mailboxes sequences strings hashtables splitting fry assocs hashtables colors - sorting qualified unicode.collation math.order + sorting unicode.collation math.order ui ui.gadgets ui.gadgets.panes ui.gadgets.editors ui.gadgets.scrollers ui.commands ui.gadgets.frames ui.gestures ui.gadgets.tabs ui.gadgets.grids ui.gadgets.packs ui.gadgets.labels diff --git a/extra/koszul/koszul-tests.factor b/extra/koszul/koszul-tests.factor index 01fba49995..13dc341350 100755 --- a/extra/koszul/koszul-tests.factor +++ b/extra/koszul/koszul-tests.factor @@ -1,5 +1,4 @@ -USING: koszul tools.test kernel sequences assocs namespaces -symbols ; +USING: koszul tools.test kernel sequences assocs namespaces ; IN: koszul.tests [ diff --git a/extra/koszul/koszul.factor b/extra/koszul/koszul.factor index 5bd679d92a..3b675e5258 100755 --- a/extra/koszul/koszul.factor +++ b/extra/koszul/koszul.factor @@ -3,7 +3,7 @@ USING: accessors arrays assocs hashtables assocs io kernel math math.vectors math.matrices math.matrices.elimination namespaces parser prettyprint sequences words combinators math.parser -splitting sorting shuffle symbols sets math.order ; +splitting sorting shuffle sets math.order ; IN: koszul ! Utilities diff --git a/extra/mason/release/tidy/tidy.factor b/extra/mason/release/tidy/tidy.factor index 58046ce64c..7327209a06 100644 --- a/extra/mason/release/tidy/tidy.factor +++ b/extra/mason/release/tidy/tidy.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: bootstrap.image continuations debugger fry io.directories io.directories.hierarchy io.files io.launcher -kernel mason.common namespaces qualified sequences ; +kernel mason.common namespaces sequences ; FROM: mason.config => target-os ; IN: mason.release.tidy diff --git a/extra/math/blas/matrices/matrices.factor b/extra/math/blas/matrices/matrices.factor index c8a4ee6292..75ab07709a 100755 --- a/extra/math/blas/matrices/matrices.factor +++ b/extra/math/blas/matrices/matrices.factor @@ -2,7 +2,7 @@ USING: accessors alien alien.c-types arrays byte-arrays combinators combinators.short-circuit fry kernel locals macros math math.blas.cblas math.blas.vectors math.blas.vectors.private math.complex math.functions math.order functors words -sequences sequences.merged sequences.private shuffle symbols +sequences sequences.merged sequences.private shuffle specialized-arrays.direct.float specialized-arrays.direct.double specialized-arrays.float specialized-arrays.double ; IN: math.blas.matrices diff --git a/extra/multi-methods/multi-methods.factor b/extra/multi-methods/multi-methods.factor index cfdc28bb3d..49532665f1 100755 --- a/extra/multi-methods/multi-methods.factor +++ b/extra/multi-methods/multi-methods.factor @@ -245,7 +245,6 @@ M: no-method error. define ; parsing ! Definition protocol. We qualify core generics here -USE: qualified QUALIFIED: syntax syntax:M: generic definer drop \ GENERIC: f ; diff --git a/extra/newfx/newfx.factor b/extra/newfx/newfx.factor index 0da7a9c9fb..8dd82df0d6 100644 --- a/extra/newfx/newfx.factor +++ b/extra/newfx/newfx.factor @@ -1,5 +1,5 @@ -USING: kernel sequences assocs qualified circular sets fry sequences.lib ; +USING: kernel sequences assocs circular sets fry sequences.lib ; USING: math multi-methods ; diff --git a/extra/tar/tar.factor b/extra/tar/tar.factor index 132e401f16..5720c09ed9 100755 --- a/extra/tar/tar.factor +++ b/extra/tar/tar.factor @@ -2,7 +2,7 @@ USING: combinators io io.files io.files.links io.directories io.pathnames io.streams.string kernel math math.parser continuations namespaces pack prettyprint sequences strings system tools.hexdump io.encodings.binary summary accessors -io.backend symbols byte-arrays ; +io.backend byte-arrays ; IN: tar : zero-checksum 256 ; inline diff --git a/extra/usa-cities/usa-cities.factor b/extra/usa-cities/usa-cities.factor index c5e059c519..deb3e15845 100644 --- a/extra/usa-cities/usa-cities.factor +++ b/extra/usa-cities/usa-cities.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: io.files io.encodings.ascii sequences generalizations -math.parser combinators kernel memoize csv symbols summary +math.parser combinators kernel memoize csv summary words accessors math.order binary-search ; IN: usa-cities diff --git a/extra/webkit-demo/deploy.factor b/extra/webkit-demo/deploy.factor index 8c0b1beb83..322212c4fc 100644 --- a/extra/webkit-demo/deploy.factor +++ b/extra/webkit-demo/deploy.factor @@ -1,14 +1,15 @@ USING: tools.deploy.config ; H{ + { deploy-io 1 } + { deploy-threads? f } + { deploy-word-defs? f } { deploy-ui? f } { deploy-compiler? t } + { deploy-word-props? f } + { "stop-after-last-window?" t } + { deploy-unicode? f } { deploy-c-types? f } + { deploy-math? f } { deploy-reflection 1 } { deploy-name "WebKit demo" } - { deploy-io 1 } - { deploy-math? f } - { deploy-word-props? f } - { "stop-after-last-window?" t } - { deploy-word-defs? f } - { deploy-threads? f } }