]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' into experimental
authorAlex Chapman <chapman.alex@gmail.com>
Wed, 25 Feb 2009 00:16:11 +0000 (11:16 +1100)
committerAlex Chapman <chapman.alex@gmail.com>
Wed, 25 Feb 2009 00:16:11 +0000 (11:16 +1100)
673 files changed:
basis/alien/c-types/c-types.factor
basis/alien/complex/functor/summary.txt [new file with mode: 0644]
basis/alien/fortran/fortran.factor
basis/alien/parser/summary.txt [new file with mode: 0644]
basis/alien/prettyprint/summary.txt [new file with mode: 0644]
basis/alien/strings/summary.txt [new file with mode: 0644]
basis/alien/strings/unix/summary.txt [new file with mode: 0644]
basis/alien/strings/windows/summary.txt [new file with mode: 0644]
basis/alien/structs/fields/summary.txt [new file with mode: 0644]
basis/assoc-heaps/summary.txt [new file with mode: 0644]
basis/bitstreams/summary.txt [new file with mode: 0644]
basis/bootstrap/help/help.factor
basis/bootstrap/image/download/download.factor
basis/bootstrap/image/image.factor
basis/bootstrap/stage2.factor
basis/byte-vectors/byte-vectors-docs.factor
basis/cairo/ffi/ffi.factor
basis/cairo/ffi/summary.txt [new file with mode: 0644]
basis/cairo/gadgets/summary.txt [new file with mode: 0644]
basis/calendar/calendar.factor
basis/calendar/format/format-tests.factor
basis/calendar/format/format.factor
basis/calendar/format/macros/summary.txt [new file with mode: 0644]
basis/calendar/unix/summary.txt [new file with mode: 0644]
basis/calendar/windows/summary.txt [new file with mode: 0644]
basis/call/summary.txt [new file with mode: 0644]
basis/checksums/adler-32/adler-32.factor
basis/checksums/adler-32/summary.txt [new file with mode: 0644]
basis/checksums/md5/summary.txt [new file with mode: 0644]
basis/checksums/null/summary.txt [new file with mode: 0644]
basis/checksums/openssl/openssl.factor
basis/checksums/openssl/summary.txt [new file with mode: 0644]
basis/checksums/sha1/summary.txt [new file with mode: 0644]
basis/checksums/sha2/sha2.factor
basis/checksums/sha2/summary.txt [new file with mode: 0644]
basis/checksums/stream/summary.txt [new file with mode: 0644]
basis/cocoa/application/application.factor
basis/cocoa/dialogs/dialogs.factor
basis/cocoa/enumeration/enumeration.factor
basis/cocoa/enumeration/summary.txt [new file with mode: 0644]
basis/cocoa/messages/messages.factor
basis/cocoa/pasteboard/pasteboard.factor
basis/cocoa/plists/summary.txt [new file with mode: 0644]
basis/cocoa/runtime/runtime.factor
basis/cocoa/subclassing/subclassing.factor
basis/cocoa/views/views.factor
basis/cocoa/windows/windows.factor
basis/colors/colors.factor
basis/colors/gray/summary.txt [new file with mode: 0644]
basis/colors/hsv/summary.txt [new file with mode: 0644]
basis/combinators/short-circuit/smart/summary.txt [new file with mode: 0644]
basis/combinators/short-circuit/summary.txt [new file with mode: 0644]
basis/combinators/smart/summary.txt [new file with mode: 0644]
basis/compiler/alien/summary.txt [new file with mode: 0644]
basis/compiler/cfg/alias-analysis/summary.txt [new file with mode: 0644]
basis/compiler/cfg/copy-prop/summary.txt [new file with mode: 0644]
basis/compiler/cfg/dead-code/summary.txt [new file with mode: 0644]
basis/compiler/cfg/debugger/debugger.factor
basis/compiler/cfg/debugger/summary.txt [new file with mode: 0644]
basis/compiler/cfg/def-use/summary.txt [new file with mode: 0644]
basis/compiler/cfg/hats/summary.txt [new file with mode: 0644]
basis/compiler/cfg/height/summary.txt [new file with mode: 0644]
basis/compiler/cfg/instructions/summary.txt [new file with mode: 0644]
basis/compiler/cfg/instructions/syntax/summary.txt [new file with mode: 0644]
basis/compiler/cfg/intrinsics/alien/summary.txt [new file with mode: 0644]
basis/compiler/cfg/intrinsics/allot/summary.txt [new file with mode: 0644]
basis/compiler/cfg/intrinsics/fixnum/summary.txt [new file with mode: 0644]
basis/compiler/cfg/intrinsics/float/summary.txt [new file with mode: 0644]
basis/compiler/cfg/intrinsics/misc/summary.txt [new file with mode: 0644]
basis/compiler/cfg/intrinsics/slots/summary.txt [new file with mode: 0644]
basis/compiler/cfg/intrinsics/summary.txt [new file with mode: 0644]
basis/compiler/cfg/iterator/summary.txt [new file with mode: 0644]
basis/compiler/cfg/linear-scan/allocation/summary.txt [new file with mode: 0644]
basis/compiler/cfg/linear-scan/assignment/summary.txt [new file with mode: 0644]
basis/compiler/cfg/linear-scan/debugger/summary.txt [new file with mode: 0644]
basis/compiler/cfg/linear-scan/live-intervals/summary.txt [new file with mode: 0644]
basis/compiler/cfg/linear-scan/summary.txt [new file with mode: 0644]
basis/compiler/cfg/linearization/summary.txt [new file with mode: 0644]
basis/compiler/cfg/optimizer/summary.txt [new file with mode: 0644]
basis/compiler/cfg/predecessors/summary.txt [new file with mode: 0644]
basis/compiler/cfg/registers/summary.txt [new file with mode: 0644]
basis/compiler/cfg/rpo/summary.txt [new file with mode: 0644]
basis/compiler/cfg/stack-frame/summary.txt [new file with mode: 0644]
basis/compiler/cfg/stacks/summary.txt [new file with mode: 0644]
basis/compiler/cfg/summary.txt [new file with mode: 0644]
basis/compiler/cfg/two-operand/summary.txt [new file with mode: 0644]
basis/compiler/cfg/useless-blocks/summary.txt [new file with mode: 0644]
basis/compiler/cfg/utilities/summary.txt [new file with mode: 0644]
basis/compiler/cfg/value-numbering/expressions/summary.txt [new file with mode: 0644]
basis/compiler/cfg/value-numbering/graph/summary.txt [new file with mode: 0644]
basis/compiler/cfg/value-numbering/propagate/summary.txt [new file with mode: 0644]
basis/compiler/cfg/value-numbering/rewrite/summary.txt [new file with mode: 0644]
basis/compiler/cfg/value-numbering/simplify/summary.txt [new file with mode: 0644]
basis/compiler/cfg/value-numbering/summary.txt [new file with mode: 0644]
basis/compiler/cfg/write-barrier/summary.txt [new file with mode: 0644]
basis/compiler/codegen/summary.txt [new file with mode: 0644]
basis/compiler/compiler-docs.factor
basis/compiler/compiler.factor
basis/compiler/constants/constants.factor
basis/compiler/tests/codegen.factor
basis/compiler/tests/curry.factor
basis/compiler/tests/float.factor
basis/compiler/tests/intrinsics.factor
basis/compiler/tests/optimizer.factor
basis/compiler/tests/peg-regression-2.factor [new file with mode: 0644]
basis/compiler/tests/simple.factor
basis/compiler/tests/tuples.factor
basis/compiler/tree/builder/builder-tests.factor
basis/compiler/tree/builder/builder.factor
basis/compiler/tree/builder/summary.txt [new file with mode: 0644]
basis/compiler/tree/checker/summary.txt [new file with mode: 0644]
basis/compiler/tree/cleanup/cleanup-tests.factor
basis/compiler/tree/cleanup/summary.txt [new file with mode: 0644]
basis/compiler/tree/combinators/summary.txt [new file with mode: 0644]
basis/compiler/tree/comparisons/comparisons.factor
basis/compiler/tree/comparisons/summary.txt [new file with mode: 0644]
basis/compiler/tree/dead-code/branches/summary.txt [new file with mode: 0644]
basis/compiler/tree/dead-code/liveness/summary.txt [new file with mode: 0644]
basis/compiler/tree/dead-code/recursive/summary.txt [new file with mode: 0644]
basis/compiler/tree/dead-code/simple/summary.txt [new file with mode: 0644]
basis/compiler/tree/dead-code/summary.txt [new file with mode: 0644]
basis/compiler/tree/debugger/debugger.factor
basis/compiler/tree/debugger/summary.txt [new file with mode: 0644]
basis/compiler/tree/def-use/simplified/summary.txt [new file with mode: 0644]
basis/compiler/tree/escape-analysis/allocations/summary.txt [new file with mode: 0644]
basis/compiler/tree/escape-analysis/branches/summary.txt [new file with mode: 0644]
basis/compiler/tree/escape-analysis/check/summary.txt [new file with mode: 0644]
basis/compiler/tree/escape-analysis/nodes/summary.txt [new file with mode: 0644]
basis/compiler/tree/escape-analysis/recursive/summary.txt [new file with mode: 0644]
basis/compiler/tree/escape-analysis/simple/summary.txt [new file with mode: 0644]
basis/compiler/tree/escape-analysis/summary.txt [new file with mode: 0644]
basis/compiler/tree/finalization/summary.txt [new file with mode: 0644]
basis/compiler/tree/identities/summary.txt [new file with mode: 0644]
basis/compiler/tree/late-optimizations/summary.txt [new file with mode: 0644]
basis/compiler/tree/modular-arithmetic/summary.txt [new file with mode: 0644]
basis/compiler/tree/normalization/introductions/summary.txt [new file with mode: 0644]
basis/compiler/tree/normalization/renaming/summary.txt [new file with mode: 0644]
basis/compiler/tree/normalization/summary.txt [new file with mode: 0644]
basis/compiler/tree/optimizer/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/branches/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/constraints/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/copy/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/info/info.factor
basis/compiler/tree/propagation/info/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/inlining/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/known-words/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/nodes/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/recursive/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/simple/summary.txt [new file with mode: 0644]
basis/compiler/tree/propagation/slots/summary.txt [new file with mode: 0644]
basis/compiler/tree/recursive/recursive-tests.factor
basis/compiler/tree/recursive/summary.txt [new file with mode: 0644]
basis/compiler/tree/tuple-unboxing/summary.txt [new file with mode: 0644]
basis/compiler/utilities/summary.txt [new file with mode: 0644]
basis/compression/lzw/lzw.factor
basis/compression/lzw/summary.txt [new file with mode: 0644]
basis/compression/zlib/ffi/summary.txt [new file with mode: 0644]
basis/compression/zlib/summary.txt [new file with mode: 0644]
basis/concurrency/flags/summary.txt [new file with mode: 0644]
basis/concurrency/mailboxes/summary.txt [new file with mode: 0644]
basis/constructors/summary.txt [new file with mode: 0644]
basis/core-foundation/arrays/summary.txt [new file with mode: 0644]
basis/core-foundation/bundles/summary.txt [new file with mode: 0644]
basis/core-foundation/core-foundation.factor
basis/core-foundation/data/data.factor
basis/core-foundation/data/summary.txt [new file with mode: 0644]
basis/core-foundation/file-descriptors/file-descriptors.factor
basis/core-foundation/file-descriptors/summary.txt [new file with mode: 0644]
basis/core-foundation/fsevents/fsevents.factor
basis/core-foundation/fsevents/summary.txt [new file with mode: 0644]
basis/core-foundation/run-loop/run-loop.factor
basis/core-foundation/strings/strings.factor
basis/core-foundation/strings/summary.txt [new file with mode: 0644]
basis/core-foundation/time/summary.txt [new file with mode: 0644]
basis/core-foundation/timers/summary.txt [new file with mode: 0644]
basis/core-foundation/urls/summary.txt [new file with mode: 0644]
basis/core-foundation/urls/urls.factor
basis/cpu/ppc/linux/bootstrap.factor
basis/cpu/ppc/linux/summary.txt [new file with mode: 0644]
basis/cpu/ppc/macosx/bootstrap.factor
basis/cpu/ppc/macosx/summary.txt [new file with mode: 0644]
basis/cpu/ppc/ppc.factor
basis/cpu/x86/32/bootstrap.factor
basis/cpu/x86/32/summary.txt [new file with mode: 0644]
basis/cpu/x86/64/bootstrap.factor
basis/cpu/x86/64/unix/bootstrap.factor
basis/cpu/x86/64/unix/summary.txt [new file with mode: 0644]
basis/cpu/x86/64/winnt/bootstrap.factor
basis/cpu/x86/64/winnt/summary.txt [new file with mode: 0644]
basis/cpu/x86/assembler/summary.txt [new file with mode: 0644]
basis/cpu/x86/assembler/syntax/summary.txt [new file with mode: 0644]
basis/db/db.factor
basis/db/errors/errors.factor
basis/db/errors/postgresql/authors.txt [new file with mode: 0644]
basis/db/errors/postgresql/postgresql-tests.factor [new file with mode: 0644]
basis/db/errors/postgresql/postgresql.factor [new file with mode: 0644]
basis/db/errors/sqlite/authors.txt [new file with mode: 0644]
basis/db/errors/sqlite/sqlite-tests.factor [new file with mode: 0644]
basis/db/errors/sqlite/sqlite.factor [new file with mode: 0644]
basis/db/errors/summary.txt [new file with mode: 0644]
basis/db/pools/summary.txt [new file with mode: 0644]
basis/db/postgresql/postgresql-tests.factor
basis/db/postgresql/postgresql.factor
basis/db/postgresql/summary.txt [new file with mode: 0644]
basis/db/queries/summary.txt [new file with mode: 0644]
basis/db/sqlite/lib/lib.factor
basis/db/sqlite/sqlite-tests.factor
basis/db/sqlite/sqlite.factor
basis/db/sqlite/summary.txt [new file with mode: 0644]
basis/db/tester/tester.factor
basis/db/tuples/summary.txt [new file with mode: 0644]
basis/db/tuples/tuples-tests.factor
basis/db/tuples/tuples.factor
basis/db/types/summary.txt [new file with mode: 0644]
basis/db/types/types.factor
basis/debugger/debugger.factor
basis/delegate/protocols/summary.txt [new file with mode: 0644]
basis/editors/emacs/emacs.factor
basis/editors/emacs/windows/authors.txt [new file with mode: 0755]
basis/editors/emacs/windows/windows.factor [new file with mode: 0755]
basis/endian/summary.txt [new file with mode: 0644]
basis/environment/unix/macosx/summary.txt [new file with mode: 0644]
basis/environment/unix/summary.txt [new file with mode: 0644]
basis/environment/winnt/summary.txt [new file with mode: 0644]
basis/farkup/farkup.factor
basis/farkup/tags.txt
basis/ftp/client/client.factor
basis/ftp/client/summary.txt [new file with mode: 0644]
basis/ftp/ftp.factor
basis/ftp/server/server-tests.factor [new file with mode: 0644]
basis/ftp/server/server.factor
basis/ftp/server/summary.txt [new file with mode: 0644]
basis/ftp/summary.txt [new file with mode: 0644]
basis/functors/functors.factor
basis/furnace/actions/actions.factor
basis/furnace/alloy/alloy.factor
basis/furnace/asides/asides.factor
basis/furnace/auth/login/login.factor
basis/furnace/auth/providers/null/null.factor
basis/furnace/conversations/conversations.factor
basis/furnace/sessions/sessions.factor
basis/furnace/utilities/utilities.factor
basis/help/cookbook/cookbook.factor
basis/help/handbook/handbook.factor
basis/help/html/html.factor
basis/help/html/summary.txt [new file with mode: 0644]
basis/help/topics/topics.factor
basis/html/summary.txt [new file with mode: 0644]
basis/html/templates/chloe/chloe-tests.factor
basis/html/templates/chloe/chloe.factor
basis/html/templates/chloe/compiler/summary.txt [new file with mode: 0644]
basis/html/templates/chloe/syntax/syntax.factor
basis/html/templates/fhtml/fhtml-tests.factor
basis/http/http-tests.factor
basis/http/server/dispatchers/summary.txt [new file with mode: 0644]
basis/http/server/filters/summary.txt [new file with mode: 0644]
basis/http/server/redirection/summary.txt [new file with mode: 0644]
basis/http/server/remapping/summary.txt [new file with mode: 0644]
basis/http/server/responses/summary.txt [new file with mode: 0644]
basis/http/server/static/summary.txt [new file with mode: 0644]
basis/images/bitmap/bitmap-tests.factor
basis/images/bitmap/summary.txt [new file with mode: 0644]
basis/images/images.factor
basis/images/loader/summary.txt [new file with mode: 0644]
basis/images/summary.txt [new file with mode: 0644]
basis/images/tiff/summary.txt [new file with mode: 0644]
basis/images/tiff/tiff.factor
basis/interpolate/summary.txt [new file with mode: 0644]
basis/io/backend/unix/multiplexers/epoll/summary.txt [new file with mode: 0644]
basis/io/backend/unix/multiplexers/kqueue/summary.txt [new file with mode: 0644]
basis/io/backend/unix/multiplexers/run-loop/summary.txt [new file with mode: 0644]
basis/io/backend/unix/multiplexers/select/summary.txt [new file with mode: 0644]
basis/io/backend/unix/multiplexers/summary.txt [new file with mode: 0644]
basis/io/backend/unix/unix.factor
basis/io/directories/search/search.factor
basis/io/directories/search/summary.txt [new file with mode: 0644]
basis/io/directories/unix/unix.factor
basis/io/encodings/8-bit/8-bit.factor
basis/io/encodings/8-bit/tags.txt [deleted file]
basis/io/encodings/ascii/tags.txt [deleted file]
basis/io/encodings/binary/tags.txt [deleted file]
basis/io/encodings/chinese/chinese.factor
basis/io/encodings/chinese/summary.txt [new file with mode: 0644]
basis/io/encodings/iana/iana.factor
basis/io/encodings/japanese/japanese.factor
basis/io/encodings/japanese/tags.txt [deleted file]
basis/io/encodings/korean/korean-docs.factor
basis/io/encodings/korean/korean.factor
basis/io/encodings/korean/tags.txt [deleted file]
basis/io/encodings/strict/tags.txt [deleted file]
basis/io/encodings/string/summary.txt
basis/io/encodings/string/tags.factor [deleted file]
basis/io/encodings/string/tags.txt [new file with mode: 0644]
basis/io/encodings/utf16/tags.txt [deleted file]
basis/io/encodings/utf16n/summary.txt [new file with mode: 0644]
basis/io/encodings/utf32/tags.txt [deleted file]
basis/io/files/info/unix/linux/linux.factor
basis/io/files/info/unix/unix.factor
basis/io/files/links/unix/unix.factor
basis/io/files/types/summary.txt [new file with mode: 0644]
basis/io/files/unique/summary.txt [new file with mode: 0644]
basis/io/pipes/summary.txt [new file with mode: 0644]
basis/io/servers/connection/connection.factor
basis/io/servers/packet/datagram.factor [deleted file]
basis/io/servers/packet/packet.factor [new file with mode: 0644]
basis/io/sockets/secure/secure-tests.factor
basis/io/sockets/secure/secure.factor
basis/io/sockets/secure/unix/debug/debug.factor
basis/io/sockets/unix/unix.factor
basis/io/streams/byte-array/summary.txt [new file with mode: 0644]
basis/io/streams/limited/summary.txt [new file with mode: 0644]
basis/io/streams/memory/summary.txt [new file with mode: 0644]
basis/lcs/diff2html/summary.txt [new file with mode: 0644]
basis/linked-assocs/linked-assocs-tests.factor
basis/lists/lazy/examples/summary.txt [new file with mode: 0644]
basis/locals/backend/summary.txt [new file with mode: 0644]
basis/locals/definitions/summary.txt [new file with mode: 0644]
basis/locals/errors/summary.txt [new file with mode: 0644]
basis/locals/fry/summary.txt [new file with mode: 0644]
basis/locals/macros/summary.txt [new file with mode: 0644]
basis/locals/parser/summary.txt [new file with mode: 0644]
basis/locals/prettyprint/summary.txt [new file with mode: 0644]
basis/locals/rewrite/closures/summary.txt [new file with mode: 0644]
basis/locals/rewrite/point-free/summary.txt [new file with mode: 0644]
basis/locals/rewrite/sugar/summary.txt [new file with mode: 0644]
basis/locals/types/summary.txt [new file with mode: 0644]
basis/logging/logging-docs.factor
basis/logging/logging.factor
basis/logging/parser/parser.factor
basis/logging/server/server.factor
basis/macros/expander/summary.txt [new file with mode: 0644]
basis/macros/macros.factor
basis/math/bits/authors.txt [new file with mode: 0644]
basis/math/bits/bits-docs.factor [new file with mode: 0644]
basis/math/bits/bits-tests.factor [new file with mode: 0644]
basis/math/bits/bits.factor [new file with mode: 0644]
basis/math/bits/summary.txt [new file with mode: 0644]
basis/math/bitwise/bitwise-tests.factor
basis/math/bitwise/bitwise.factor
basis/math/functions/functions-docs.factor
basis/math/functions/functions-tests.factor
basis/math/functions/functions.factor
basis/math/miller-rabin/miller-rabin-tests.factor
basis/math/partial-dispatch/summary.txt [new file with mode: 0644]
basis/math/quaternions/quaternions.factor
basis/memoize/memoize-tests.factor
basis/memoize/memoize.factor
basis/mime/multipart/multipart.factor
basis/mime/multipart/summary.txt [new file with mode: 0644]
basis/mime/types/summary.txt [new file with mode: 0644]
basis/mime/types/types.factor
basis/models/compose/summary.txt [new file with mode: 0644]
basis/models/delay/summary.txt [new file with mode: 0644]
basis/models/filter/summary.txt [new file with mode: 0644]
basis/models/history/summary.txt [new file with mode: 0644]
basis/models/mapping/summary.txt [new file with mode: 0644]
basis/models/range/summary.txt [new file with mode: 0644]
basis/nibble-arrays/nibble-arrays.factor
basis/nibble-arrays/summary.txt [new file with mode: 0644]
basis/none/none.factor
basis/opengl/glu/glu.factor
basis/openssl/libcrypto/libcrypto.factor
basis/openssl/libcrypto/summary.txt [new file with mode: 0644]
basis/openssl/libssl/summary.txt [new file with mode: 0644]
basis/openssl/openssl-tests.factor
basis/pack/summary.txt [new file with mode: 0644]
basis/peg/ebnf/summary.txt
basis/peg/ebnf/tags.txt
basis/peg/parsers/parsers.factor
basis/peg/parsers/summary.txt [new file with mode: 0644]
basis/peg/parsers/tags.txt [new file with mode: 0644]
basis/peg/summary.txt
basis/persistent/vectors/vectors.factor
basis/porter-stemmer/porter-stemmer-tests.factor
basis/prettyprint/custom/summary.txt [new file with mode: 0644]
basis/quoting/authors.txt [new file with mode: 0644]
basis/quoting/quoting-docs.factor [new file with mode: 0644]
basis/quoting/quoting-tests.factor [new file with mode: 0644]
basis/quoting/quoting.factor [new file with mode: 0644]
basis/random/dummy/summary.txt [new file with mode: 0644]
basis/random/mersenne-twister/mersenne-twister.factor
basis/random/unix/summary.txt [new file with mode: 0644]
basis/random/windows/summary.txt [new file with mode: 0644]
basis/smtp/server/summary.txt [new file with mode: 0644]
basis/sorting/slots/summary.txt [new file with mode: 0644]
basis/specialized-arrays/direct/functor/summary.txt [new file with mode: 0644]
basis/specialized-arrays/functor/summary.txt [new file with mode: 0644]
basis/specialized-vectors/functor/summary.txt [new file with mode: 0644]
basis/stack-checker/alien/summary.txt [new file with mode: 0644]
basis/stack-checker/backend/backend.factor
basis/stack-checker/branches/summary.txt [new file with mode: 0644]
basis/stack-checker/errors/errors-docs.factor
basis/stack-checker/inlining/summary.txt [new file with mode: 0644]
basis/stack-checker/known-words/known-words.factor
basis/stack-checker/recursive-state/summary.txt [new file with mode: 0644]
basis/stack-checker/recursive-state/tree/summary.txt [new file with mode: 0644]
basis/stack-checker/stack-checker-docs.factor
basis/stack-checker/transforms/transforms.factor
basis/stack-checker/values/summary.txt [new file with mode: 0644]
basis/stack-checker/visitor/dummy/summary.txt [new file with mode: 0644]
basis/stack-checker/visitor/summary.txt [new file with mode: 0644]
basis/syndication/syndication-tests.factor
basis/threads/threads.factor
basis/tools/crossref/crossref-tests.factor
basis/tools/deploy/backend/backend.factor
basis/tools/deploy/config/config.factor
basis/tools/deploy/deploy-tests.factor
basis/tools/deploy/shaker/shaker.factor
basis/tools/deploy/test/11/11-tests.factor [new file with mode: 0644]
basis/tools/deploy/test/11/11.factor [new file with mode: 0644]
basis/tools/deploy/test/11/authors.txt [new file with mode: 0644]
basis/tools/deploy/test/11/deploy.factor [new file with mode: 0644]
basis/tools/disassembler/udis/udis.factor
basis/tools/files/files.factor
basis/tools/files/summary.txt [new file with mode: 0644]
basis/tools/files/unix/unix.factor
basis/tools/files/windows/windows.factor
basis/tools/profiler/profiler-tests.factor
basis/tools/scaffold/scaffold-docs.factor
basis/tools/scaffold/scaffold.factor
basis/tools/scaffold/summary.txt [new file with mode: 0644]
basis/tools/threads/summary.txt [new file with mode: 0644]
basis/tools/vocabs/browser/summary.txt [new file with mode: 0644]
basis/tools/vocabs/summary.txt [new file with mode: 0644]
basis/tools/vocabs/vocabs.factor
basis/ui/cocoa/views/views.factor
basis/ui/gadgets/buttons/buttons.factor
basis/ui/gadgets/canvas/summary.txt [new file with mode: 0644]
basis/ui/gadgets/frames/frames.factor
basis/ui/gadgets/sliders/sliders.factor
basis/ui/gadgets/theme/theme.factor
basis/ui/operations/operations.factor
basis/ui/render/render.factor
basis/ui/tools/deploy/summary.txt [new file with mode: 0644]
basis/ui/tools/operations/operations.factor
basis/ui/windows/summary.txt [new file with mode: 0644]
basis/ui/windows/windows.factor
basis/ui/x11/summary.txt [new file with mode: 0644]
basis/ui/x11/x11.factor
basis/unicode/breaks/breaks-tests.factor
basis/unicode/breaks/breaks.factor
basis/unicode/breaks/summary.txt [new file with mode: 0644]
basis/unicode/case/summary.txt [new file with mode: 0644]
basis/unicode/categories/summary.txt [new file with mode: 0644]
basis/unicode/collation/collation-tests.factor
basis/unicode/collation/collation.factor
basis/unicode/collation/summary.txt [new file with mode: 0644]
basis/unicode/collation/tags.txt [new file with mode: 0644]
basis/unicode/data/data.factor
basis/unicode/data/summary.txt [new file with mode: 0644]
basis/unicode/normalize/normalize-tests.factor
basis/unicode/normalize/summary.txt [new file with mode: 0644]
basis/unicode/script/script.factor
basis/unicode/script/tags.txt [new file with mode: 0644]
basis/unicode/summary.txt
basis/unicode/syntax/summary.txt [new file with mode: 0644]
basis/unix/groups/groups.factor
basis/unix/groups/summary.txt [new file with mode: 0644]
basis/unix/stat/netbsd/netbsd.factor
basis/unix/users/summary.txt [new file with mode: 0644]
basis/unrolled-lists/summary.txt [new file with mode: 0644]
basis/unrolled-lists/unrolled-lists.factor
basis/urls/secure/summary.txt [new file with mode: 0644]
basis/vlists/summary.txt [new file with mode: 0644]
basis/windows/kernel32/kernel32.factor
basis/windows/ole32/ole32.factor
basis/windows/opengl32/opengl32.factor
basis/windows/shell32/shell32.factor
basis/windows/types/types.factor
basis/windows/user32/user32.factor
basis/windows/windows.factor
basis/windows/winsock/winsock.factor [changed mode: 0644->0755]
basis/wrap/strings/summary.txt [new file with mode: 0644]
basis/wrap/words/summary.txt [new file with mode: 0644]
basis/x11/constants/constants.factor
basis/x11/glx/glx.factor
basis/x11/xim/xim.factor
basis/x11/xlib/xlib.factor
basis/xml/entities/entities.factor
basis/xml/entities/html/html.factor
basis/xml/entities/html/summary.txt [new file with mode: 0644]
basis/xml/errors/errors.factor
basis/xml/tests/encodings.factor
basis/xml/tests/funny-dtd.factor
basis/xml/tests/soap.factor
basis/xml/tests/test.factor
basis/xml/tests/xmltest.factor
basis/xml/tests/xmode-dtd.factor
basis/xmode/catalog/catalog.factor
basis/xmode/code2html/summary.txt [new file with mode: 0644]
basis/xmode/loader/loader.factor
basis/xmode/marker/summary.txt [new file with mode: 0644]
basis/xmode/utilities/utilities-tests.factor
core/arrays/arrays-docs.factor
core/assocs/assocs-docs.factor
core/assocs/assocs-tests.factor
core/assocs/assocs.factor
core/bootstrap/primitives.factor
core/bootstrap/stage1.factor
core/checksums/crc32/crc32.factor
core/classes/algebra/summary.txt [new file with mode: 0644]
core/classes/builtin/summary.txt [new file with mode: 0644]
core/classes/intersection/summary.txt [new file with mode: 0644]
core/classes/parser/summary.txt [new file with mode: 0644]
core/classes/singleton/summary.txt [new file with mode: 0644]
core/classes/tuple/parser/summary.txt [new file with mode: 0644]
core/classes/tuple/summary.txt
core/classes/tuple/tuple-docs.factor
core/combinators/combinators-tests.factor
core/combinators/summary.txt
core/compiler/errors/errors-docs.factor
core/compiler/units/units-docs.factor
core/compiler/units/units.factor
core/continuations/continuations.factor
core/effects/effects.factor
core/effects/parser/summary.txt [new file with mode: 0644]
core/generic/parser/summary.txt [new file with mode: 0644]
core/generic/standard/engines/predicate/summary.txt [new file with mode: 0644]
core/generic/standard/engines/summary.txt [new file with mode: 0644]
core/generic/standard/engines/tag/summary.txt [new file with mode: 0644]
core/generic/standard/engines/tuple/summary.txt [new file with mode: 0644]
core/generic/standard/standard.factor
core/hashtables/hashtables-docs.factor
core/io/encodings/encodings-docs.factor
core/io/encodings/encodings-tests.factor
core/io/encodings/encodings.factor
core/io/encodings/utf8/tags.txt [deleted file]
core/io/files/files-tests.factor
core/io/io-tests.factor
core/io/pathnames/pathnames-docs.factor
core/io/pathnames/pathnames-tests.factor
core/io/pathnames/pathnames.factor
core/io/streams/null/null-tests.factor [deleted file]
core/io/streams/null/summary.txt [new file with mode: 0644]
core/math/integers/integers-tests.factor
core/math/order/summary.txt [new file with mode: 0644]
core/parser/parser-tests.factor
core/sbufs/sbufs-docs.factor
core/sequences/sequences-docs.factor
core/splitting/tags.txt
core/strings/parser/summary.txt [new file with mode: 0644]
core/strings/strings-docs.factor
core/system/summary.txt
core/vectors/vectors-docs.factor
core/vocabs/loader/loader-docs.factor
core/vocabs/loader/loader.factor
core/vocabs/parser/summary.txt [new file with mode: 0644]
core/vocabs/vocabs.factor
core/words/constant/summary.txt [new file with mode: 0644]
core/words/symbol/summary.txt [new file with mode: 0644]
core/words/words-docs.factor
core/words/words.factor
extra/24-game/24-game.factor
extra/adsoda/combinators/combinators-docs.factor
extra/annotations/annotations-docs.factor
extra/asn1/ldap/ldap.factor
extra/benchmark/backtrack/backtrack.factor
extra/benchmark/binary-trees/binary-trees.factor
extra/benchmark/crc32/crc32.factor
extra/benchmark/fasta/fasta.factor
extra/benchmark/mandel/colors/colors.factor
extra/benchmark/mandel/params/params.factor
extra/benchmark/md5/md5.factor
extra/benchmark/nbody/nbody.factor
extra/benchmark/raytracer/raytracer.factor
extra/benchmark/sha1/sha1.factor
extra/benchmark/sockets/sockets.factor
extra/benchmark/xml/xml.factor
extra/cairo-demo/cairo-demo.factor
extra/crypto/aes/aes.factor
extra/crypto/passwd-md5/passwd-md5.factor
extra/crypto/rsa/rsa.factor
extra/curses/curses.factor
extra/curses/ffi/ffi.factor
extra/fuel/fuel-tests.factor [deleted file]
extra/fuel/fuel.factor
extra/fuel/help/help.factor
extra/galois-talk/galois-talk.factor
extra/game-input/iokit/iokit.factor
extra/game-input/scancodes/scancodes.factor
extra/google-tech-talk/google-tech-talk.factor
extra/id3/id3-docs.factor
extra/id3/id3-tests.factor
extra/id3/id3.factor
extra/infix/infix.factor
extra/io/serial/serial.factor
extra/io/serial/unix/bsd/bsd.factor
extra/io/serial/unix/linux/linux.factor
extra/io/serial/unix/termios/bsd/bsd.factor
extra/io/serial/unix/termios/linux/linux.factor
extra/io/serial/unix/unix-tests.factor
extra/io/serial/unix/unix.factor
extra/io/serial/windows/authors.txt [new file with mode: 0755]
extra/io/serial/windows/tags.txt [new file with mode: 0644]
extra/io/serial/windows/windows.factor [new file with mode: 0755]
extra/iokit/hid/hid.factor
extra/iokit/iokit.factor
extra/irc/client/client.factor
extra/irc/ui/ui.factor
extra/joystick-demo/joystick-demo.factor
extra/key-caps/key-caps.factor
extra/lint/lint.factor
extra/lisppaste/lisppaste.factor
extra/literals/literals-docs.factor
extra/literals/literals-tests.factor
extra/literals/literals.factor
extra/mason/common/common.factor
extra/math/analysis/analysis.factor
extra/math/derivatives/authors.txt [new file with mode: 0644]
extra/math/derivatives/derivatives-docs.factor [new file with mode: 0644]
extra/math/derivatives/derivatives.factor [new file with mode: 0644]
extra/math/derivatives/syntax/authors.txt [new file with mode: 0644]
extra/math/derivatives/syntax/syntax-docs.factor [new file with mode: 0644]
extra/math/derivatives/syntax/syntax.factor [new file with mode: 0644]
extra/math/dual/authors.txt [new file with mode: 0644]
extra/math/dual/dual-docs.factor [new file with mode: 0644]
extra/math/dual/dual-tests.factor [new file with mode: 0644]
extra/math/dual/dual.factor [new file with mode: 0644]
extra/maze/maze.factor
extra/minneapolis-talk/minneapolis-talk.factor
extra/minneapolis-talk/minneapolis-talk.txt [deleted file]
extra/nehe/2/2.factor
extra/nehe/3/3.factor
extra/nehe/4/4.factor
extra/nehe/5/5.factor
extra/opengl/demo-support/demo-support.factor
extra/otug-talk/otug-talk.factor
extra/peg/javascript/ast/tags.txt
extra/peg/javascript/parser/tags.txt
extra/peg/javascript/tags.txt
extra/peg/javascript/tokenizer/tags.txt
extra/serial/authors.txt [deleted file]
extra/serial/serial.factor [deleted file]
extra/serial/summary.txt [deleted file]
extra/serial/tags.txt [deleted file]
extra/serial/unix/bsd/bsd.factor [deleted file]
extra/serial/unix/bsd/tags.txt [deleted file]
extra/serial/unix/linux/linux.factor [deleted file]
extra/serial/unix/linux/tags.txt [deleted file]
extra/serial/unix/tags.txt [deleted file]
extra/serial/unix/termios/bsd/bsd.factor [deleted file]
extra/serial/unix/termios/bsd/tags.txt [deleted file]
extra/serial/unix/termios/linux/linux.factor [deleted file]
extra/serial/unix/termios/linux/tags.txt [deleted file]
extra/serial/unix/termios/tags.txt [deleted file]
extra/serial/unix/termios/termios.factor [deleted file]
extra/serial/unix/unix-tests.factor [deleted file]
extra/serial/unix/unix.factor [deleted file]
extra/serial/windows/authors.txt [deleted file]
extra/serial/windows/tags.txt [deleted file]
extra/serial/windows/windows-tests.factor [deleted file]
extra/serial/windows/windows.factor [deleted file]
extra/slides/slides.factor
extra/tetris/game/game.factor
extra/usa-cities/usa-cities.factor
extra/vpri-talk/vpri-talk.factor
extra/webapps/todo/todo.factor
extra/websites/concatenative/concatenative.factor
extra/yahoo/yahoo.factor
misc/fuel/README
misc/fuel/factor-mode.el
misc/fuel/fuel-autodoc.el
misc/fuel/fuel-edit.el
misc/fuel/fuel-eval.el
misc/fuel/fuel-font-lock.el
misc/fuel/fuel-markup.el
misc/fuel/fuel-mode.el
misc/fuel/fuel-refactor.el
misc/fuel/fuel-syntax.el
unfinished/benchmark/richards/richards.factor [deleted file]
unfinished/sql/sql-tests.factor [deleted file]
unfinished/sql/sql.factor [deleted file]
vm/bignum.c

index a44b5cf2b6e5a93fbe59e3f0ff3fac1ca7b4897a..c3fd41e68973ee64545218b49d216003782c5dba 100755 (executable)
@@ -1,4 +1,4 @@
-! Copyright (C) 2004, 2008 Slava Pestov.
+! Copyright (C) 2004, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: byte-arrays arrays assocs kernel kernel.private libc math
 namespaces make parser sequences strings words assocs splitting
@@ -275,7 +275,7 @@ M: long-long-type box-return ( type -- )
 : if-void ( type true false -- )
     pick "void" = [ drop nip call ] [ nip call ] if ; inline
 
-: primitive-types
+CONSTANT: primitive-types
     {
         "char" "uchar"
         "short" "ushort"
@@ -284,7 +284,7 @@ M: long-long-type box-return ( type -- )
         "longlong" "ulonglong"
         "float" "double"
         "void*" "bool"
-    } ;
+    }
 
 [
     <c-type>
diff --git a/basis/alien/complex/functor/summary.txt b/basis/alien/complex/functor/summary.txt
new file mode 100644 (file)
index 0000000..1745403
--- /dev/null
@@ -0,0 +1 @@
+Code generation for C99 complex number support
index 915b7d3d4f784ed8989cb8ba845076e294f67b62..5e3dc24476520496b59b36c59987d9ccfda93562 100644 (file)
@@ -170,8 +170,8 @@ M: character-type (fortran-type>c-type)
 
 : (parse-fortran-type) ( fortran-type-string -- type )
     parse-out swap parse-dims swap parse-size swap
-    dup >lower fortran>c-types at*
-    [ nip new-fortran-type ] [ drop misc-type boa ] if ;
+    >lower fortran>c-types ?at
+    [ new-fortran-type ] [ misc-type boa ] if ;
 
 : parse-fortran-type ( fortran-type-string/f -- type/f )
     dup [ (parse-fortran-type) ] when ;
diff --git a/basis/alien/parser/summary.txt b/basis/alien/parser/summary.txt
new file mode 100644 (file)
index 0000000..4290040
--- /dev/null
@@ -0,0 +1 @@
+Utilities used in implementation of alien parsing words
diff --git a/basis/alien/prettyprint/summary.txt b/basis/alien/prettyprint/summary.txt
new file mode 100644 (file)
index 0000000..06fcfd0
--- /dev/null
@@ -0,0 +1 @@
+Prettyprinting aliens and DLLs
diff --git a/basis/alien/strings/summary.txt b/basis/alien/strings/summary.txt
new file mode 100644 (file)
index 0000000..8ea3806
--- /dev/null
@@ -0,0 +1 @@
+Passing Factor strings as C strings and vice versa
diff --git a/basis/alien/strings/unix/summary.txt b/basis/alien/strings/unix/summary.txt
new file mode 100644 (file)
index 0000000..27e7f4c
--- /dev/null
@@ -0,0 +1 @@
+Default string encoding on Unix
diff --git a/basis/alien/strings/windows/summary.txt b/basis/alien/strings/windows/summary.txt
new file mode 100644 (file)
index 0000000..42bffbb
--- /dev/null
@@ -0,0 +1 @@
+Default string encoding on Windows
diff --git a/basis/alien/structs/fields/summary.txt b/basis/alien/structs/fields/summary.txt
new file mode 100644 (file)
index 0000000..d9370ca
--- /dev/null
@@ -0,0 +1 @@
+Struct field implementation and reflection support
diff --git a/basis/assoc-heaps/summary.txt b/basis/assoc-heaps/summary.txt
new file mode 100644 (file)
index 0000000..792be0a
--- /dev/null
@@ -0,0 +1 @@
+Priority queue with fast insertion, removal of first element, and lookup of arbitrary elements by key
diff --git a/basis/bitstreams/summary.txt b/basis/bitstreams/summary.txt
new file mode 100644 (file)
index 0000000..32b21d6
--- /dev/null
@@ -0,0 +1 @@
+Reading sequences of bits from a byte stream
index 145738ff4507792f5ce7bebbf0effbfd95409e04..c3e74f7863eca9b029f8dc078d0d9856193acae5 100644 (file)
@@ -5,12 +5,13 @@ IN: bootstrap.help
 
 : load-help ( -- )
     "help.lint" require
+    "tools.vocabs.browser" require
     "alien.syntax" require
     "compiler" require
 
     t load-help? set-global
 
-    [ drop ] load-vocab-hook [
+    [ vocab ] load-vocab-hook [
         dictionary get values
         [ docs-loaded?>> not ] filter
         [ load-docs ] each
index f9b7b56779a0d2243c7feae0abd0fd496ae5976c..5bfc5f7cccbbb1544069e35828defeb5f54b0a1a 100644 (file)
@@ -4,7 +4,7 @@ USING: http.client checksums checksums.md5 splitting assocs
 kernel io.files bootstrap.image sequences io urls ;
 IN: bootstrap.image.download
 
-: url URL" http://factorcode.org/images/latest/" ;
+CONSTANT: url URL" http://factorcode.org/images/latest/"
 
 : download-checksums ( -- alist )
     url "checksums.txt" >url derive-url http-get nip
index 221ffffb91a422ebc608310bc6b6a2591a7e13e7..10cde266ccfd755b5979ded15e65f24af943be6e 100644 (file)
@@ -77,20 +77,20 @@ SYMBOL: objects
 
 ! Constants
 
-: image-magic HEX: 0f0e0d0c ; inline
-: image-version 4 ; inline
+CONSTANT: image-magic HEX: 0f0e0d0c
+CONSTANT: image-version 4
 
-: data-base 1024 ; inline
+CONSTANT: data-base 1024
 
-: userenv-size 70 ; inline
+CONSTANT: userenv-size 70
 
-: header-size 10 ; inline
+CONSTANT: header-size 10
 
-: data-heap-size-offset 3 ; inline
-: t-offset              6 ; inline
-: 0-offset              7 ; inline
-: 1-offset              8 ; inline
-: -1-offset             9 ; inline
+CONSTANT: data-heap-size-offset 3
+CONSTANT: t-offset              6
+CONSTANT: 0-offset              7
+CONSTANT: 1-offset              8
+CONSTANT: -1-offset             9
 
 SYMBOL: sub-primitives
 
index b521244fe0ae73abf32b170eaff1713b1cff0a89..070618ebb487eaa39c9266aaa71d21d19b393af6 100644 (file)
@@ -93,9 +93,9 @@ SYMBOL: bootstrap-time
         "tools.deploy.shaker" run
     ] [
         "staging" get [
-            "resource:basis/bootstrap/finish-staging.factor" run-file
+            "vocab:bootstrap/finish-staging.factor" run-file
         ] [
-            "resource:basis/bootstrap/finish-bootstrap.factor" run-file
+            "vocab:bootstrap/finish-bootstrap.factor" run-file
         ] if
 
         "output-image" get save-image-and-exit
@@ -104,6 +104,6 @@ SYMBOL: bootstrap-time
     drop
     [
         load-help? off
-        "resource:basis/bootstrap/bootstrap-error.factor" run-file
+        "vocab:bootstrap/bootstrap-error.factor" run-file
     ] with-scope
 ] recover
index 3873f73bfe9ecc31195a61f1e9171f4f4d122f9d..f304dca488dd8af6367e768d32b975c768080ba0 100644 (file)
@@ -1,9 +1,8 @@
-USING: arrays byte-arrays help.markup help.syntax kernel\r
-byte-vectors.private combinators ;\r
+USING: arrays byte-arrays help.markup help.syntax kernel combinators ;\r
 IN: byte-vectors\r
 \r
 ARTICLE: "byte-vectors" "Byte vectors"\r
-"A byte vector is a resizable mutable sequence of unsigned bytes. Byte vector words are found in the " { $vocab-link "byte-vectors" } " vocabulary."\r
+"The " { $vocab-link "byte-vectors" } " vocabulary implements resizable mutable sequence of unsigned bytes. Byte vectors implement the " { $link "sequence-protocol" } " and thus all " { $link "sequences" } " can be used with them."\r
 $nl\r
 "Byte vectors form a class:"\r
 { $subsection byte-vector }\r
index d29a3fb0979c89970c063772e1b6bf6226e6b4ed..c2daa053741b0b6fe86026200ecd4efb7a8e79d9 100644 (file)
@@ -72,9 +72,9 @@ C-ENUM:
     CAIRO_STATUS_INVALID_STRIDE ;
 
 TYPEDEF: int cairo_content_t
-: CAIRO_CONTENT_COLOR          HEX: 1000 ;
-: CAIRO_CONTENT_ALPHA          HEX: 2000 ;
-: CAIRO_CONTENT_COLOR_ALPHA    HEX: 3000 ;
+CONSTANT: CAIRO_CONTENT_COLOR HEX: 1000
+CONSTANT: CAIRO_CONTENT_ALPHA HEX: 2000
+CONSTANT: CAIRO_CONTENT_COLOR_ALPHA HEX: 3000
 
 TYPEDEF: void* cairo_write_func_t
 : cairo-write-func ( quot -- callback )
diff --git a/basis/cairo/ffi/summary.txt b/basis/cairo/ffi/summary.txt
new file mode 100644 (file)
index 0000000..7fe88a8
--- /dev/null
@@ -0,0 +1 @@
+Low-level alien interface to Cairo library
diff --git a/basis/cairo/gadgets/summary.txt b/basis/cairo/gadgets/summary.txt
new file mode 100644 (file)
index 0000000..18dc464
--- /dev/null
@@ -0,0 +1 @@
+UI gadget for rendering graphics with Cairo
index 522e0c52f34e11b3dd0574aa0fb7b55569f7b23d..dc9442259b53c20b1d1cf5c0bed082f3f9b3a0d6 100644 (file)
@@ -61,7 +61,7 @@ PRIVATE>
 : month-abbreviation ( n -- string )
     check-month 1- month-abbreviations nth ;
 
-: day-counts { 0 31 28 31 30 31 30 31 31 30 31 30 31 } ; inline
+CONSTANT: day-counts { 0 31 28 31 30 31 30 31 31 30 31 30 31 }
 
 : day-names ( -- array )
     {
index 81930cdf49fa1963a702d74abe5d531b68316ba4..f8864351a44dfe54c951dcb87ceda875192201ac 100644 (file)
@@ -51,6 +51,11 @@ IN: calendar.format.tests
     timestamp>string\r
 ] unit-test\r
 \r
+[ "20080504070000" ] [\r
+    "Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp\r
+    timestamp>mdtm\r
+] unit-test\r
+\r
 [\r
     T{ timestamp f\r
         2008\r
@@ -74,3 +79,5 @@ IN: calendar.format.tests
         { gmt-offset T{ duration f 0 0 0 0 0 0 } }\r
     }\r
 ] [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test\r
+\r
+\r
index 15a4cb826646a6eb9b720349cce1593e23fe68cd..916d3499fe61286a7e0055003c0d11574194d87b 100644 (file)
@@ -78,6 +78,9 @@ M: integer year. ( n -- )
 M: timestamp year. ( timestamp -- )\r
     year>> year. ;\r
 \r
+: timestamp>mdtm ( timestamp -- str )\r
+    [ { YYYY MM DD hh mm ss } formatted ] with-string-writer ;\r
+\r
 : (timestamp>string) ( timestamp -- )\r
     { DAY ", " D " " MONTH " " YYYY " " hh ":" mm ":" ss } formatted ;\r
 \r
diff --git a/basis/calendar/format/macros/summary.txt b/basis/calendar/format/macros/summary.txt
new file mode 100644 (file)
index 0000000..92c347a
--- /dev/null
@@ -0,0 +1 @@
+Implementation details for calendar.format
diff --git a/basis/calendar/unix/summary.txt b/basis/calendar/unix/summary.txt
new file mode 100644 (file)
index 0000000..b57628b
--- /dev/null
@@ -0,0 +1 @@
+Unix-specific timezone support and C library time data types
diff --git a/basis/calendar/windows/summary.txt b/basis/calendar/windows/summary.txt
new file mode 100644 (file)
index 0000000..1fdbc43
--- /dev/null
@@ -0,0 +1 @@
+Windows-specific timezone support
diff --git a/basis/call/summary.txt b/basis/call/summary.txt
new file mode 100644 (file)
index 0000000..d449497
--- /dev/null
@@ -0,0 +1 @@
+Calling arbitrary quotations and executing arbitrary words with a static stack effect
index 1be4bfb58421efbe5a7ca48185bb871490e9bc26..d5e153ba99954275c9479afadbf7cd2db92be930 100644 (file)
@@ -6,7 +6,7 @@ IN: checksums.adler-32
 
 SINGLETON: adler-32
 
-: adler-32-modulus 65521 ; inline
+CONSTANT: adler-32-modulus 65521
 
 M: adler-32 checksum-bytes ( bytes checksum -- value )
     drop
diff --git a/basis/checksums/adler-32/summary.txt b/basis/checksums/adler-32/summary.txt
new file mode 100644 (file)
index 0000000..86ce15b
--- /dev/null
@@ -0,0 +1 @@
+Adler-32 checksum algorithm
diff --git a/basis/checksums/md5/summary.txt b/basis/checksums/md5/summary.txt
new file mode 100644 (file)
index 0000000..fae2ff8
--- /dev/null
@@ -0,0 +1 @@
+MD5 checksum algorithm
diff --git a/basis/checksums/null/summary.txt b/basis/checksums/null/summary.txt
new file mode 100644 (file)
index 0000000..2d4eedd
--- /dev/null
@@ -0,0 +1 @@
+Dummy checksum algorithm
index 4bc7a7964a11c6e0d46f7ad8f29701fe45e1945f..58748b7c297b6f5bc1ee9d28ee784b45b9a7d7c1 100644 (file)
@@ -9,9 +9,9 @@ ERROR: unknown-digest name ;
 
 TUPLE: openssl-checksum name ;
 
-: openssl-md5 T{ openssl-checksum f "md5" } ;
+CONSTANT: openssl-md5 T{ openssl-checksum f "md5" }
 
-: openssl-sha1 T{ openssl-checksum f "sha1" } ;
+CONSTANT: openssl-sha1 T{ openssl-checksum f "sha1" }
 
 INSTANCE: openssl-checksum stream-checksum
 
diff --git a/basis/checksums/openssl/summary.txt b/basis/checksums/openssl/summary.txt
new file mode 100644 (file)
index 0000000..e13a387
--- /dev/null
@@ -0,0 +1 @@
+OpenSSL's MD5 and SHA1 checksums
diff --git a/basis/checksums/sha1/summary.txt b/basis/checksums/sha1/summary.txt
new file mode 100644 (file)
index 0000000..d8da1df
--- /dev/null
@@ -0,0 +1 @@
+SHA1 checksum algorithm
index 026c4d6f2725cc3006fed37b2192bcc11c84d72b..3b092a78dea62f9e8d5c595b2758c9f49daa16d0 100644 (file)
@@ -9,14 +9,14 @@ IN: checksums.sha2
 
 SYMBOLS: vars M K H S0 S1 process-M word-size block-size ;
 
-: a 0 ; inline
-: b 1 ; inline
-: c 2 ; inline
-: d 3 ; inline
-: e 4 ; inline
-: f 5 ; inline
-: g 6 ; inline
-: h 7 ; inline
+CONSTANT: a 0
+CONSTANT: b 1
+CONSTANT: c 2
+CONSTANT: d 3
+CONSTANT: e 4
+CONSTANT: f 5
+CONSTANT: g 6
+CONSTANT: h 7
 
 : initial-H-256 ( -- seq )
     {
diff --git a/basis/checksums/sha2/summary.txt b/basis/checksums/sha2/summary.txt
new file mode 100644 (file)
index 0000000..04365d4
--- /dev/null
@@ -0,0 +1 @@
+SHA2 checksum algorithm
diff --git a/basis/checksums/stream/summary.txt b/basis/checksums/stream/summary.txt
new file mode 100644 (file)
index 0000000..12fcb8c
--- /dev/null
@@ -0,0 +1 @@
+Computing checksums of streaming data
index ab2b6375a90b04fd4da7c1131fbef0f646939e4c..19d83b86d7d5640288d8fa7df9af10c4636bfd21 100644 (file)
@@ -19,9 +19,9 @@ IN: cocoa.application
         ] curry assoc-each
     ] keep ;
 
-: NSApplicationDelegateReplySuccess 0 ;
-: NSApplicationDelegateReplyCancel  1 ;
-: NSApplicationDelegateReplyFailure 2 ;
+CONSTANT: NSApplicationDelegateReplySuccess 0
+CONSTANT: NSApplicationDelegateReplyCancel  1
+CONSTANT: NSApplicationDelegateReplyFailure 2
 
 : with-autorelease-pool ( quot -- )
     NSAutoreleasePool -> new slip -> release ; inline
index 13f6f0b7d61f2f2ad24948f7e0ad4b98957456cc..84a1ad46a3a0c1c64689b041978dfbdbfe59e03a 100644 (file)
@@ -18,8 +18,8 @@ IN: cocoa.dialogs
     dup 0 -> setCanChooseDirectories:
     dup 0 -> setAllowsMultipleSelection: ;
 
-: NSOKButton 1 ;
-: NSCancelButton 0 ;
+CONSTANT: NSOKButton 1
+CONSTANT: NSCancelButton 0
 
 : open-panel ( -- paths )
     <NSOpenPanel>
index 7f5b77728332eda4941093f4db1308abdd5d8f0c..919e8f86c5ff097b23faaecfad22abfc8daade58 100644 (file)
@@ -5,7 +5,7 @@ sequences vectors fry libc destructors
 specialized-arrays.direct.alien ;
 IN: cocoa.enumeration
 
-: NS-EACH-BUFFER-SIZE 16 ; inline
+CONSTANT: NS-EACH-BUFFER-SIZE 16
 
 : with-enumeration-buffers ( quot -- )
     [
diff --git a/basis/cocoa/enumeration/summary.txt b/basis/cocoa/enumeration/summary.txt
new file mode 100644 (file)
index 0000000..ce593b7
--- /dev/null
@@ -0,0 +1 @@
+Support for iterating over NSFastEnumerations
index ce66467203ffc52dc76dd44096ac5866d63dce91..9a1bebd38f326e16b29a06bdbc7852129dcf8d19 100644 (file)
@@ -1,11 +1,11 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.strings arrays assocs
-continuations combinators compiler compiler.alien kernel math
-namespaces make parser quotations sequences strings words
-cocoa.runtime io macros memoize io.encodings.utf8
-effects libc libc.private parser lexer init core-foundation fry
-generalizations specialized-arrays.direct.alien call ;
+continuations combinators compiler compiler.alien stack-checker kernel
+math namespaces make parser quotations sequences strings words
+cocoa.runtime io macros memoize io.encodings.utf8 effects libc
+libc.private parser lexer init core-foundation fry generalizations
+specialized-arrays.direct.alien call ;
 IN: cocoa.messages
 
 : make-sender ( method function -- quot )
@@ -14,7 +14,7 @@ IN: cocoa.messages
 : sender-stub ( method function -- word )
     [ "( sender-stub )" f <word> dup ] 2dip
     over first large-struct? [ "_stret" append ] when
-    make-sender define ;
+    make-sender dup infer define-declared ;
 
 SYMBOL: message-senders
 SYMBOL: super-message-senders
index 888f5452e2d619c5e9097a7b37243a48159cf11e..1a21b338be4fa2ce3ec3f0e60bb12b20470b3a3f 100644 (file)
@@ -5,7 +5,7 @@ cocoa.classes cocoa.application sequences cocoa core-foundation
 core-foundation.strings core-foundation.arrays ;
 IN: cocoa.pasteboard
 
-: NSStringPboardType "NSStringPboardType" ;
+CONSTANT: NSStringPboardType "NSStringPboardType"
 
 : pasteboard-string? ( pasteboard -- ? )
     NSStringPboardType swap -> types CF>string-array member? ;
diff --git a/basis/cocoa/plists/summary.txt b/basis/cocoa/plists/summary.txt
new file mode 100644 (file)
index 0000000..155307f
--- /dev/null
@@ -0,0 +1 @@
+Reading and writing Cocoa property lists
index 1a741b789ff6c187bf039604226f5994c3e05cfa..7817d0006cf7aeb2ddc1e87084b372469be7b6be 100644 (file)
@@ -21,15 +21,15 @@ C-STRUCT: objc-super
     { "id" "receiver" }
     { "Class" "class" } ;
 
-: CLS_CLASS        HEX: 1   ;
-: CLS_META         HEX: 2   ;
-: CLS_INITIALIZED  HEX: 4   ;
-: CLS_POSING       HEX: 8   ;
-: CLS_MAPPED       HEX: 10  ;
-: CLS_FLUSH_CACHE  HEX: 20  ;
-: CLS_GROW_CACHE   HEX: 40  ;
-: CLS_NEED_BIND    HEX: 80  ;
-: CLS_METHOD_ARRAY HEX: 100 ;
+CONSTANT: CLS_CLASS        HEX: 1
+CONSTANT: CLS_META         HEX: 2
+CONSTANT: CLS_INITIALIZED  HEX: 4
+CONSTANT: CLS_POSING       HEX: 8
+CONSTANT: CLS_MAPPED       HEX: 10
+CONSTANT: CLS_FLUSH_CACHE  HEX: 20
+CONSTANT: CLS_GROW_CACHE   HEX: 40
+CONSTANT: CLS_NEED_BIND    HEX: 80
+CONSTANT: CLS_METHOD_ARRAY HEX: 100
 
 FUNCTION: int objc_getClassList ( void* buffer, int bufferLen ) ;
 
index be533641854870558189b44da174219ebd5b8b77..08963126702a657407d3a7efe83ee91341bf3bcc 100644 (file)
@@ -38,9 +38,9 @@ IN: cocoa.subclassing
     ] map concat ;
 
 : prepare-method ( ret types quot -- type imp )
-    [ [ encode-types ] 2keep ] dip [
-        "cdecl" swap 4array % \ alien-callback ,
-    ] [ ] make define-temp ;
+    [ [ encode-types ] 2keep ] dip
+    '[ _ _ "cdecl" _ alien-callback ]
+    (( -- callback )) define-temp ;
 
 : prepare-methods ( methods -- methods )
     [
index e74e9122023123691cfdaea4c42ba3ef2d04eb87..4bb6468fa6c6cfcb963ece05f6722c8078c23238 100644 (file)
@@ -5,43 +5,43 @@ cocoa cocoa.messages cocoa.classes cocoa.types sequences
 continuations accessors ;
 IN: cocoa.views
 
-: NSOpenGLPFAAllRenderers 1 ;
-: NSOpenGLPFADoubleBuffer 5 ;
-: NSOpenGLPFAStereo 6 ;
-: NSOpenGLPFAAuxBuffers 7 ;
-: NSOpenGLPFAColorSize 8 ;
-: NSOpenGLPFAAlphaSize 11 ;
-: NSOpenGLPFADepthSize 12 ;
-: NSOpenGLPFAStencilSize 13 ;
-: NSOpenGLPFAAccumSize 14 ;
-: NSOpenGLPFAMinimumPolicy 51 ;
-: NSOpenGLPFAMaximumPolicy 52 ;
-: NSOpenGLPFAOffScreen 53 ;
-: NSOpenGLPFAFullScreen 54 ;
-: NSOpenGLPFASampleBuffers 55 ;
-: NSOpenGLPFASamples 56 ;
-: NSOpenGLPFAAuxDepthStencil 57 ;
-: NSOpenGLPFAColorFloat  58 ;
-: NSOpenGLPFAMultisample 59 ;
-: NSOpenGLPFASupersample 60 ;
-: NSOpenGLPFASampleAlpha 61 ;
-: NSOpenGLPFARendererID 70 ;
-: NSOpenGLPFASingleRenderer 71 ;
-: NSOpenGLPFANoRecovery 72 ;
-: NSOpenGLPFAAccelerated 73 ;
-: NSOpenGLPFAClosestPolicy 74 ;
-: NSOpenGLPFARobust 75 ;
-: NSOpenGLPFABackingStore 76 ;
-: NSOpenGLPFAMPSafe 78 ;
-: NSOpenGLPFAWindow 80 ;
-: NSOpenGLPFAMultiScreen 81 ;
-: NSOpenGLPFACompliant 83 ;
-: NSOpenGLPFAScreenMask 84 ;
-: NSOpenGLPFAPixelBuffer 90 ;
-: NSOpenGLPFAAllowOfflineRenderers 96 ;
-: NSOpenGLPFAVirtualScreenCount 128 ;
-
-: kCGLRendererGenericFloatID HEX: 00020400 ;
+CONSTANT: NSOpenGLPFAAllRenderers 1
+CONSTANT: NSOpenGLPFADoubleBuffer 5
+CONSTANT: NSOpenGLPFAStereo 6
+CONSTANT: NSOpenGLPFAAuxBuffers 7
+CONSTANT: NSOpenGLPFAColorSize 8
+CONSTANT: NSOpenGLPFAAlphaSize 11
+CONSTANT: NSOpenGLPFADepthSize 12
+CONSTANT: NSOpenGLPFAStencilSize 13
+CONSTANT: NSOpenGLPFAAccumSize 14
+CONSTANT: NSOpenGLPFAMinimumPolicy 51
+CONSTANT: NSOpenGLPFAMaximumPolicy 52
+CONSTANT: NSOpenGLPFAOffScreen 53
+CONSTANT: NSOpenGLPFAFullScreen 54
+CONSTANT: NSOpenGLPFASampleBuffers 55
+CONSTANT: NSOpenGLPFASamples 56
+CONSTANT: NSOpenGLPFAAuxDepthStencil 57
+CONSTANT: NSOpenGLPFAColorFloat  58
+CONSTANT: NSOpenGLPFAMultisample 59
+CONSTANT: NSOpenGLPFASupersample 60
+CONSTANT: NSOpenGLPFASampleAlpha 61
+CONSTANT: NSOpenGLPFARendererID 70
+CONSTANT: NSOpenGLPFASingleRenderer 71
+CONSTANT: NSOpenGLPFANoRecovery 72
+CONSTANT: NSOpenGLPFAAccelerated 73
+CONSTANT: NSOpenGLPFAClosestPolicy 74
+CONSTANT: NSOpenGLPFARobust 75
+CONSTANT: NSOpenGLPFABackingStore 76
+CONSTANT: NSOpenGLPFAMPSafe 78
+CONSTANT: NSOpenGLPFAWindow 80
+CONSTANT: NSOpenGLPFAMultiScreen 81
+CONSTANT: NSOpenGLPFACompliant 83
+CONSTANT: NSOpenGLPFAScreenMask 84
+CONSTANT: NSOpenGLPFAPixelBuffer 90
+CONSTANT: NSOpenGLPFAAllowOfflineRenderers 96
+CONSTANT: NSOpenGLPFAVirtualScreenCount 128
+
+CONSTANT: kCGLRendererGenericFloatID HEX: 00020400
 
 <PRIVATE
 
@@ -94,7 +94,7 @@ PRIVATE>
 USE: opengl.gl
 USE: alien.syntax
 
-: NSOpenGLCPSwapInterval 222 ;
+CONSTANT: NSOpenGLCPSwapInterval 222
 
 LIBRARY: OpenGL
 
index 51f692d02d6658e7d8b2f60f77108246345357e6..4e0f768b960eaae9e98eb669807bf3f8f34df5d7 100644 (file)
@@ -4,15 +4,15 @@ USING: arrays kernel math cocoa cocoa.messages cocoa.classes
 sequences math.bitwise ;
 IN: cocoa.windows
 
-: NSBorderlessWindowMask     0 ; inline
-: NSTitledWindowMask         1 ; inline
-: NSClosableWindowMask       2 ; inline
-: NSMiniaturizableWindowMask 4 ; inline
-: NSResizableWindowMask      8 ; inline
+CONSTANT: NSBorderlessWindowMask     0
+CONSTANT: NSTitledWindowMask         1
+CONSTANT: NSClosableWindowMask       2
+CONSTANT: NSMiniaturizableWindowMask 4
+CONSTANT: NSResizableWindowMask      8
 
-: NSBackingStoreRetained    0 ; inline
-: NSBackingStoreNonretained 1 ; inline
-: NSBackingStoreBuffered    2 ; inline
+CONSTANT: NSBackingStoreRetained    0
+CONSTANT: NSBackingStoreNonretained 1
+CONSTANT: NSBackingStoreBuffered    2
 
 : standard-window-type ( -- n )
     {
index 1183c2e46c9cec55a431a81c087ecfe881232a87..9c55b1f29a20ce1eedda1f542d6ef3f31e0d089c 100644 (file)
@@ -18,16 +18,16 @@ M: color red>>   ( color -- red   ) >rgba red>>   ;
 M: color green>> ( color -- green ) >rgba green>> ;
 M: color blue>>  ( color -- blue  ) >rgba blue>>  ;
 
-: black        T{ rgba f 0.0   0.0   0.0   1.0  } ; inline
-: blue         T{ rgba f 0.0   0.0   1.0   1.0  } ; inline
-: cyan         T{ rgba f 0     0.941 0.941 1    } ; inline
-: gray         T{ rgba f 0.6   0.6   0.6   1.0  } ; inline
-: green        T{ rgba f 0.0   1.0   0.0   1.0  } ; inline
-: light-gray   T{ rgba f 0.95  0.95  0.95  0.95 } ; inline
-: light-purple T{ rgba f 0.8   0.8   1.0   1.0  } ; inline
-: magenta      T{ rgba f 0.941 0     0.941 1    } ; inline
-: orange       T{ rgba f 0.941 0.627 0     1    } ; inline
-: purple       T{ rgba f 0.627 0     0.941 1    } ; inline
-: red          T{ rgba f 1.0   0.0   0.0   1.0  } ; inline
-: white        T{ rgba f 1.0   1.0   1.0   1.0  } ; inline
-: yellow       T{ rgba f 1.0   1.0   0.0   1.0  } ; inline
+CONSTANT: black        T{ rgba f 0.0   0.0   0.0   1.0  }
+CONSTANT: blue         T{ rgba f 0.0   0.0   1.0   1.0  }
+CONSTANT: cyan         T{ rgba f 0     0.941 0.941 1    }
+CONSTANT: gray         T{ rgba f 0.6   0.6   0.6   1.0  }
+CONSTANT: green        T{ rgba f 0.0   1.0   0.0   1.0  }
+CONSTANT: light-gray   T{ rgba f 0.95  0.95  0.95  0.95 }
+CONSTANT: light-purple T{ rgba f 0.8   0.8   1.0   1.0  }
+CONSTANT: magenta      T{ rgba f 0.941 0     0.941 1    }
+CONSTANT: orange       T{ rgba f 0.941 0.627 0     1    }
+CONSTANT: purple       T{ rgba f 0.627 0     0.941 1    }
+CONSTANT: red          T{ rgba f 1.0   0.0   0.0   1.0  }
+CONSTANT: white        T{ rgba f 1.0   1.0   1.0   1.0  }
+CONSTANT: yellow       T{ rgba f 1.0   1.0   0.0   1.0  }
diff --git a/basis/colors/gray/summary.txt b/basis/colors/gray/summary.txt
new file mode 100644 (file)
index 0000000..55db158
--- /dev/null
@@ -0,0 +1 @@
+Grayscale colors
diff --git a/basis/colors/hsv/summary.txt b/basis/colors/hsv/summary.txt
new file mode 100644 (file)
index 0000000..bb946f0
--- /dev/null
@@ -0,0 +1 @@
+Hue-saturation-value colors
diff --git a/basis/combinators/short-circuit/smart/summary.txt b/basis/combinators/short-circuit/smart/summary.txt
new file mode 100644 (file)
index 0000000..7779f91
--- /dev/null
@@ -0,0 +1 @@
+Short-circuiting logical operations which infer the arity
diff --git a/basis/combinators/short-circuit/summary.txt b/basis/combinators/short-circuit/summary.txt
new file mode 100644 (file)
index 0000000..4b930db
--- /dev/null
@@ -0,0 +1 @@
+Short-circuiting logical operations
diff --git a/basis/combinators/smart/summary.txt b/basis/combinators/smart/summary.txt
new file mode 100644 (file)
index 0000000..10475cc
--- /dev/null
@@ -0,0 +1 @@
+Combinators which infer arities
diff --git a/basis/compiler/alien/summary.txt b/basis/compiler/alien/summary.txt
new file mode 100644 (file)
index 0000000..5fc715b
--- /dev/null
@@ -0,0 +1 @@
+Common code used for analysis and code generation of alien bindings
diff --git a/basis/compiler/cfg/alias-analysis/summary.txt b/basis/compiler/cfg/alias-analysis/summary.txt
new file mode 100644 (file)
index 0000000..c7e7c03
--- /dev/null
@@ -0,0 +1 @@
+Alias analysis for stack operations, array elements and tuple slots
diff --git a/basis/compiler/cfg/copy-prop/summary.txt b/basis/compiler/cfg/copy-prop/summary.txt
new file mode 100644 (file)
index 0000000..4273830
--- /dev/null
@@ -0,0 +1 @@
+Common code used by several passes to perform copy propagation
diff --git a/basis/compiler/cfg/dead-code/summary.txt b/basis/compiler/cfg/dead-code/summary.txt
new file mode 100644 (file)
index 0000000..c66cd99
--- /dev/null
@@ -0,0 +1 @@
+Dead-code elimination
index ba58e60a4ad0c15f8df8f12f3ecc0cbd6f69d88b..6d0a8f8c8e9b777fe07c3a68f027a4f9b3ef78e7 100644 (file)
@@ -16,7 +16,7 @@ M: callable test-cfg
     build-tree optimize-tree gensym build-cfg ;
 
 M: word test-cfg
-    [ build-tree-from-word nip optimize-tree ] keep build-cfg ;
+    [ build-tree-from-word optimize-tree ] keep build-cfg ;
 
 SYMBOL: allocate-registers?
 
diff --git a/basis/compiler/cfg/debugger/summary.txt b/basis/compiler/cfg/debugger/summary.txt
new file mode 100644 (file)
index 0000000..43e4191
--- /dev/null
@@ -0,0 +1 @@
+Tools for debugging low-level optimizer
diff --git a/basis/compiler/cfg/def-use/summary.txt b/basis/compiler/cfg/def-use/summary.txt
new file mode 100644 (file)
index 0000000..e28231e
--- /dev/null
@@ -0,0 +1 @@
+Common code used by several passes for def-use analysis
diff --git a/basis/compiler/cfg/hats/summary.txt b/basis/compiler/cfg/hats/summary.txt
new file mode 100644 (file)
index 0000000..d0ef839
--- /dev/null
@@ -0,0 +1 @@
+Utility for constructing basic blocks
diff --git a/basis/compiler/cfg/height/summary.txt b/basis/compiler/cfg/height/summary.txt
new file mode 100644 (file)
index 0000000..ce1974a
--- /dev/null
@@ -0,0 +1 @@
+Stack height normalization coalesces height changes at start of basic block
diff --git a/basis/compiler/cfg/instructions/summary.txt b/basis/compiler/cfg/instructions/summary.txt
new file mode 100644 (file)
index 0000000..803d6e3
--- /dev/null
@@ -0,0 +1 @@
+Basic block instructions
diff --git a/basis/compiler/cfg/instructions/syntax/summary.txt b/basis/compiler/cfg/instructions/syntax/summary.txt
new file mode 100644 (file)
index 0000000..944c38e
--- /dev/null
@@ -0,0 +1 @@
+Parsing word for defining instructions
diff --git a/basis/compiler/cfg/intrinsics/alien/summary.txt b/basis/compiler/cfg/intrinsics/alien/summary.txt
new file mode 100644 (file)
index 0000000..682aceb
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions for alien calls
diff --git a/basis/compiler/cfg/intrinsics/allot/summary.txt b/basis/compiler/cfg/intrinsics/allot/summary.txt
new file mode 100644 (file)
index 0000000..dc335f3
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions for inline memory allocation
diff --git a/basis/compiler/cfg/intrinsics/fixnum/summary.txt b/basis/compiler/cfg/intrinsics/fixnum/summary.txt
new file mode 100644 (file)
index 0000000..648573b
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions for fixnum arithmetic
diff --git a/basis/compiler/cfg/intrinsics/float/summary.txt b/basis/compiler/cfg/intrinsics/float/summary.txt
new file mode 100644 (file)
index 0000000..3da4a13
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions for floating point arithmetic
diff --git a/basis/compiler/cfg/intrinsics/misc/summary.txt b/basis/compiler/cfg/intrinsics/misc/summary.txt
new file mode 100644 (file)
index 0000000..295a34b
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions for miscellaneous primitives
diff --git a/basis/compiler/cfg/intrinsics/slots/summary.txt b/basis/compiler/cfg/intrinsics/slots/summary.txt
new file mode 100644 (file)
index 0000000..fd3c170
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions for slot access
diff --git a/basis/compiler/cfg/intrinsics/summary.txt b/basis/compiler/cfg/intrinsics/summary.txt
new file mode 100644 (file)
index 0000000..511091c
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions from certain primitives
diff --git a/basis/compiler/cfg/iterator/summary.txt b/basis/compiler/cfg/iterator/summary.txt
new file mode 100644 (file)
index 0000000..b5afb47
--- /dev/null
@@ -0,0 +1 @@
+Utility for iterating for high-level IR
diff --git a/basis/compiler/cfg/linear-scan/allocation/summary.txt b/basis/compiler/cfg/linear-scan/allocation/summary.txt
new file mode 100644 (file)
index 0000000..bb0290f
--- /dev/null
@@ -0,0 +1 @@
+Allocating registers for live intervals
diff --git a/basis/compiler/cfg/linear-scan/assignment/summary.txt b/basis/compiler/cfg/linear-scan/assignment/summary.txt
new file mode 100644 (file)
index 0000000..9f6b1b8
--- /dev/null
@@ -0,0 +1 @@
+Assigning registers to live intervals
diff --git a/basis/compiler/cfg/linear-scan/debugger/summary.txt b/basis/compiler/cfg/linear-scan/debugger/summary.txt
new file mode 100644 (file)
index 0000000..73f2210
--- /dev/null
@@ -0,0 +1 @@
+Tools for debugging register allocator
diff --git a/basis/compiler/cfg/linear-scan/live-intervals/summary.txt b/basis/compiler/cfg/linear-scan/live-intervals/summary.txt
new file mode 100644 (file)
index 0000000..e12e4c3
--- /dev/null
@@ -0,0 +1 @@
+Live intervals
diff --git a/basis/compiler/cfg/linear-scan/summary.txt b/basis/compiler/cfg/linear-scan/summary.txt
new file mode 100644 (file)
index 0000000..51858c8
--- /dev/null
@@ -0,0 +1 @@
+Linear-scan register allocation
diff --git a/basis/compiler/cfg/linearization/summary.txt b/basis/compiler/cfg/linearization/summary.txt
new file mode 100644 (file)
index 0000000..96daec8
--- /dev/null
@@ -0,0 +1 @@
+Flattening CFG into MR (machine representation)
diff --git a/basis/compiler/cfg/optimizer/summary.txt b/basis/compiler/cfg/optimizer/summary.txt
new file mode 100644 (file)
index 0000000..d6b0ad8
--- /dev/null
@@ -0,0 +1 @@
+Top-level harness for CFG optimization
diff --git a/basis/compiler/cfg/predecessors/summary.txt b/basis/compiler/cfg/predecessors/summary.txt
new file mode 100644 (file)
index 0000000..89e9a90
--- /dev/null
@@ -0,0 +1 @@
+Computing predecessors of basic blocks in CFG
diff --git a/basis/compiler/cfg/registers/summary.txt b/basis/compiler/cfg/registers/summary.txt
new file mode 100644 (file)
index 0000000..5258598
--- /dev/null
@@ -0,0 +1 @@
+Virtual single-assignment registers
diff --git a/basis/compiler/cfg/rpo/summary.txt b/basis/compiler/cfg/rpo/summary.txt
new file mode 100644 (file)
index 0000000..bcb03ef
--- /dev/null
@@ -0,0 +1 @@
+Reverse post-order linearization of CFG
diff --git a/basis/compiler/cfg/stack-frame/summary.txt b/basis/compiler/cfg/stack-frame/summary.txt
new file mode 100644 (file)
index 0000000..1ad913a
--- /dev/null
@@ -0,0 +1 @@
+Computing stack frame size and layout
diff --git a/basis/compiler/cfg/stacks/summary.txt b/basis/compiler/cfg/stacks/summary.txt
new file mode 100644 (file)
index 0000000..63da52f
--- /dev/null
@@ -0,0 +1 @@
+Generating instructions for accessing the data and retain stacks
diff --git a/basis/compiler/cfg/summary.txt b/basis/compiler/cfg/summary.txt
new file mode 100644 (file)
index 0000000..8cbb6a5
--- /dev/null
@@ -0,0 +1 @@
+Low-level control flow graph IR
diff --git a/basis/compiler/cfg/two-operand/summary.txt b/basis/compiler/cfg/two-operand/summary.txt
new file mode 100644 (file)
index 0000000..6c9154d
--- /dev/null
@@ -0,0 +1 @@
+Converting three-operand instructions into two-operand form
diff --git a/basis/compiler/cfg/useless-blocks/summary.txt b/basis/compiler/cfg/useless-blocks/summary.txt
new file mode 100644 (file)
index 0000000..616fae7
--- /dev/null
@@ -0,0 +1 @@
+Eliminating unreachable basic blocks and unconditional jumps
diff --git a/basis/compiler/cfg/utilities/summary.txt b/basis/compiler/cfg/utilities/summary.txt
new file mode 100644 (file)
index 0000000..7bb20b1
--- /dev/null
@@ -0,0 +1 @@
+Utility words used by CFG optimization
diff --git a/basis/compiler/cfg/value-numbering/expressions/summary.txt b/basis/compiler/cfg/value-numbering/expressions/summary.txt
new file mode 100644 (file)
index 0000000..22aacde
--- /dev/null
@@ -0,0 +1 @@
+Value numbering expressions
diff --git a/basis/compiler/cfg/value-numbering/graph/summary.txt b/basis/compiler/cfg/value-numbering/graph/summary.txt
new file mode 100644 (file)
index 0000000..f6fb58d
--- /dev/null
@@ -0,0 +1 @@
+Value numbering expression graph
diff --git a/basis/compiler/cfg/value-numbering/propagate/summary.txt b/basis/compiler/cfg/value-numbering/propagate/summary.txt
new file mode 100644 (file)
index 0000000..fd56a8e
--- /dev/null
@@ -0,0 +1 @@
+Propagation pass to update code after value numbering
diff --git a/basis/compiler/cfg/value-numbering/rewrite/summary.txt b/basis/compiler/cfg/value-numbering/rewrite/summary.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/basis/compiler/cfg/value-numbering/simplify/summary.txt b/basis/compiler/cfg/value-numbering/simplify/summary.txt
new file mode 100644 (file)
index 0000000..1027c83
--- /dev/null
@@ -0,0 +1 @@
+Algebraic simplification of expressions
diff --git a/basis/compiler/cfg/value-numbering/summary.txt b/basis/compiler/cfg/value-numbering/summary.txt
new file mode 100644 (file)
index 0000000..8d48ebe
--- /dev/null
@@ -0,0 +1 @@
+Local value numbering for common subexpression elimination
diff --git a/basis/compiler/cfg/write-barrier/summary.txt b/basis/compiler/cfg/write-barrier/summary.txt
new file mode 100644 (file)
index 0000000..453cda6
--- /dev/null
@@ -0,0 +1 @@
+Write barrier elimination
diff --git a/basis/compiler/codegen/summary.txt b/basis/compiler/codegen/summary.txt
new file mode 100644 (file)
index 0000000..7a6e01c
--- /dev/null
@@ -0,0 +1 @@
+Code generation from MR (machine representation)
index 512d26f4bf6ef86e9b23e80579a66d7316cd90b0..9169e9e0fa38eeabf8b7624b0dfcad22abaaaf45 100644 (file)
@@ -1,5 +1,5 @@
 USING: help.markup help.syntax words io parser
-assocs words.private sequences compiler.units ;
+assocs words.private sequences compiler.units quotations ;
 IN: compiler
 
 HELP: enable-compiler
@@ -16,18 +16,24 @@ ARTICLE: "compiler-usage" "Calling the optimizing compiler"
 { $subsection optimized-recompile-hook }
 "Removing a word's optimized definition:"
 { $subsection decompile }
+"Compiling a single quotation:"
+{ $subsection compile-call }
 "Higher-level words can be found in " { $link "compilation-units" } "." ;
 
 ARTICLE: "compiler" "Optimizing compiler"
-"Factor is a fully compiled language implementation with two distinct compilers:"
+"Factor includes two compilers which work behind the scenes. Words are always compiled, and the compilers do not have to be invoked explicitly. For the most part, compilation is fully transparent. However, there are a few things worth knowing about the compilation process."
+$nl
+"The two compilers differ in the level of analysis they perform:"
 { $list
     { "The " { $emphasis "non-optimizing quotation compiler" } " compiles quotations to naive machine code very quickly. The non-optimizing quotation compiler is part of the VM." }
     { "The " { $emphasis "optimizing word compiler" } " compiles whole words at a time while performing extensive data and control flow analysis. This provides greater performance for generated code, but incurs a much longer compile time. The optimizing compiler is written in Factor." }
 }
-"The optimizing compiler only compiles words which have a static stack effect. This means that methods defined on fundamental generic words such as " { $link nth } " should have a static stack effect; for otherwise, most of the system would be compiled with the non-optimizing compiler. See " { $link "inference" } " and " { $link "cookbook-pitfalls" } "."
-{ $subsection "compiler-usage" }
+"The optimizing compiler only compiles words which have a static stack effect. This means that methods defined on fundamental generic words such as " { $link nth } " should have a static stack effect. See " { $link "inference" } " and " { $link "cookbook-pitfalls" } "."
+$nl
+"The optimizing compiler also trades off compile time for performance of generated code, so loading certain vocabularies might take a while. Saving the image after loading vocabularies can save you a lot of time that you would spend waiting for the same code to load in every coding session; see " { $link "images" } " for information."
 { $subsection "compiler-errors" }
-{ $subsection "hints" } ;
+{ $subsection "hints" }
+{ $subsection "compiler-usage" } ;
 
 ABOUT: "compiler"
 
@@ -44,3 +50,8 @@ HELP: optimized-recompile-hook
 { $values { "words" "a sequence of words" } { "alist" "an association list" } }
 { $description "Compile a set of words." }
 { $notes "This is an internal word, and user code should call " { $link compile } " instead." } ;
+
+HELP: compile-call
+{ $values { "quot" quotation } }
+{ $description "Compiles and runs a quotation." }
+{ $notes "This word is used by compiler unit tests to test compilation of small pieces of code." } ;
index f2f4e7aa9e5c65b73bc55676a7c26b49d3d7da39..d6da95408df229fe83091cb4a4ed96405ad34854 100644 (file)
@@ -1,46 +1,47 @@
 ! Copyright (C) 2004, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel namespaces arrays sequences io
-words fry continuations vocabs assocs dlists definitions math
-graphs generic combinators deques search-deques io
-stack-checker stack-checker.state stack-checker.inlining
-compiler.errors compiler.units compiler.tree.builder
-compiler.tree.optimizer compiler.cfg.builder
-compiler.cfg.optimizer compiler.cfg.linearization
-compiler.cfg.two-operand compiler.cfg.linear-scan
-compiler.cfg.stack-frame compiler.codegen compiler.utilities ;
+USING: accessors kernel namespaces arrays sequences io words fry
+continuations vocabs assocs dlists definitions math graphs
+generic combinators deques search-deques io stack-checker
+stack-checker.state stack-checker.inlining
+combinators.short-circuit compiler.errors compiler.units
+compiler.tree.builder compiler.tree.optimizer
+compiler.cfg.builder compiler.cfg.optimizer
+compiler.cfg.linearization compiler.cfg.two-operand
+compiler.cfg.linear-scan compiler.cfg.stack-frame
+compiler.codegen compiler.utilities ;
 IN: compiler
 
 SYMBOL: compile-queue
 SYMBOL: compiled
 
-: queue-compile ( word -- )
+: queue-compile? ( word -- ? )
     {
-        { [ dup "forgotten" word-prop ] [ ] }
-        { [ dup compiled get key? ] [ ] }
-        { [ dup inlined-block? ] [ ] }
-        { [ dup primitive? ] [ ] }
-        [ dup compile-queue get push-front ]
-    } cond drop ;
+        [ "forgotten" word-prop ]
+        [ compiled get key? ]
+        [ inlined-block? ]
+        [ primitive? ]
+    } 1|| not ;
+
+: queue-compile ( word -- )
+    dup queue-compile? [ compile-queue get push-front ] [ drop ] if ;
 
 : maybe-compile ( word -- )
     dup optimized>> [ drop ] [ queue-compile ] if ;
 
-SYMBOL: +failed+
+SYMBOLS: +optimized+ +unoptimized+ ;
 
 : ripple-up ( words -- )
-    dup "compiled-effect" word-prop +failed+ eq?
+    dup "compiled-status" word-prop +unoptimized+ eq?
     [ usage [ word? ] filter ] [ compiled-usage keys ] if
     [ queue-compile ] each ;
 
-: ripple-up? ( word effect -- ? )
-    #! If the word has previously been compiled and had a
-    #! different stack effect, we have to recompile any callers.
-    swap "compiled-effect" word-prop [ = not ] keep and ;
+: ripple-up? ( word status -- ? )
+    swap "compiled-status" word-prop [ = not ] keep and ;
 
-: save-effect ( word effect -- )
+: save-compiled-status ( word status -- )
     [ dupd ripple-up? [ ripple-up ] [ drop ] if ]
-    [ "compiled-effect" set-word-prop ]
+    [ "compiled-status" set-word-prop ]
     2bi ;
 
 : start ( word -- )
@@ -49,18 +50,18 @@ SYMBOL: +failed+
     H{ } clone generic-dependencies set
     f swap compiler-error ;
 
-: fail ( word error -- )
+: fail ( word error -- )
     [ swap compiler-error ]
     [
         drop
         [ compiled-unxref ]
         [ f swap compiled get set-at ]
-        [ +failed+ save-effect ]
+        [ +unoptimized+ save-compiled-status ]
         tri
     ] 2bi
     return ;
 
-: frontend ( word -- effect nodes )
+: frontend ( word -- nodes )
     [ build-tree-from-word ] [ fail ] recover optimize-tree ;
 
 ! Only switch this off for debugging.
@@ -84,8 +85,8 @@ t compile-dependencies? set-global
         save-asm
     ] each ;
 
-: finish ( effect word -- )
-    [ swap save-effect ]
+: finish ( word -- )
+    [ +optimized+ save-compiled-status ]
     [ compiled-unxref ]
     [
         dup crossref?
@@ -112,6 +113,9 @@ t compile-dependencies? set-global
 : decompile ( word -- )
     f 2array 1array modify-code-heap ;
 
+: compile-call ( quot -- )
+    [ dup infer define-temp ] with-compilation-unit execute ;
+
 : optimized-recompile-hook ( words -- alist )
     [
         <hashed-dlist> compile-queue set
index 48ea958818a38fd4344256163565941513421f41..e03c062e9e0249ad6485fbf21e94a92bd67309bc 100644 (file)
@@ -4,8 +4,8 @@ USING: math kernel layouts system strings ;
 IN: compiler.constants
 
 ! These constants must match vm/memory.h
-: card-bits 8 ; inline
-: deck-bits 18 ; inline
+CONSTANT: card-bits 8
+CONSTANT: deck-bits 18
 : card-mark ( -- n ) HEX: 40 HEX: 80 bitor ; inline
 
 ! These constants must match vm/layouts.h
@@ -26,25 +26,25 @@ IN: compiler.constants
 : compiled-header-size ( -- n ) 4 bootstrap-cells ; inline
 
 ! Relocation classes
-: rc-absolute-cell    0 ; inline
-: rc-absolute         1 ; inline
-: rc-relative         2 ; inline
-: rc-absolute-ppc-2/2 3 ; inline
-: rc-relative-ppc-2   4 ; inline
-: rc-relative-ppc-3   5 ; inline
-: rc-relative-arm-3   6 ; inline
-: rc-indirect-arm     7 ; inline
-: rc-indirect-arm-pc  8 ; inline
+CONSTANT: rc-absolute-cell    0
+CONSTANT: rc-absolute         1
+CONSTANT: rc-relative         2
+CONSTANT: rc-absolute-ppc-2/2 3
+CONSTANT: rc-relative-ppc-2   4
+CONSTANT: rc-relative-ppc-3   5
+CONSTANT: rc-relative-arm-3   6
+CONSTANT: rc-indirect-arm     7
+CONSTANT: rc-indirect-arm-pc  8
 
 ! Relocation types
-: rt-primitive   0 ; inline
-: rt-dlsym       1 ; inline
-: rt-dispatch    2 ; inline
-: rt-xt          3 ; inline
-: rt-here        4 ; inline
-: rt-label       5 ; inline
-: rt-immediate   6 ; inline
-: rt-stack-chain 7 ; inline
+CONSTANT: rt-primitive   0
+CONSTANT: rt-dlsym       1
+CONSTANT: rt-dispatch    2
+CONSTANT: rt-xt          3
+CONSTANT: rt-here        4
+CONSTANT: rt-label       5
+CONSTANT: rt-immediate   6
+CONSTANT: rt-stack-chain 7
 
 : rc-absolute? ( n -- ? )
     [ rc-absolute-ppc-2/2 = ]
index 78e95ffb91e86efe0847752212f0f2ea63572b96..2e02e5476c735b89e45879c46773838f346b1c12 100644 (file)
@@ -51,7 +51,7 @@ unit-test
     \ foo [ global >n get ndrop ] compile-call
 ] unit-test
 
-: blech drop ;
+: blech ( x -- ) drop ;
 
 [ 3 ]
 [
@@ -102,7 +102,7 @@ unit-test
 [ ] [
     [
         [ 200 dup [ 200 3array ] curry map drop ] times
-    ] [ define-temp ] with-compilation-unit drop
+    ] [ (( n -- )) define-temp ] with-compilation-unit drop
 ] unit-test
 
 ! Test how dispatch handles the end of a basic block
index 1857baf503560e798d37e17a37d515fa6131bded..2d1f15b9a80842fdf90d294308385391b61a7f2b 100644 (file)
@@ -1,5 +1,5 @@
 USING: tools.test quotations math kernel sequences
-assocs namespaces make compiler.units ;
+assocs namespaces make compiler.units compiler ;
 IN: compiler.tests
 
 [ 3 ] [ 5 [ [ 2 - ] curry call ] compile-call ] unit-test
@@ -32,15 +32,15 @@ IN: compiler.tests
     compile-call
 ] unit-test
 
-: foobar ( quot -- )
-    dup slip swap [ foobar ] [ drop ] if ; inline
+: foobar ( quot: ( -- ) -- )
+    dup slip swap [ foobar ] [ drop ] if ; inline recursive
 
 [ ] [ [ [ f ] foobar ] compile-call ] unit-test
 
 [ { 6 7 8 } ] [ { 1 2 3 } 5 [ [ + ] curry map ] compile-call ] unit-test
 [ { 6 7 8 } ] [ { 1 2 3 } [ 5 [ + ] curry map ] compile-call ] unit-test
 
-: funky-assoc>map
+: funky-assoc>map ( assoc quot -- seq )
     [
         [ call f ] curry assoc-find 3drop
     ] { } make ; inline
index 81ab750305f9527b891f212ec3921fac75b57f77..b439b5f6a4adfa123c7583fc09540e0e8be4caf3 100644 (file)
@@ -1,5 +1,5 @@
 IN: compiler.tests
-USING: compiler.units kernel kernel.private memory math
+USING: compiler.units compiler kernel kernel.private memory math
 math.private tools.test math.floats.private ;
 
 [ 5.0 ] [ [ 5.0 ] compile-call gc gc gc ] unit-test
index df5f484952b71a1df3c73cba2887ab1a9e6e98a8..6c6d580c877e13b9d8d4b381db1170b08b1a4701 100644 (file)
@@ -5,7 +5,7 @@ strings.private system random layouts vectors
 sbufs strings.private slots.private alien math.order
 alien.accessors alien.c-types alien.syntax alien.strings
 namespaces libc sequences.private io.encodings.ascii
-classes ;
+classes compiler ;
 IN: compiler.tests
 
 ! Make sure that intrinsic ops compile to correct code.
index c5bbe4a6c3937693ee0decb15c4f9af875a6690e..b5cb0ddbdbe4561c9ccd47de2a781ece20d63bb7 100644 (file)
@@ -3,7 +3,8 @@ stack-checker kernel kernel.private math prettyprint sequences
 sbufs strings tools.test vectors words sequences.private
 quotations classes classes.algebra classes.tuple.private
 continuations growable namespaces hints alien.accessors
-compiler.tree.builder compiler.tree.optimizer sequences.deep ;
+compiler.tree.builder compiler.tree.optimizer sequences.deep
+compiler ;
 IN: optimizer.tests
 
 GENERIC: xyz ( obj -- obj )
@@ -54,7 +55,7 @@ TUPLE: pred-test ;
 
 ! regression
 
-: literal-not-branch 0 not [ ] [ ] if ;
+: literal-not-branch ( -- ) 0 not [ ] [ ] if ;
 
 [ ] [ literal-not-branch ] unit-test
 
@@ -107,12 +108,12 @@ GENERIC: void-generic ( obj -- * )
 [ 10 ] [ branch-fold-regression-1 ] unit-test
 
 ! another regression
-: constant-branch-fold-0 "hey" ; foldable
+: constant-branch-fold-0 ( -- value ) "hey" ; foldable
 : constant-branch-fold-1 ( -- ? ) constant-branch-fold-0 "hey" = ; inline
 [ 1 ] [ [ constant-branch-fold-1 [ 1 ] [ 2 ] if ] compile-call ] unit-test
 
 ! another regression
-: foo f ;
+: foo ( -- value ) f ;
 : bar ( -- ? ) foo 4 4 = and ;
 [ f ] [ bar ] unit-test
 
@@ -133,15 +134,15 @@ M: slice foozul ;
 ] unit-test
 
 ! regression
-: constant-fold-2 f ; foldable
-: constant-fold-3 4 ; foldable
+: constant-fold-2 ( -- value ) f ; foldable
+: constant-fold-3 ( -- value ) 4 ; foldable
 
 [ f t ] [
     [ constant-fold-2 constant-fold-3 4 = ] compile-call
 ] unit-test
 
-: constant-fold-4 f ; foldable
-: constant-fold-5 f ; foldable
+: constant-fold-4 ( -- value ) f ; foldable
+: constant-fold-5 ( -- value ) f ; foldable
 
 [ f ] [
     [ constant-fold-4 constant-fold-5 or ] compile-call
@@ -208,14 +209,14 @@ USE: sorting
 USE: binary-search
 USE: binary-search.private
 
-: old-binsearch ( elt quot seq -- elt quot i )
+: old-binsearch ( elt quot: ( -- ) seq -- elt quot i )
     dup length 1 <= [
         from>>
     ] [
         [ midpoint swap call ] 3keep roll dup zero?
         [ drop dup from>> swap midpoint@ + ]
-        [ dup midpoint@ cut-slice old-binsearch ] if
-    ] if ; inline
+        [ drop dup midpoint@ head-slice old-binsearch ] if
+    ] if ; inline recursive
 
 [ 10 ] [
     10 20 >vector <flat-slice>
@@ -246,7 +247,7 @@ USE: binary-search.private
 [ 3 "an integer" ] [ 3 lift-throw-tail-regression ] unit-test
 [ "hi" "a string" ] [ "hi" lift-throw-tail-regression ] unit-test
 
-: lift-loop-tail-test-1 ( a quot -- )
+: lift-loop-tail-test-1 ( a quot: ( -- ) -- )
     over even? [
         [ [ 3 - ] dip call ] keep lift-loop-tail-test-1
     ] [
@@ -255,11 +256,13 @@ USE: binary-search.private
         ] [
             [ [ 2 - ] dip call ] keep lift-loop-tail-test-1
         ] if
-    ] if ; inline
+    ] if ; inline recursive
 
-: lift-loop-tail-test-2
+: lift-loop-tail-test-2 ( -- a b c )
     10 [ ] lift-loop-tail-test-1 1 2 3 ;
 
+\ lift-loop-tail-test-2 must-infer
+
 [ 1 2 3 ] [ lift-loop-tail-test-2 ] unit-test
 
 ! Forgot a recursive inline check
@@ -300,7 +303,7 @@ HINTS: recursive-inline-hang-3 array ;
 : member-test ( obj -- ? ) { + - * / /i } member? ;
 
 \ member-test must-infer
-[ ] [ \ member-test build-tree-from-word optimize-tree 2drop ] unit-test
+[ ] [ \ member-test build-tree-from-word optimize-tree drop ] unit-test
 [ t ] [ \ + member-test ] unit-test
 [ f ] [ \ append member-test ] unit-test
 
diff --git a/basis/compiler/tests/peg-regression-2.factor b/basis/compiler/tests/peg-regression-2.factor
new file mode 100644 (file)
index 0000000..1efadba
--- /dev/null
@@ -0,0 +1,15 @@
+IN: compiler.tests
+USING: peg.ebnf strings tools.test ;
+
+GENERIC: <times> ( times -- term' )
+M: string <times> ;
+
+EBNF: parse-regexp
+
+Times = .* => [[ "foo" ]]
+
+Regexp = Times:t => [[ t <times> ]]
+
+;EBNF
+
+[ "foo" ] [ "a" parse-regexp ] unit-test
\ No newline at end of file
index a6d6c5dfb9ac8812387a300ad6f85587c3112cee..d53b864b06c7dc8e9ee5b275552160e756854d49 100644 (file)
@@ -18,13 +18,13 @@ IN: compiler.tests
 [ "hey" ] [ [ "hey" ] compile-call ] unit-test
 
 ! Calls
-: no-op ;
+: no-op ( -- ) ;
 
 [ ] [ [ no-op ] compile-call ] unit-test
 [ 3 ] [ [ no-op 3 ] compile-call ] unit-test
 [ 3 ] [ [ 3 no-op ] compile-call ] unit-test
 
-: bar 4 ;
+: bar ( -- value ) 4 ;
 
 [ 4 ] [ [ bar no-op ] compile-call ] unit-test
 [ 4 3 ] [ [ no-op bar 3 ] compile-call ] unit-test
@@ -54,7 +54,7 @@ IN: compiler.tests
 
 ! Labels
 
-: recursive-test ( ? -- ) [ f recursive-test ] when ; inline
+: recursive-test ( ? -- ) [ f recursive-test ] when ; inline recursive
 
 [ ] [ t [ recursive-test ] compile-call ] unit-test
 
index 602b438432795832e0649e6b401b9cfb84191eae..caa214b70cccd1328b42d83ef8279a818c570a3f 100644 (file)
@@ -1,5 +1,5 @@
 IN: compiler.tests
-USING: kernel tools.test compiler.units ;
+USING: kernel tools.test compiler.units compiler ;
 
 TUPLE: color red green blue ;
 
index d758e2a34d391f505af1a72bca2f1d20a122797d..4982a3986c83ed512a0457c863e619b9620948b1 100755 (executable)
@@ -8,4 +8,4 @@ compiler.tree ;
 
 : inline-recursive ( -- ) inline-recursive ; inline recursive
 
-[ t ] [ \ inline-recursive build-tree-from-word [ #recursive? ] any? nip ] unit-test
+[ t ] [ \ inline-recursive build-tree-from-word [ #recursive? ] any? ] unit-test
index b7152234452227e02cc5aa26805a0da2547c3b2d..4cb7650b1de1721d6472408a80ac84c0e9e100a6 100644 (file)
@@ -12,18 +12,18 @@ IN: compiler.tree.builder
 
 : with-tree-builder ( quot -- nodes )
     '[ V{ } clone stack-visitor set @ ]
-    with-infer ; inline
+    with-infer nip ; inline
 
 : build-tree ( quot -- nodes )
     #! Not safe to call from inference transforms.
-    [ f initial-recursive-state infer-quot ] with-tree-builder nip ;
+    [ f initial-recursive-state infer-quot ] with-tree-builder ;
 
 : build-tree-with ( in-stack quot -- nodes out-stack )
     #! Not safe to call from inference transforms.
     [
         [ >vector \ meta-d set ]
         [ f initial-recursive-state infer-quot ] bi*
-    ] with-tree-builder nip
+    ] with-tree-builder
     unclip-last in-d>> ;
 
 : build-sub-tree ( #call quot -- nodes )
@@ -45,7 +45,7 @@ IN: compiler.tree.builder
 : check-no-compile ( word -- )
     dup "no-compile" word-prop [ cannot-infer-effect ] [ drop ] if ;
 
-: build-tree-from-word ( word -- effect nodes )
+: build-tree-from-word ( word -- nodes )
     [
         [
             {
diff --git a/basis/compiler/tree/builder/summary.txt b/basis/compiler/tree/builder/summary.txt
new file mode 100644 (file)
index 0000000..de3a6f9
--- /dev/null
@@ -0,0 +1 @@
+Constructing high-level tree IR
diff --git a/basis/compiler/tree/checker/summary.txt b/basis/compiler/tree/checker/summary.txt
new file mode 100644 (file)
index 0000000..257abfe
--- /dev/null
@@ -0,0 +1 @@
+Debugging tool for checking various invariants of tree IR
index 751a335a1353d36e138419c1108378614f892500..54f8aaf20ecae62f4666254d311a73368d6d4da0 100755 (executable)
@@ -474,7 +474,7 @@ cell-bits 32 = [
 ] unit-test
 
 ! A reduction
-: buffalo-sauce f ;
+: buffalo-sauce ( -- value ) f ;
 
 : steak ( -- )
     buffalo-sauce [ steak ] when ; inline recursive
diff --git a/basis/compiler/tree/cleanup/summary.txt b/basis/compiler/tree/cleanup/summary.txt
new file mode 100644 (file)
index 0000000..de7b8e3
--- /dev/null
@@ -0,0 +1 @@
+Finalizing speculative inlining and constant folding from propagation pass
diff --git a/basis/compiler/tree/combinators/summary.txt b/basis/compiler/tree/combinators/summary.txt
new file mode 100644 (file)
index 0000000..8e9114e
--- /dev/null
@@ -0,0 +1 @@
+Combinators for iterating over tree IR
index 52423024110b2ce84a750fb76514703cb2d7d513..5f4b1e8dabd15b2c531a895c1eed31953d51f9d4 100644 (file)
@@ -5,9 +5,9 @@ IN: compiler.tree.comparisons
 
 ! Some utilities for working with comparison operations.
 
-: comparison-ops { < > <= >= } ;
+CONSTANT: comparison-ops { < > <= >= }
 
-: generic-comparison-ops { before? after? before=? after=? } ;
+CONSTANT: generic-comparison-ops { before? after? before=? after=? }
 
 : assumption ( i1 i2 op -- i3 )
     {
diff --git a/basis/compiler/tree/comparisons/summary.txt b/basis/compiler/tree/comparisons/summary.txt
new file mode 100644 (file)
index 0000000..9d92ac4
--- /dev/null
@@ -0,0 +1 @@
+Utilities for working with binary comparison operations
diff --git a/basis/compiler/tree/dead-code/branches/summary.txt b/basis/compiler/tree/dead-code/branches/summary.txt
new file mode 100644 (file)
index 0000000..f635191
--- /dev/null
@@ -0,0 +1 @@
+Dead branch elimination
diff --git a/basis/compiler/tree/dead-code/liveness/summary.txt b/basis/compiler/tree/dead-code/liveness/summary.txt
new file mode 100644 (file)
index 0000000..f18a330
--- /dev/null
@@ -0,0 +1 @@
+Liveness analysis
diff --git a/basis/compiler/tree/dead-code/recursive/summary.txt b/basis/compiler/tree/dead-code/recursive/summary.txt
new file mode 100644 (file)
index 0000000..3d51eaf
--- /dev/null
@@ -0,0 +1 @@
+Dead code elimination for inline recursive combinators
diff --git a/basis/compiler/tree/dead-code/simple/summary.txt b/basis/compiler/tree/dead-code/simple/summary.txt
new file mode 100644 (file)
index 0000000..8f8f091
--- /dev/null
@@ -0,0 +1 @@
+Dead code elimination for straight-line code
diff --git a/basis/compiler/tree/dead-code/summary.txt b/basis/compiler/tree/dead-code/summary.txt
new file mode 100644 (file)
index 0000000..82b391c
--- /dev/null
@@ -0,0 +1 @@
+Dead code elimination
index 9f2cc0536e34a9bc622317e9b67d8410484aa61a..188dcdb93598384281fb4e95e163d0ada87353e9 100644 (file)
@@ -144,7 +144,7 @@ SYMBOL: node-count
 
 : make-report ( word/quot -- assoc )
     [
-        dup word? [ build-tree-from-word nip ] [ build-tree ] if
+        dup word? [ build-tree-from-word ] [ build-tree ] if
         optimize-tree
 
         H{ } clone words-called set
diff --git a/basis/compiler/tree/debugger/summary.txt b/basis/compiler/tree/debugger/summary.txt
new file mode 100644 (file)
index 0000000..c91394d
--- /dev/null
@@ -0,0 +1 @@
+Tools for debugging high-level optimizer
diff --git a/basis/compiler/tree/def-use/simplified/summary.txt b/basis/compiler/tree/def-use/simplified/summary.txt
new file mode 100644 (file)
index 0000000..f87e851
--- /dev/null
@@ -0,0 +1 @@
+Variant form of def-use chains used by modular arithmetic optimization
diff --git a/basis/compiler/tree/escape-analysis/allocations/summary.txt b/basis/compiler/tree/escape-analysis/allocations/summary.txt
new file mode 100644 (file)
index 0000000..422a8a4
--- /dev/null
@@ -0,0 +1 @@
+Tracking memory allocations
diff --git a/basis/compiler/tree/escape-analysis/branches/summary.txt b/basis/compiler/tree/escape-analysis/branches/summary.txt
new file mode 100644 (file)
index 0000000..592797b
--- /dev/null
@@ -0,0 +1 @@
+Escape analysis for conditionals
diff --git a/basis/compiler/tree/escape-analysis/check/summary.txt b/basis/compiler/tree/escape-analysis/check/summary.txt
new file mode 100644 (file)
index 0000000..fe000ce
--- /dev/null
@@ -0,0 +1 @@
+Skipping escape analysis pass for code which does not allocate
diff --git a/basis/compiler/tree/escape-analysis/nodes/summary.txt b/basis/compiler/tree/escape-analysis/nodes/summary.txt
new file mode 100644 (file)
index 0000000..f2febaf
--- /dev/null
@@ -0,0 +1 @@
+Per-node dispatch for escape analysis
diff --git a/basis/compiler/tree/escape-analysis/recursive/summary.txt b/basis/compiler/tree/escape-analysis/recursive/summary.txt
new file mode 100644 (file)
index 0000000..e412f5d
--- /dev/null
@@ -0,0 +1 @@
+Escape analysis for inline recursive combinators
diff --git a/basis/compiler/tree/escape-analysis/simple/summary.txt b/basis/compiler/tree/escape-analysis/simple/summary.txt
new file mode 100644 (file)
index 0000000..8035abc
--- /dev/null
@@ -0,0 +1 @@
+Escape analysis for straight-line code
diff --git a/basis/compiler/tree/escape-analysis/summary.txt b/basis/compiler/tree/escape-analysis/summary.txt
new file mode 100644 (file)
index 0000000..dba0e47
--- /dev/null
@@ -0,0 +1 @@
+Escape analysis for tuple unboxing
diff --git a/basis/compiler/tree/finalization/summary.txt b/basis/compiler/tree/finalization/summary.txt
new file mode 100644 (file)
index 0000000..8967945
--- /dev/null
@@ -0,0 +1 @@
+Final pass cleans up high-level IR
diff --git a/basis/compiler/tree/identities/summary.txt b/basis/compiler/tree/identities/summary.txt
new file mode 100644 (file)
index 0000000..67c9f9f
--- /dev/null
@@ -0,0 +1 @@
+Applying arithmetic identities to integer code
diff --git a/basis/compiler/tree/late-optimizations/summary.txt b/basis/compiler/tree/late-optimizations/summary.txt
new file mode 100644 (file)
index 0000000..9d3e2db
--- /dev/null
@@ -0,0 +1 @@
+Utilities used by several optimization passes run in the later stages
diff --git a/basis/compiler/tree/modular-arithmetic/summary.txt b/basis/compiler/tree/modular-arithmetic/summary.txt
new file mode 100644 (file)
index 0000000..88ecbe1
--- /dev/null
@@ -0,0 +1 @@
+Modular arithmetic optimization
diff --git a/basis/compiler/tree/normalization/introductions/summary.txt b/basis/compiler/tree/normalization/introductions/summary.txt
new file mode 100644 (file)
index 0000000..baee9c8
--- /dev/null
@@ -0,0 +1 @@
+Coalesce value introduction nodes to beginning of each tree leaf
diff --git a/basis/compiler/tree/normalization/renaming/summary.txt b/basis/compiler/tree/normalization/renaming/summary.txt
new file mode 100644 (file)
index 0000000..0fc4f59
--- /dev/null
@@ -0,0 +1 @@
+Support for renaming values
diff --git a/basis/compiler/tree/normalization/summary.txt b/basis/compiler/tree/normalization/summary.txt
new file mode 100644 (file)
index 0000000..9bb0673
--- /dev/null
@@ -0,0 +1 @@
+Normalize IR created by high level IR builder to simplify subsequent passes
diff --git a/basis/compiler/tree/optimizer/summary.txt b/basis/compiler/tree/optimizer/summary.txt
new file mode 100644 (file)
index 0000000..f00b60f
--- /dev/null
@@ -0,0 +1 @@
+Top-level harness for high-level optimizer
diff --git a/basis/compiler/tree/propagation/branches/summary.txt b/basis/compiler/tree/propagation/branches/summary.txt
new file mode 100644 (file)
index 0000000..c4dc675
--- /dev/null
@@ -0,0 +1 @@
+Sparse propagation for branches
diff --git a/basis/compiler/tree/propagation/constraints/summary.txt b/basis/compiler/tree/propagation/constraints/summary.txt
new file mode 100644 (file)
index 0000000..186b5c0
--- /dev/null
@@ -0,0 +1 @@
+Support for predicated value info
diff --git a/basis/compiler/tree/propagation/copy/summary.txt b/basis/compiler/tree/propagation/copy/summary.txt
new file mode 100644 (file)
index 0000000..2deae09
--- /dev/null
@@ -0,0 +1 @@
+Copy propagation
index 771d3800df6780007e15708a6e5c997c8d0f947c..7b1723620b8863ebc7979f37d3252afdcd38d500 100644 (file)
@@ -32,9 +32,9 @@ literal?
 length
 slots ;
 
-: null-info T{ value-info f null empty-interval } ; inline
+CONSTANT: null-info T{ value-info f null empty-interval }
 
-: object-info T{ value-info f object full-interval } ; inline
+CONSTANT: object-info T{ value-info f object full-interval }
 
 : class-interval ( class -- interval )
     dup real class<=
diff --git a/basis/compiler/tree/propagation/info/summary.txt b/basis/compiler/tree/propagation/info/summary.txt
new file mode 100644 (file)
index 0000000..26faa34
--- /dev/null
@@ -0,0 +1 @@
+Value info data type and operations
diff --git a/basis/compiler/tree/propagation/inlining/summary.txt b/basis/compiler/tree/propagation/inlining/summary.txt
new file mode 100644 (file)
index 0000000..e4fc715
--- /dev/null
@@ -0,0 +1 @@
+Method inlining and dispatch elimination
diff --git a/basis/compiler/tree/propagation/known-words/summary.txt b/basis/compiler/tree/propagation/known-words/summary.txt
new file mode 100644 (file)
index 0000000..b53506f
--- /dev/null
@@ -0,0 +1 @@
+Propagation rules for certain known words
diff --git a/basis/compiler/tree/propagation/nodes/summary.txt b/basis/compiler/tree/propagation/nodes/summary.txt
new file mode 100644 (file)
index 0000000..c4fcd37
--- /dev/null
@@ -0,0 +1 @@
+Node dispatch for propagation pass
diff --git a/basis/compiler/tree/propagation/recursive/summary.txt b/basis/compiler/tree/propagation/recursive/summary.txt
new file mode 100644 (file)
index 0000000..b0c844c
--- /dev/null
@@ -0,0 +1 @@
+Propagation for inline recursive combinators
diff --git a/basis/compiler/tree/propagation/simple/summary.txt b/basis/compiler/tree/propagation/simple/summary.txt
new file mode 100644 (file)
index 0000000..25e631f
--- /dev/null
@@ -0,0 +1 @@
+Propagation for straight-line code
diff --git a/basis/compiler/tree/propagation/slots/summary.txt b/basis/compiler/tree/propagation/slots/summary.txt
new file mode 100644 (file)
index 0000000..b47a4b5
--- /dev/null
@@ -0,0 +1 @@
+Propagation for read-only tuple slots and array lengths
index b1f94060924f8c4e054143132d185f478c13dc3f..d548d58bc6f9e8d19615fccb9841bd7873fbe7d9 100644 (file)
@@ -87,7 +87,7 @@ compiler.tree.combinators ;
     ] contains-node?
 ] unit-test
 
-: blah f ;
+: blah ( -- value ) f ;
 
 DEFER: a
 
diff --git a/basis/compiler/tree/recursive/summary.txt b/basis/compiler/tree/recursive/summary.txt
new file mode 100644 (file)
index 0000000..202a3d1
--- /dev/null
@@ -0,0 +1 @@
+Analysis of inline recursive combinators and loop detection
diff --git a/basis/compiler/tree/tuple-unboxing/summary.txt b/basis/compiler/tree/tuple-unboxing/summary.txt
new file mode 100644 (file)
index 0000000..3f13c95
--- /dev/null
@@ -0,0 +1 @@
+Tuple unboxing
diff --git a/basis/compiler/utilities/summary.txt b/basis/compiler/utilities/summary.txt
new file mode 100644 (file)
index 0000000..be0857c
--- /dev/null
@@ -0,0 +1 @@
+Utilities used by high-level IR optimizations
index 67248474d3be475be230cc0ca54d595d65ae1feb..29cbe96d69164c760fa8d86eea9625bff58ac759 100644 (file)
@@ -69,11 +69,11 @@ ERROR: index-too-big n ;
 : omega-k-in-table? ( lzw -- ? )
     [ omega-k>> ] [ table>> ] bi key? ;
 
-ERROR: not-in-table ;
+ERROR: not-in-table value ;
 
 : write-output ( lzw -- )
     [
-        [ omega>> ] [ table>> ] bi at* [ not-in-table ] unless
+        [ omega>> ] [ table>> ] bi ?at [ not-in-table ] unless
     ] [
         [ lzw-bit-width-compress ]
         [ output>> write-bits ] bi
diff --git a/basis/compression/lzw/summary.txt b/basis/compression/lzw/summary.txt
new file mode 100644 (file)
index 0000000..bbc8c67
--- /dev/null
@@ -0,0 +1 @@
+LZW compression and decompression
diff --git a/basis/compression/zlib/ffi/summary.txt b/basis/compression/zlib/ffi/summary.txt
new file mode 100644 (file)
index 0000000..0047076
--- /dev/null
@@ -0,0 +1 @@
+Low-level FFI bindings to ZLIB compression library
diff --git a/basis/compression/zlib/summary.txt b/basis/compression/zlib/summary.txt
new file mode 100644 (file)
index 0000000..e7caf47
--- /dev/null
@@ -0,0 +1 @@
+Wrapper ZLIB compression library
diff --git a/basis/concurrency/flags/summary.txt b/basis/concurrency/flags/summary.txt
new file mode 100644 (file)
index 0000000..f8981c8
--- /dev/null
@@ -0,0 +1 @@
+Flags for cross-thread notification of conditions
diff --git a/basis/concurrency/mailboxes/summary.txt b/basis/concurrency/mailboxes/summary.txt
new file mode 100644 (file)
index 0000000..2a228eb
--- /dev/null
@@ -0,0 +1 @@
+Mailboxes for inter-thread message passing
diff --git a/basis/constructors/summary.txt b/basis/constructors/summary.txt
new file mode 100644 (file)
index 0000000..6f135bd
--- /dev/null
@@ -0,0 +1 @@
+Utility to simplify tuple constructors
diff --git a/basis/core-foundation/arrays/summary.txt b/basis/core-foundation/arrays/summary.txt
new file mode 100644 (file)
index 0000000..5ac5a7e
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for CFArray data type
diff --git a/basis/core-foundation/bundles/summary.txt b/basis/core-foundation/bundles/summary.txt
new file mode 100644 (file)
index 0000000..911084a
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for CFBundle data type
index ec83ba7a8bd5f5f7ba04d4296d09681d7a2ed5e0..40269ae3be62a10662167057880bb3c8a00f7ccd 100644 (file)
@@ -6,7 +6,7 @@ IN: core-foundation
 TYPEDEF: void* CFTypeRef
 
 TYPEDEF: void* CFAllocatorRef
-: kCFAllocatorDefault f ; inline
+CONSTANT: kCFAllocatorDefault f
 
 TYPEDEF: bool Boolean
 TYPEDEF: long CFIndex
index f4d2babca710d3a5dd1e4b627c902bd25b20f54f..fb5ecaa0431bec02cc414b339c3b5dd58e919edf 100644 (file)
@@ -10,28 +10,28 @@ TYPEDEF: void* CFNumberRef
 TYPEDEF: void* CFSetRef
 
 TYPEDEF: int CFNumberType
-: kCFNumberSInt8Type 1 ; inline
-: kCFNumberSInt16Type 2 ; inline
-: kCFNumberSInt32Type 3 ; inline
-: kCFNumberSInt64Type 4 ; inline
-: kCFNumberFloat32Type 5 ; inline
-: kCFNumberFloat64Type 6 ; inline
-: kCFNumberCharType 7 ; inline
-: kCFNumberShortType 8 ; inline
-: kCFNumberIntType 9 ; inline
-: kCFNumberLongType 10 ; inline
-: kCFNumberLongLongType 11 ; inline
-: kCFNumberFloatType 12 ; inline
-: kCFNumberDoubleType 13 ; inline
-: kCFNumberCFIndexType 14 ; inline
-: kCFNumberNSIntegerType 15 ; inline
-: kCFNumberCGFloatType 16 ; inline
-: kCFNumberMaxType 16 ; inline
+CONSTANT: kCFNumberSInt8Type 1
+CONSTANT: kCFNumberSInt16Type 2
+CONSTANT: kCFNumberSInt32Type 3
+CONSTANT: kCFNumberSInt64Type 4
+CONSTANT: kCFNumberFloat32Type 5
+CONSTANT: kCFNumberFloat64Type 6
+CONSTANT: kCFNumberCharType 7
+CONSTANT: kCFNumberShortType 8
+CONSTANT: kCFNumberIntType 9
+CONSTANT: kCFNumberLongType 10
+CONSTANT: kCFNumberLongLongType 11
+CONSTANT: kCFNumberFloatType 12
+CONSTANT: kCFNumberDoubleType 13
+CONSTANT: kCFNumberCFIndexType 14
+CONSTANT: kCFNumberNSIntegerType 15
+CONSTANT: kCFNumberCGFloatType 16
+CONSTANT: kCFNumberMaxType 16
 
 TYPEDEF: int CFPropertyListMutabilityOptions
-: kCFPropertyListImmutable                  0 ; inline
-: kCFPropertyListMutableContainers          1 ; inline
-: kCFPropertyListMutableContainersAndLeaves 2 ; inline
+CONSTANT: kCFPropertyListImmutable                  0
+CONSTANT: kCFPropertyListMutableContainers          1
+CONSTANT: kCFPropertyListMutableContainersAndLeaves 2
 
 FUNCTION: CFNumberRef CFNumberCreate ( CFAllocatorRef allocator, CFNumberType theType, void* valuePtr ) ;
 
diff --git a/basis/core-foundation/data/summary.txt b/basis/core-foundation/data/summary.txt
new file mode 100644 (file)
index 0000000..74b0244
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for various CF data types
index 29c42196785d49cc62cf3e8902c689f3e2bbf54a..c9fe3131b148271497b9ffe60f69c31272bb1736 100644 (file)
@@ -15,8 +15,8 @@ FUNCTION: CFFileDescriptorRef CFFileDescriptorCreate (
     CFFileDescriptorContext* context
 ) ;
 
-: kCFFileDescriptorReadCallBack 1 ; inline
-: kCFFileDescriptorWriteCallBack 2 ; inline
+CONSTANT: kCFFileDescriptorReadCallBack 1
+CONSTANT: kCFFileDescriptorWriteCallBack 2
    
 FUNCTION: void CFFileDescriptorEnableCallBacks (
     CFFileDescriptorRef f,
diff --git a/basis/core-foundation/file-descriptors/summary.txt b/basis/core-foundation/file-descriptors/summary.txt
new file mode 100644 (file)
index 0000000..ac2afab
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for CFFileDescriptor
index b0c299a83178ec477413cf7a23c496d38d02b173..06b9c6407bddf3647bc802296d132a6e3e76e76b 100644 (file)
@@ -9,17 +9,17 @@ core-foundation core-foundation.run-loop core-foundation.strings
 core-foundation.time ;
 IN: core-foundation.fsevents
 
-: kFSEventStreamCreateFlagUseCFTypes 2 ; inline
-: kFSEventStreamCreateFlagWatchRoot 4 ; inline
-
-: kFSEventStreamEventFlagMustScanSubDirs 1 ; inline
-: kFSEventStreamEventFlagUserDropped 2 ; inline
-: kFSEventStreamEventFlagKernelDropped 4 ; inline
-: kFSEventStreamEventFlagEventIdsWrapped 8 ; inline
-: kFSEventStreamEventFlagHistoryDone 16 ; inline
-: kFSEventStreamEventFlagRootChanged 32 ; inline
-: kFSEventStreamEventFlagMount 64 ; inline
-: kFSEventStreamEventFlagUnmount 128 ; inline
+CONSTANT: kFSEventStreamCreateFlagUseCFTypes 2
+CONSTANT: kFSEventStreamCreateFlagWatchRoot 4
+
+CONSTANT: kFSEventStreamEventFlagMustScanSubDirs 1
+CONSTANT: kFSEventStreamEventFlagUserDropped 2
+CONSTANT: kFSEventStreamEventFlagKernelDropped 4
+CONSTANT: kFSEventStreamEventFlagEventIdsWrapped 8
+CONSTANT: kFSEventStreamEventFlagHistoryDone 16
+CONSTANT: kFSEventStreamEventFlagRootChanged 32
+CONSTANT: kFSEventStreamEventFlagMount 64
+CONSTANT: kFSEventStreamEventFlagUnmount 128
 
 TYPEDEF: int FSEventStreamCreateFlags
 TYPEDEF: int FSEventStreamEventFlags
@@ -36,7 +36,7 @@ C-STRUCT: FSEventStreamContext
 ! callback(FSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]);
 TYPEDEF: void* FSEventStreamCallback
 
-: FSEventStreamEventIdSinceNow HEX: FFFFFFFFFFFFFFFF ; inline
+CONSTANT: FSEventStreamEventIdSinceNow HEX: FFFFFFFFFFFFFFFF
 
 FUNCTION: FSEventStreamRef FSEventStreamCreate (
     CFAllocatorRef           allocator,
diff --git a/basis/core-foundation/fsevents/summary.txt b/basis/core-foundation/fsevents/summary.txt
new file mode 100644 (file)
index 0000000..17ab7f4
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for FSEventStream
index 4b98e9a410c88e6961de6c6a57cfcfb3ad1a8c15..8bdce2ec3794356dc8f30d660db470667b4cb2f7 100644 (file)
@@ -7,10 +7,10 @@ core-foundation.file-descriptors core-foundation.timers
 core-foundation.time ;
 IN: core-foundation.run-loop
 
-: kCFRunLoopRunFinished 1 ; inline
-: kCFRunLoopRunStopped 2 ; inline
-: kCFRunLoopRunTimedOut 3 ; inline
-: kCFRunLoopRunHandledSource 4 ; inline
+CONSTANT: kCFRunLoopRunFinished 1
+CONSTANT: kCFRunLoopRunStopped 2
+CONSTANT: kCFRunLoopRunTimedOut 3
+CONSTANT: kCFRunLoopRunHandledSource 4
 
 TYPEDEF: void* CFRunLoopRef
 TYPEDEF: void* CFRunLoopSourceRef
index c3a969a32561d8a0a5a11fba39764a2133288604..50c17dc6fd03e6fc0e9eff86852df9b3af037a28 100644 (file)
@@ -7,20 +7,20 @@ IN: core-foundation.strings
 TYPEDEF: void* CFStringRef
 
 TYPEDEF: int CFStringEncoding
-: kCFStringEncodingMacRoman HEX: 0 ;
-: kCFStringEncodingWindowsLatin1 HEX: 0500 ;
-: kCFStringEncodingISOLatin1 HEX: 0201 ;
-: kCFStringEncodingNextStepLatin HEX: 0B01 ;
-: kCFStringEncodingASCII HEX: 0600 ;
-: kCFStringEncodingUnicode HEX: 0100 ;
-: kCFStringEncodingUTF8 HEX: 08000100 ;
-: kCFStringEncodingNonLossyASCII HEX: 0BFF ;
-: kCFStringEncodingUTF16 HEX: 0100 ;
-: kCFStringEncodingUTF16BE HEX: 10000100 ;
-: kCFStringEncodingUTF16LE HEX: 14000100 ;
-: kCFStringEncodingUTF32 HEX: 0c000100 ;
-: kCFStringEncodingUTF32BE HEX: 18000100 ;
-: kCFStringEncodingUTF32LE HEX: 1c000100 ;
+CONSTANT: kCFStringEncodingMacRoman HEX: 0
+CONSTANT: kCFStringEncodingWindowsLatin1 HEX: 0500
+CONSTANT: kCFStringEncodingISOLatin1 HEX: 0201
+CONSTANT: kCFStringEncodingNextStepLatin HEX: 0B01
+CONSTANT: kCFStringEncodingASCII HEX: 0600
+CONSTANT: kCFStringEncodingUnicode HEX: 0100
+CONSTANT: kCFStringEncodingUTF8 HEX: 08000100
+CONSTANT: kCFStringEncodingNonLossyASCII HEX: 0BFF
+CONSTANT: kCFStringEncodingUTF16 HEX: 0100
+CONSTANT: kCFStringEncodingUTF16BE HEX: 10000100
+CONSTANT: kCFStringEncodingUTF16LE HEX: 14000100
+CONSTANT: kCFStringEncodingUTF32 HEX: 0c000100
+CONSTANT: kCFStringEncodingUTF32BE HEX: 18000100
+CONSTANT: kCFStringEncodingUTF32LE HEX: 1c000100
 
 FUNCTION: CFStringRef CFStringCreateWithBytes (
     CFAllocatorRef alloc,
diff --git a/basis/core-foundation/strings/summary.txt b/basis/core-foundation/strings/summary.txt
new file mode 100644 (file)
index 0000000..4242691
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for CFString
diff --git a/basis/core-foundation/time/summary.txt b/basis/core-foundation/time/summary.txt
new file mode 100644 (file)
index 0000000..c8f1f3b
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for CF time-related data types
diff --git a/basis/core-foundation/timers/summary.txt b/basis/core-foundation/timers/summary.txt
new file mode 100644 (file)
index 0000000..c9b9584
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for CFTimer
diff --git a/basis/core-foundation/urls/summary.txt b/basis/core-foundation/urls/summary.txt
new file mode 100644 (file)
index 0000000..2ae52e5
--- /dev/null
@@ -0,0 +1 @@
+Wrapper for CFURL
index 9f9d3a67cb57a1cd31dce7bc2ba8a20c8ce98508..7ffef498b64e7cbee26d7492c18e4ea5b5546e0e 100644 (file)
@@ -4,7 +4,7 @@ USING: alien.syntax kernel core-foundation.strings
 core-foundation ;
 IN: core-foundation.urls
 
-: kCFURLPOSIXPathStyle 0 ; inline
+CONSTANT: kCFURLPOSIXPathStyle 0
 
 TYPEDEF: void* CFURLRef
 
index fd9bab48355246db6ba547a21f7bab6f4a763429..cf6517b664739cb052ef723481ba0228bb5f5630 100644 (file)
@@ -6,5 +6,5 @@ IN: bootstrap.ppc
 : c-area-size ( -- n ) 10 bootstrap-cells ;
 : lr-save ( -- n ) bootstrap-cell ;
 
-<< "resource:basis/cpu/ppc/bootstrap.factor" parse-file parsed >>
+<< "vocab:cpu/ppc/bootstrap.factor" parse-file parsed >>
 call
diff --git a/basis/cpu/ppc/linux/summary.txt b/basis/cpu/ppc/linux/summary.txt
new file mode 100644 (file)
index 0000000..a35c037
--- /dev/null
@@ -0,0 +1 @@
+Linux/PPC ABI support
index f2ddc42688cdc7d667ec942471e312709781c2ff..0c383c2fb08f77c04665d7f7ccac9c4374a4687f 100644 (file)
@@ -6,5 +6,5 @@ IN: bootstrap.ppc
 : c-area-size ( -- n ) 14 bootstrap-cells ;
 : lr-save ( -- n ) 2 bootstrap-cells ;
 
-<< "resource:basis/cpu/ppc/bootstrap.factor" parse-file parsed >>
+<< "vocab:cpu/ppc/bootstrap.factor" parse-file parsed >>
 call
diff --git a/basis/cpu/ppc/macosx/summary.txt b/basis/cpu/ppc/macosx/summary.txt
new file mode 100644 (file)
index 0000000..52ace04
--- /dev/null
@@ -0,0 +1 @@
+Mac OS X/PPC ABI support
index f245bcb7e12355364e0ec1ad964239a58e669711..8b6b4fbb11cc356e09426134ce71c28ad975df78 100644 (file)
@@ -27,8 +27,8 @@ M: ppc machine-registers
         { double-float-regs T{ range f 0 29 1 } }
     } ;
 
-: scratch-reg 28 ; inline
-: fp-scratch-reg 30 ; inline
+CONSTANT: scratch-reg 28
+CONSTANT: fp-scratch-reg 30
 
 M: ppc two-operand? f ;
 
@@ -40,8 +40,8 @@ M: ppc %load-reference ( reg obj -- )
 M: ppc %alien-global ( register symbol dll -- )
     [ 0 swap LOAD32 ] 2dip rc-absolute-ppc-2/2 rel-dlsym ;
 
-: ds-reg 29 ; inline
-: rs-reg 30 ; inline
+CONSTANT: ds-reg 29
+CONSTANT: rs-reg 30
 
 GENERIC: loc-reg ( loc -- reg )
 
index f29dec128ca8e82463dbfe2d04d5fbf0a68a47b3..5d88f699b8ab2270829c853f41b022a614cdb8ce 100644 (file)
@@ -30,5 +30,5 @@ IN: bootstrap.x86
     (JMP) drop
 ] rc-relative rt-primitive 1 jit-primitive jit-define
 
-<< "resource:basis/cpu/x86/bootstrap.factor" parse-file parsed >>
+<< "vocab:cpu/x86/bootstrap.factor" parse-file parsed >>
 call
diff --git a/basis/cpu/x86/32/summary.txt b/basis/cpu/x86/32/summary.txt
new file mode 100644 (file)
index 0000000..09e329f
--- /dev/null
@@ -0,0 +1 @@
+32-bit x86 code generator
index efa3de3065a681933ab059358f3903f59d5075e7..ddf5791009bceab67485523b644f7dfe8694af1d 100644 (file)
@@ -30,5 +30,5 @@ IN: bootstrap.x86
     temp1 JMP                                   ! go
 ] rc-absolute-cell rt-primitive 1 rex-length + jit-primitive jit-define
 
-<< "resource:basis/cpu/x86/bootstrap.factor" parse-file parsed >>
+<< "vocab:cpu/x86/bootstrap.factor" parse-file parsed >>
 call
index 20a953b6d509969fd0cf424fc3dc1832d501aac7..e48a20a9de9fc7a834381c439a19bd7abf0fbbda 100644 (file)
@@ -7,5 +7,5 @@ IN: bootstrap.x86
 : stack-frame-size ( -- n ) 4 bootstrap-cells ;
 : arg ( -- reg ) RDI ;
 
-<< "resource:basis/cpu/x86/64/bootstrap.factor" parse-file parsed >>
+<< "vocab:cpu/x86/64/bootstrap.factor" parse-file parsed >>
 call
diff --git a/basis/cpu/x86/64/unix/summary.txt b/basis/cpu/x86/64/unix/summary.txt
new file mode 100644 (file)
index 0000000..8689936
--- /dev/null
@@ -0,0 +1 @@
+64-bit x86 Unix ABI support
index 3accca400f84f97108e5648be2ea30d6b41fa8f2..ff15ef27afc48bb096334f31c915af4bf3f040d5 100644 (file)
@@ -7,5 +7,5 @@ IN: bootstrap.x86
 : stack-frame-size ( -- n ) 8 bootstrap-cells ;
 : arg ( -- reg ) RCX ;
 
-<< "resource:basis/cpu/x86/64/bootstrap.factor" parse-file parsed >>
+<< "vocab:cpu/x86/64/bootstrap.factor" parse-file parsed >>
 call
diff --git a/basis/cpu/x86/64/winnt/summary.txt b/basis/cpu/x86/64/winnt/summary.txt
new file mode 100644 (file)
index 0000000..7f66427
--- /dev/null
@@ -0,0 +1 @@
+64-bit x86 Windows ABI support
diff --git a/basis/cpu/x86/assembler/summary.txt b/basis/cpu/x86/assembler/summary.txt
new file mode 100644 (file)
index 0000000..0861fbb
--- /dev/null
@@ -0,0 +1 @@
+x86 assembler
diff --git a/basis/cpu/x86/assembler/syntax/summary.txt b/basis/cpu/x86/assembler/syntax/summary.txt
new file mode 100644 (file)
index 0000000..82e436d
--- /dev/null
@@ -0,0 +1 @@
+Parsing words used by x86 assembler
index 0b18044f2b8002a57eccba0b257c47f5c2cab671..96b72b8865a224f563345dbbbe218c4e1bd4f5ae 100644 (file)
@@ -2,17 +2,17 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays assocs classes continuations destructors kernel math
 namespaces sequences classes.tuple words strings
-tools.walker accessors combinators fry ;
+tools.walker accessors combinators fry db.errors ;
 IN: db
 
-<PRIVATE
-
 TUPLE: db-connection
     handle
     insert-statements
     update-statements
     delete-statements ;
 
+<PRIVATE
+
 : new-db-connection ( class -- obj )
     new
         H{ } clone >>insert-statements
@@ -23,6 +23,7 @@ PRIVATE>
 
 GENERIC: db-open ( db -- db-connection )
 HOOK: db-close db-connection ( handle -- )
+HOOK: parse-db-error db-connection ( error -- error' )
 
 : dispose-statements ( assoc -- ) values dispose-each ;
 
@@ -77,7 +78,11 @@ GENERIC: bind-tuple ( tuple statement -- )
 GENERIC: execute-statement* ( statement type -- )
 
 M: object execute-statement* ( statement type -- )
-    drop query-results dispose ;
+    '[
+        _ _ drop query-results dispose
+    ] [
+        parse-db-error rethrow
+    ] recover ;
 
 : execute-one-statement ( statement -- )
     dup type>> execute-statement* ;
index da6301639f143a3253993cf7e1c15c1190f8adf9..5239086f939a2a298784413788c508f5a0f3db29 100644 (file)
@@ -1,10 +1,54 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel ;
+USING: accessors kernel continuations fry words ;
 IN: db.errors
 
 ERROR: db-error ;
-ERROR: sql-error ;
+ERROR: sql-error location ;
 
-ERROR: table-exists ;
 ERROR: bad-schema ;
+
+ERROR: sql-unknown-error < sql-error message ;
+: <sql-unknown-error> ( message -- error )
+    \ sql-unknown-error new
+        swap >>message ;
+
+ERROR: sql-table-exists < sql-error table ;
+: <sql-table-exists> ( table -- error )
+    \ sql-table-exists new
+        swap >>table ;
+
+ERROR: sql-table-missing < sql-error table ;
+: <sql-table-missing> ( table -- error )
+    \ sql-table-missing new
+        swap >>table ;
+
+ERROR: sql-syntax-error < sql-error message ;
+: <sql-syntax-error> ( message -- error )
+    \ sql-syntax-error new
+        swap >>message ;
+
+ERROR: sql-function-exists < sql-error message ;
+: <sql-function-exists> ( message -- error )
+    \ sql-function-exists new
+        swap >>message ;
+
+ERROR: sql-function-missing < sql-error message ;
+: <sql-function-missing> ( message -- error )
+    \ sql-function-missing new
+        swap >>message ;
+
+: ignore-error ( quot word -- )
+    '[ dup _ execute [ drop ] [ rethrow ] if ] recover ; inline
+
+: ignore-table-exists ( quot -- )
+    \ sql-table-exists? ignore-error ; inline
+
+: ignore-table-missing ( quot -- )
+    \ sql-table-missing? ignore-error ; inline
+
+: ignore-function-exists ( quot -- )
+    \ sql-function-exists? ignore-error ; inline
+
+: ignore-function-missing ( quot -- )
+    \ sql-function-missing? ignore-error ; inline
diff --git a/basis/db/errors/postgresql/authors.txt b/basis/db/errors/postgresql/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/db/errors/postgresql/postgresql-tests.factor b/basis/db/errors/postgresql/postgresql-tests.factor
new file mode 100644 (file)
index 0000000..f666803
--- /dev/null
@@ -0,0 +1,32 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors combinators.short-circuit db db.errors
+db.errors.postgresql db.postgresql io.files.unique kernel namespaces
+tools.test db.tester continuations ;
+IN: db.errors.postgresql.tests
+
+[
+
+    [ "drop table foo;" sql-command ] ignore-errors
+    [ "drop table ship;" sql-command ] ignore-errors
+
+    [
+        "insert into foo (id) values('1');" sql-command
+    ] [
+        { [ sql-table-missing? ] [ table>> "foo" = ] } 1&&
+    ] must-fail-with
+
+    [
+        "create table ship(id integer);" sql-command
+        "create table ship(id integer);" sql-command
+    ] [
+        { [ sql-table-exists? ] [ table>> "ship" = ] } 1&&
+    ] must-fail-with
+    
+    [
+        "create table foo(id) lol;" sql-command
+    ] [
+        sql-syntax-error?
+    ] must-fail-with
+
+] test-postgresql
diff --git a/basis/db/errors/postgresql/postgresql.factor b/basis/db/errors/postgresql/postgresql.factor
new file mode 100644 (file)
index 0000000..02b43ec
--- /dev/null
@@ -0,0 +1,53 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel db.errors peg.ebnf strings sequences math
+combinators.short-circuit accessors math.parser quoting ;
+IN: db.errors.postgresql
+
+EBNF: parse-postgresql-sql-error
+
+Error = "ERROR:" [ ]+
+
+TableError =
+    Error ("relation "|"table ")(!(" already exists").)+:table " already exists"
+        => [[ table >string unquote <sql-table-exists> ]]
+    | Error ("relation "|"table ")(!(" does not exist").)+:table " does not exist"
+        => [[ table >string unquote <sql-table-missing> ]]
+
+FunctionError =
+    Error "function" (!(" already exists").)+:table " already exists"
+        => [[ table >string <sql-function-exists> ]]
+    | Error "function" (!(" does not exist").)+:table " does not exist"
+        => [[ table >string <sql-function-missing> ]]
+
+SyntaxError =
+    Error "syntax error at end of input":error
+        => [[ error >string <sql-syntax-error> ]]
+    | Error "syntax error at or near " .+:syntaxerror
+        => [[ syntaxerror >string unquote <sql-syntax-error> ]]
+
+UnknownError = .* => [[ >string <sql-unknown-error> ]]
+
+PostgresqlSqlError = (TableError | FunctionError | SyntaxError | UnknownError) 
+
+;EBNF
+
+
+ERROR: parse-postgresql-location column line text ;
+C: <parse-postgresql-location> parse-postgresql-location
+
+EBNF: parse-postgresql-line-error
+
+Line = "LINE " [0-9]+:line ": " .+:sql
+    => [[ f line >string string>number sql >string <parse-postgresql-location> ]] 
+
+;EBNF
+
+:: set-caret-position ( error caret-line -- error )
+    caret-line length
+    error line>> number>string length "LINE : " length +
+    - [ error ] dip >>column ;
+
+: postgresql-location ( line column -- obj )
+    [ parse-postgresql-line-error ] dip
+    set-caret-position ;
diff --git a/basis/db/errors/sqlite/authors.txt b/basis/db/errors/sqlite/authors.txt
new file mode 100644 (file)
index 0000000..b4bd0e7
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
\ No newline at end of file
diff --git a/basis/db/errors/sqlite/sqlite-tests.factor b/basis/db/errors/sqlite/sqlite-tests.factor
new file mode 100644 (file)
index 0000000..68ae55f
--- /dev/null
@@ -0,0 +1,26 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors combinators.short-circuit db db.errors
+db.errors.sqlite db.sqlite io.files.unique kernel namespaces
+tools.test ;
+IN: db.errors.sqlite.tests
+
+: sqlite-error-test-db-path ( -- path )
+    "sqlite" "error-test" make-unique-file ;
+
+sqlite-error-test-db-path <sqlite-db> [
+
+    [
+        "insert into foo (id) values('1');" sql-command
+    ] [
+        { [ sql-table-missing? ] [ table>> "foo" = ] } 1&&
+    ] must-fail-with
+    
+    [
+        "create table foo(id);" sql-command
+        "create table foo(id);" sql-command
+    ] [
+        { [ sql-table-exists? ] [ table>> "foo" = ] } 1&&
+    ] must-fail-with
+
+] with-db
\ No newline at end of file
diff --git a/basis/db/errors/sqlite/sqlite.factor b/basis/db/errors/sqlite/sqlite.factor
new file mode 100644 (file)
index 0000000..c247a36
--- /dev/null
@@ -0,0 +1,25 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors combinators db kernel sequences peg.ebnf
+strings db.errors ;
+IN: db.errors.sqlite
+
+ERROR: unparsed-sqlite-error error ;
+
+SINGLETONS: table-exists table-missing ;
+
+: sqlite-table-error ( table message -- error )
+    {
+        { table-exists [ <sql-table-exists> ] }
+    } case ;
+
+EBNF: parse-sqlite-sql-error
+
+TableMessage = " already exists" => [[ table-exists ]]
+
+SqliteError =
+    "table " (!(TableMessage).)+:table TableMessage:message
+      => [[ table >string message sqlite-table-error ]]
+    | "no such table: " .+:table
+      => [[ table >string <sql-table-missing> ]]
+;EBNF
diff --git a/basis/db/errors/summary.txt b/basis/db/errors/summary.txt
new file mode 100644 (file)
index 0000000..1cd1021
--- /dev/null
@@ -0,0 +1 @@
+Errors thrown by database library
diff --git a/basis/db/pools/summary.txt b/basis/db/pools/summary.txt
new file mode 100644 (file)
index 0000000..d1f51c4
--- /dev/null
@@ -0,0 +1 @@
+Database connection pooling
index cf6dc903f10081b3109577c2e13f6904c3df8e5d..266337b8c8fbf0f9b85ff0cb8752d6cfd18b3064 100644 (file)
@@ -1,20 +1,13 @@
 USING: kernel db.postgresql alien continuations io classes
 prettyprint sequences namespaces tools.test db db.private
-db.tuples db.types unicode.case accessors system ;
+db.tuples db.types unicode.case accessors system db.tester ;
 IN: db.postgresql.tests
 
-: test-db ( -- postgresql-db )
-    <postgresql-db>
-        "localhost" >>host
-        "postgres" >>username
-        "thepasswordistrust" >>password
-        "factor-test" >>database ;
-
 os windows? cpu x86.64? and [
-    [ ] [ test-db [ ] with-db ] unit-test
+    [ ] [ postgresql-test-db [ ] with-db ] unit-test
 
     [ ] [
-        test-db [
+        postgresql-test-db [
             [ "drop table person;" sql-command ] ignore-errors
             "create table person (name varchar(30), country varchar(30));"
                 sql-command
@@ -30,7 +23,7 @@ os windows? cpu x86.64? and [
             { "Jane" "New Zealand" }
         }
     ] [
-        test-db [
+        postgresql-test-db [
             "select * from person" sql-query
         ] with-db
     ] unit-test
@@ -40,11 +33,11 @@ os windows? cpu x86.64? and [
             { "John" "America" }
             { "Jane" "New Zealand" }
         }
-    ] [ test-db [ "select * from person" sql-query ] with-db ] unit-test
+    ] [ postgresql-test-db [ "select * from person" sql-query ] with-db ] unit-test
 
     [
     ] [
-        test-db [
+        postgresql-test-db [
             "insert into person(name, country) values('Jimmy', 'Canada')"
             sql-command
         ] with-db
@@ -56,10 +49,10 @@ os windows? cpu x86.64? and [
             { "Jane" "New Zealand" }
             { "Jimmy" "Canada" }
         }
-    ] [ test-db [ "select * from person" sql-query ] with-db ] unit-test
+    ] [ postgresql-test-db [ "select * from person" sql-query ] with-db ] unit-test
 
     [
-        test-db [
+        postgresql-test-db [
             [
                 "insert into person(name, country) values('Jose', 'Mexico')" sql-command
                 "insert into person(name, country) values('Jose', 'Mexico')" sql-command
@@ -69,14 +62,14 @@ os windows? cpu x86.64? and [
     ] must-fail
 
     [ 3 ] [
-        test-db [
+        postgresql-test-db [
             "select * from person" sql-query length
         ] with-db
     ] unit-test
 
     [
     ] [
-        test-db [
+        postgresql-test-db [
             [
                 "insert into person(name, country) values('Jose', 'Mexico')"
                 sql-command
@@ -87,7 +80,7 @@ os windows? cpu x86.64? and [
     ] unit-test
 
     [ 5 ] [
-        test-db [
+        postgresql-test-db [
             "select * from person" sql-query length
         ] with-db
     ] unit-test
index 1f55dcf769669e587993cb6a8345d4f28be32552..9e51f41ff1de63949fe0747084cb83d012aed090 100644 (file)
@@ -5,8 +5,8 @@ kernel math math.parser namespaces make prettyprint quotations
 sequences debugger db db.postgresql.lib db.postgresql.ffi
 db.tuples db.types tools.annotations math.ranges
 combinators classes locals words tools.walker db.private
-nmake accessors random db.queries destructors db.tuples.private ;
-USE: tools.walker
+nmake accessors random db.queries destructors db.tuples.private
+db.postgresql db.errors.postgresql splitting ;
 IN: db.postgresql
 
 TUPLE: postgresql-db host port pgopts pgtty database username password ;
@@ -280,3 +280,14 @@ M: postgresql-db-connection compound ( string object -- string' )
         { "references" [ >reference-string ] }
         [ drop no-compound-found ]
     } case ;
+
+M: postgresql-db-connection parse-db-error
+    "\n" split dup length {
+        { 1 [ first parse-postgresql-sql-error ] }
+        { 3 [
+                first3
+                [ parse-postgresql-sql-error ] 2dip
+                postgresql-location >>location
+        ] }
+    } case ;
+
diff --git a/basis/db/postgresql/summary.txt b/basis/db/postgresql/summary.txt
new file mode 100644 (file)
index 0000000..f0e4946
--- /dev/null
@@ -0,0 +1 @@
+PostgreSQL database connector
diff --git a/basis/db/queries/summary.txt b/basis/db/queries/summary.txt
new file mode 100644 (file)
index 0000000..b5f395b
--- /dev/null
@@ -0,0 +1 @@
+Database queries
index b1bc9aa1a218933a4b93e79db6128d29c5e630df..3565b098564b95c150e65c7260f244c84ef6ab28 100644 (file)
@@ -5,19 +5,23 @@ namespaces sequences db.sqlite.ffi db combinators
 continuations db.types calendar.format serialize
 io.streams.byte-array byte-arrays io.encodings.binary
 io.backend db.errors present urls io.encodings.utf8
-io.encodings.string accessors shuffle io prettyprint
-db.private ;
+io.encodings.string accessors shuffle io db.private ;
 IN: db.sqlite.lib
 
 ERROR: sqlite-error < db-error n string ;
 ERROR: sqlite-sql-error < sql-error n string ;
 
+: <sqlite-sql-error> ( n string -- error )
+    \ sqlite-sql-error new
+        swap >>string
+        swap >>n ;
+
 : throw-sqlite-error ( n -- * )
     dup sqlite-error-messages nth sqlite-error ;
 
 : sqlite-statement-error ( -- * )
     SQLITE_ERROR
-    db-connection get handle>> sqlite3_errmsg sqlite-sql-error ;
+    db-connection get handle>> sqlite3_errmsg <sqlite-sql-error> throw ;
 
 : sqlite-check-result ( n -- )
     {
@@ -125,8 +129,7 @@ ERROR: sqlite-sql-error < sql-error n string ;
     ] if* (sqlite-bind-type) ;
 
 : sqlite-finalize ( handle -- ) sqlite3_finalize sqlite-check-result ;
-: sqlite-reset ( handle -- )
-"resetting: " write dup . sqlite3_reset sqlite-check-result ;
+: sqlite-reset ( handle -- ) sqlite3_reset sqlite-check-result ;
 : sqlite-clear-bindings ( handle -- )
     sqlite3_clear_bindings sqlite-check-result ;
 : sqlite-#columns ( query -- int ) sqlite3_column_count ;
index 5ad4b0c889fc95ab9a9337a276b5035777779403..b6e756a3dd0e2bbbf1511201e920c14d6cc34116 100644 (file)
@@ -1,6 +1,7 @@
 USING: io io.files io.files.temp io.directories io.launcher
 kernel namespaces prettyprint tools.test db.sqlite db sequences
-continuations db.types db.tuples unicode.case ;
+continuations db.types db.tuples unicode.case accessors arrays
+sorting ;
 IN: db.sqlite.tests
 
 : db-path ( -- path ) "test.db" temp-file ;
@@ -74,8 +75,9 @@ IN: db.sqlite.tests
     ] with-db
 ] unit-test
 
+[ \ swap ensure-table ] must-fail
+
 ! You don't need a primary key
-USING: accessors arrays sorting ;
 TUPLE: things one two ;
 
 things "THINGS" {
@@ -115,18 +117,14 @@ hi "HELLO" {
         1 <foo> insert-tuple
         f <foo> select-tuple
         1 1 <hi> insert-tuple
-        f <hi> select-tuple
+        f <hi> select-tuple
         hi drop-table
         foo drop-table
     ] with-db
 ] unit-test
 
-[ ] [
-    test.db [
-        hi create-table
-        hi drop-table
-    ] with-db
-] unit-test
+
+! Test SQLite triggers
 
 TUPLE: show id ;
 TUPLE: user username data ;
@@ -142,12 +140,12 @@ show "SHOW" {
 } define-persistent
 
 watch "WATCH" {
-    { "user" "USER" TEXT +not-null+
-        { +foreign-id+ user "USERNAME" } +user-assigned-id+ }
-    { "show" "SHOW" BIG-INTEGER +not-null+
-        { +foreign-id+ show "ID" } +user-assigned-id+ }
+    { "user" "USER" TEXT +not-null+ +user-assigned-id+
+        { +foreign-id+ user "USERNAME" } }
+    { "show" "SHOW" BIG-INTEGER +not-null+ +user-assigned-id+
+        { +foreign-id+ show "ID" } }
 } define-persistent
-
+    
 [ T{ user { username "littledan" } { data "foo" } } ] [
     test.db [
         user create-table
@@ -158,10 +156,9 @@ watch "WATCH" {
         show new insert-tuple
         show new select-tuple
         "littledan" f user boa select-tuple
+        [ id>> ] [ username>> ] bi*
         watch boa insert-tuple
         watch new select-tuple
         user>> f user boa select-tuple
     ] with-db
 ] unit-test
-
-[ \ swap ensure-table ] must-fail
index d006145ea83caad2080978e17d9d2b3e89f998a8..5b658f36c982cfd25eef3dd1f21ad46d7a835f1a 100755 (executable)
@@ -1,12 +1,13 @@
 ! Copyright (C) 2005, 2008 Chris Double, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien arrays assocs classes compiler db hashtables
-io.files kernel math math.parser namespaces prettyprint
+io.files kernel math math.parser namespaces prettyprint fry
 sequences strings classes.tuple alien.c-types continuations
 db.sqlite.lib db.sqlite.ffi db.tuples words db.types combinators
 math.intervals io nmake accessors vectors math.ranges random
 math.bitwise db.queries destructors db.tuples.private interpolate
-io.streams.string multiline make db.private ;
+io.streams.string multiline make db.private sequences.deep
+db.errors.sqlite ;
 IN: db.sqlite
 
 TUPLE: sqlite-db path ;
@@ -126,30 +127,6 @@ M: sqlite-statement query-results ( query -- result-set )
     dup handle>> sqlite-result-set new-result-set
     dup advance-row ;
 
-M: sqlite-db-connection create-sql-statement ( class -- statement )
-    [
-        dupd
-        "create table " 0% 0%
-        "(" 0% [ ", " 0% ] [
-            dup "sql-spec" set
-            dup column-name>> [ "table-id" set ] [ 0% ] bi
-            " " 0%
-            dup type>> lookup-create-type 0%
-            modifiers 0%
-        ] interleave
-
-        find-primary-key [
-            ", " 0%
-            "primary key(" 0%
-            [ "," 0% ] [ column-name>> 0% ] interleave
-            ")" 0%
-        ] unless-empty
-        ");" 0%
-    ] query-make ;
-
-M: sqlite-db-connection drop-sql-statement ( class -- statement )
-    [ "drop table " 0% 0% ";" 0% drop ] query-make ;
-
 M: sqlite-db-connection <insert-db-assigned-statement> ( tuple -- statement )
     [
         "insert into " 0% 0%
@@ -225,10 +202,10 @@ M: sqlite-db-connection persistent-table ( -- assoc )
 : insert-trigger ( -- string )
     [
     <"
-        CREATE TRIGGER fki_${table-name}_${foreign-table-name}_id
+        CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
         BEFORE INSERT ON ${table-name}
         FOR EACH ROW BEGIN
-            SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"')
+            SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fki_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
             WHERE  (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
         END;
     "> interpolate
@@ -237,11 +214,11 @@ M: sqlite-db-connection persistent-table ( -- assoc )
 : insert-trigger-not-null ( -- string )
     [
     <"
-        CREATE TRIGGER fki_${table-name}_${foreign-table-name}_id
+        CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
         BEFORE INSERT ON ${table-name}
         FOR EACH ROW BEGIN
-            SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"')
-            WHERE NEW.${foreign-table-id} IS NOT NULL
+            SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fki_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
+            WHERE NEW.${table-id} IS NOT NULL
                 AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
         END;
     "> interpolate
@@ -250,11 +227,11 @@ M: sqlite-db-connection persistent-table ( -- assoc )
 : update-trigger ( -- string )
     [
     <"
-        CREATE TRIGGER fku_${table-name}_${foreign-table-name}_id
+        CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
         BEFORE UPDATE ON ${table-name}
         FOR EACH ROW BEGIN
-            SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"')
-            WHERE  (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
+            SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fku_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
+            WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
         END;
     "> interpolate
     ] with-string-writer ;
@@ -262,11 +239,11 @@ M: sqlite-db-connection persistent-table ( -- assoc )
 : update-trigger-not-null ( -- string )
     [
     <"
-        CREATE TRIGGER fku_${table-name}_${foreign-table-name}_id
+        CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
         BEFORE UPDATE ON ${table-name}
         FOR EACH ROW BEGIN
-            SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"')
-            WHERE NEW.${foreign-table-id} IS NOT NULL
+            SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fku_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
+            WHERE NEW.${table-id} IS NOT NULL
                 AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL;
         END;
     "> interpolate
@@ -275,11 +252,11 @@ M: sqlite-db-connection persistent-table ( -- assoc )
 : delete-trigger-restrict ( -- string )
     [
     <"
-        CREATE TRIGGER fkd_${table-name}_${foreign-table-name}_id
+        CREATE TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
         BEFORE DELETE ON ${foreign-table-name}
         FOR EACH ROW BEGIN
-            SELECT RAISE(ROLLBACK, 'delete on table "${foreign-table-name}" violates foreign key constraint "fk_${foreign-table-name}_id"')
-            WHERE  (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = OLD.${foreign-table-id}) IS NOT NULL;
+            SELECT RAISE(ROLLBACK, 'delete on table "${foreign-table-name}" violates foreign key constraint "fkd_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"')
+            WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = OLD.${foreign-table-id}) IS NOT NULL;
         END;
     "> interpolate
     ] with-string-writer ;
@@ -287,7 +264,7 @@ M: sqlite-db-connection persistent-table ( -- assoc )
 : delete-trigger-cascade ( -- string )
     [
     <"
-        CREATE TRIGGER fkd_${table-name}_${foreign-table-name}_id
+        CREATE TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id
         BEFORE DELETE ON ${foreign-table-name}
         FOR EACH ROW BEGIN
             DELETE from ${table-name} WHERE ${table-id} = OLD.${foreign-table-id};
@@ -318,14 +295,62 @@ M: sqlite-db-connection persistent-table ( -- assoc )
         delete-trigger-restrict sqlite-trigger,
     ] if ;
 
+: create-db-triggers ( sql-specs -- )
+    [ modifiers>> [ +foreign-id+ = ] deep-any? ] filter
+    [
+        [ class>> db-table-name "db-table" set ]
+        [
+            [ "sql-spec" set ]
+            [ column-name>> "table-id" set ]
+            [ ] tri
+            modifiers>> [ [ +foreign-id+ = ] deep-any? ] filter
+            [
+                [ second db-table-name "foreign-table-name" set ]
+                [ third "foreign-table-id" set ] bi
+                create-sqlite-triggers
+            ] each
+        ] bi
+    ] each ;
+
+: sqlite-create-table ( sql-specs class-name -- )
+    [
+        "create table " 0% 0%
+        "(" 0% [ ", " 0% ] [
+            dup "sql-spec" set
+            dup column-name>> [ "table-id" set ] [ 0% ] bi
+            " " 0%
+            dup type>> lookup-create-type 0%
+            modifiers 0%
+        ] interleave
+    ] [
+        drop
+        find-primary-key [
+            ", " 0%
+            "primary key(" 0%
+            [ "," 0% ] [ column-name>> 0% ] interleave
+            ")" 0%
+        ] unless-empty
+        ");" 0%
+    ] 2bi ;
+
+M: sqlite-db-connection create-sql-statement ( class -- statement )
+    [
+        [ sqlite-create-table ]
+        [ drop create-db-triggers ] 2bi
+    ] query-make ;
+
+M: sqlite-db-connection drop-sql-statement ( class -- statements )
+    [ nip "drop table " 0% 0% ";" 0% ] query-make ;
+
 M: sqlite-db-connection compound ( string seq -- new-string )
     over {
         { "default" [ first number>string " " glue ] }
-        { "references" [
-            [ >reference-string ] keep
-            first2 [ db-table-name "foreign-table-name" set ]
-            [ "foreign-table-id" set ] bi*
-            create-sqlite-triggers
-        ] }
+        { "references" [ >reference-string ] }
         [ 2drop ]
     } case ;
+
+M: sqlite-db-connection parse-db-error
+    dup n>> {
+        { 1 [ string>> parse-sqlite-sql-error ] }
+        [ drop ]
+    } case ;
diff --git a/basis/db/sqlite/summary.txt b/basis/db/sqlite/summary.txt
new file mode 100644 (file)
index 0000000..f5997a3
--- /dev/null
@@ -0,0 +1 @@
+SQLite database connector
index 490f6bbef585093b581ad0f5799f38b9c7eb1410..fcc5abf1cf01085aa6ebff8d0e786aae4eda3531 100644 (file)
@@ -2,9 +2,42 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: concurrency.combinators db.pools db.sqlite db.tuples
 db.types kernel math random threads tools.test db sequences
-io prettyprint ;
+io prettyprint db.postgresql db.sqlite accessors io.files.temp
+namespaces fry system ;
 IN: db.tester
 
+: postgresql-test-db ( -- postgresql-db )
+    <postgresql-db>
+        "localhost" >>host
+        "postgres" >>username
+        "thepasswordistrust" >>password
+        "factor-test" >>database ;
+
+: sqlite-test-db ( -- sqlite-db )
+    "tuples-test.db" temp-file <sqlite-db> ;
+
+
+! These words leak resources, but are useful for interactivel testing
+: set-sqlite-db ( -- )
+    sqlite-db db-open db-connection set ;
+
+: set-postgresql-db ( -- )
+    postgresql-db db-open db-connection set ;
+
+
+: test-sqlite ( quot -- )
+    '[
+        [ ] [ sqlite-test-db _ with-db ] unit-test
+    ] call ; inline
+
+: test-postgresql ( quot -- )
+    '[
+        os windows? cpu x86.64? and [
+            [ ] [ postgresql-test-db _ with-db ] unit-test
+        ] unless
+    ] call ; inline
+
+
 TUPLE: test-1 id a b c ;
 
 test-1 "TEST1" {
@@ -23,9 +56,6 @@ test-2 "TEST2" {
    { "z" "Z" { VARCHAR 256 } +not-null+ }
 } define-persistent
 
-: sqlite-test-db ( -- db ) "test.db" <sqlite-db> ;
-: test-db ( -- db ) "test.db" <sqlite-db> ;
-
 : db-tester ( test-db -- )
     [
         [
diff --git a/basis/db/tuples/summary.txt b/basis/db/tuples/summary.txt
new file mode 100644 (file)
index 0000000..3ffaa8a
--- /dev/null
@@ -0,0 +1 @@
+O/R mapper
index 246946c7151717fc9887532c8d767cb6ece12f21..af77ce6ac1ced820de85ac2f3c378835d5534a87 100644 (file)
@@ -4,40 +4,10 @@ USING: io.files io.files.temp kernel tools.test db db.tuples classes
 db.types continuations namespaces math math.ranges
 prettyprint calendar sequences db.sqlite math.intervals
 db.postgresql accessors random math.bitwise system
-math.ranges strings urls fry db.tuples.private db.private ;
+math.ranges strings urls fry db.tuples.private db.private
+db.tester ;
 IN: db.tuples.tests
 
-: sqlite-db ( -- sqlite-db )
-    "tuples-test.db" temp-file <sqlite-db> ;
-
-: test-sqlite ( quot -- )
-    '[
-        [ ] [
-            "tuples-test.db" temp-file <sqlite-db> _ with-db
-        ] unit-test
-    ] call ; inline
-
-: postgresql-db ( -- postgresql-db )
-    <postgresql-db>
-        "localhost" >>host
-        "postgres" >>username
-        "thepasswordistrust" >>password
-        "factor-test" >>database ;
-
-: test-postgresql ( quot -- )
-    '[
-        os windows? cpu x86.64? and [
-            [ ] [ postgresql-db _ with-db ] unit-test
-        ] unless
-    ] call ; inline
-
-! These words leak resources, but are useful for interactivel testing 
-: sqlite-test-db ( -- )
-    sqlite-db db-open db-connection set ;
-
-: postgresql-test-db ( -- )
-    postgresql-db db-open db-connection set ;
-
 TUPLE: person the-id the-name the-number the-real
 ts date time blob factor-blob url ;
 
index 219116aefd0ddfc5ba5f2ec247f9ad2aea07a4b2..19d4be5fc8aa8c238ee97398104aa4093c46748c 100644 (file)
@@ -3,7 +3,8 @@
 USING: arrays assocs classes db kernel namespaces
 classes.tuple words sequences slots math accessors
 math.parser io prettyprint db.types continuations
-destructors mirrors sets db.types db.private ;
+destructors mirrors sets db.types db.private fry
+combinators.short-circuit db.errors ;
 IN: db.tuples
 
 HOOK: create-sql-statement db-connection ( class -- object )
@@ -29,7 +30,7 @@ GENERIC: eval-generator ( singleton -- object )
 
 : resulting-tuple ( exemplar-tuple row out-params -- tuple )
     rot class new [
-        [ [ slot-name>> ] dip set-slot-named ] curry 2each
+        '[ slot-name>> _ set-slot-named ] 2each
     ] keep ;
 
 : query-tuples ( exemplar-tuple statement -- seq )
@@ -98,33 +99,51 @@ M: query >query clone ;
 
 M: tuple >query <query> swap >>tuple ;
 
+ERROR: no-defined-persistent object ;
+
+: ensure-defined-persistent ( object -- object )
+    dup { [ class? ] [ "db-table" word-prop ] } 1&& [
+        no-defined-persistent
+    ] unless ;
+
 : create-table ( class -- )
+    ensure-defined-persistent
     create-sql-statement [ execute-statement ] with-disposals ;
 
 : drop-table ( class -- )
+    ensure-defined-persistent
     drop-sql-statement [ execute-statement ] with-disposals ;
 
 : recreate-table ( class -- )
+    ensure-defined-persistent
     [
-        [ drop-sql-statement [ execute-statement ] with-disposals
-        ] curry ignore-errors
+        '[
+            [
+                _ drop-sql-statement [ execute-statement ] with-disposals
+            ] ignore-table-missing
+        ] ignore-function-missing
     ] [ create-table ] bi ;
 
-: ensure-table ( class -- ) [ create-table ] curry ignore-errors ;
+: ensure-table ( class -- )
+    ensure-defined-persistent
+    '[ [ _ create-table ] ignore-table-exists ] ignore-function-exists ;
 
 : ensure-tables ( classes -- ) [ ensure-table ] each ;
 
 : insert-tuple ( tuple -- )
-    dup class db-columns find-primary-key db-assigned-id-spec?
+    dup class ensure-defined-persistent
+    db-columns find-primary-key db-assigned-id-spec?
     [ insert-db-assigned-statement ] [ insert-user-assigned-statement ] if ;
 
 : update-tuple ( tuple -- )
-    dup class
+    dup class ensure-defined-persistent
     db-connection get update-statements>> [ <update-tuple-statement> ] cache
     [ bind-tuple ] keep execute-statement ;
 
 : delete-tuples ( tuple -- )
-    dup dup class <delete-tuples-statement> [
+    dup
+    dup class ensure-defined-persistent
+    <delete-tuples-statement> [
         [ bind-tuple ] keep execute-statement
     ] with-disposal ;
 
@@ -132,8 +151,8 @@ M: tuple >query <query> swap >>tuple ;
     >query [ tuple>> ] [ query>statement ] bi do-select ;
 
 : select-tuple ( query/tuple -- tuple/f )
-    >query 1 >>limit [ tuple>> ] [ query>statement ] bi do-select
-    [ f ] [ first ] if-empty ;
+    >query 1 >>limit [ tuple>> ] [ query>statement ] bi
+    do-select [ f ] [ first ] if-empty ;
 
 : count-tuples ( query/tuple -- n )
     >query [ tuple>> ] [ <count-statement> ] bi do-count
diff --git a/basis/db/types/summary.txt b/basis/db/types/summary.txt
new file mode 100644 (file)
index 0000000..c474fe6
--- /dev/null
@@ -0,0 +1 @@
+SQL data type support
index e39a5977eff9d14192e337dd588de85521adff68..30116e3fc53365ef6cb270a56f271697537edb9f 100755 (executable)
@@ -124,9 +124,6 @@ FACTOR-BLOB NULL URL ;
 ! PostgreSQL Types:
 ! http://developer.postgresql.org/pgdocs/postgres/datatype.html
 
-: ?at ( obj assoc -- value/obj ? )
-    dupd at* [ [ nip ] [ drop ] if ] keep ;
-
 ERROR: unknown-modifier modifier ;
 
 : lookup-modifier ( obj -- string )
index 1440e7ca5da422754efae1ffc6d2e517d385cf3d..5f7431ecf33d0393c7f41b762b13a11ed343710a 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2004, 2008 Slava Pestov.
+! Copyright (C) 2004, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slots arrays definitions generic hashtables summary io
 kernel math namespaces make prettyprint prettyprint.config
@@ -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 vocabs.parser ;
+generic.parser strings.parser vocabs.loader vocabs.parser ;
 IN: debugger
 
 GENERIC: error. ( error -- )
@@ -70,7 +70,7 @@ M: string error. print ;
     "Type :help for debugging help." print flush ;
 
 : try ( quot -- )
-    [ print-error-and-restarts ] recover ;
+    [ print-error-and-restarts ] recover ; inline
 
 : expired-error. ( obj -- )
     "Object did not survive image save/load: " write third . ;
@@ -323,3 +323,5 @@ M: bad-escape summary drop "Bad escape code" ;
 M: bad-literal-tuple summary drop "Bad literal tuple" ;
 
 M: check-mixin-class summary drop "Not a mixin class" ;
+
+M: not-found-in-roots summary drop "Cannot resolve vocab: path" ;
diff --git a/basis/delegate/protocols/summary.txt b/basis/delegate/protocols/summary.txt
new file mode 100644 (file)
index 0000000..3a74997
--- /dev/null
@@ -0,0 +1 @@
+Various core protocols for use with delegation
index 79387f9820dae12c0f97a442554350440358da80..05b879770e6317c2a5a4ff9fbb6d9cace98e133d 100644 (file)
@@ -1,17 +1,26 @@
 USING: definitions io.launcher kernel parser words sequences math
-math.parser namespaces editors make system ;
+math.parser namespaces editors make system combinators.short-circuit
+fry threads vocabs.loader ;
 IN: editors.emacs
 
+SYMBOL: emacsclient-path
+
+HOOK: default-emacsclient os ( -- path )
+
+M: object default-emacsclient ( -- path ) "emacsclient" ;
+
 : emacsclient ( file line -- )
     [
-        \ emacsclient get "emacsclient" or ,
-        os windows? [ "--no-wait" , ] unless
-        "+" swap number>string append ,
+        { [ \ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
+        "--no-wait" ,
+        number>string "+" prepend ,
         ,
-    ] { } make try-process ;
+    ] { } make
+    os windows? [ run-detached drop ] [ try-process ] if ;
 
 : emacs ( word -- )
     where first2 emacsclient ;
 
 [ emacsclient ] edit-hook set-global
 
+os windows? [ "editors.emacs.windows" require ] when
diff --git a/basis/editors/emacs/windows/authors.txt b/basis/editors/emacs/windows/authors.txt
new file mode 100755 (executable)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/editors/emacs/windows/windows.factor b/basis/editors/emacs/windows/windows.factor
new file mode 100755 (executable)
index 0000000..e18c39e
--- /dev/null
@@ -0,0 +1,12 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: editors.emacs io.directories.search.windows kernel sequences
+system combinators.short-circuit ;
+IN: editors.emacs.windows
+
+M: windows default-emacsclient
+    {
+        [ "Emacs" t [ "emacsclientw.exe" tail? ] find-in-program-files ]
+        [ "Emacs" t [ "emacsclient.exe" tail? ] find-in-program-files ]
+        [ "emacsclient.exe" ]
+    } 0|| ;
diff --git a/basis/endian/summary.txt b/basis/endian/summary.txt
new file mode 100644 (file)
index 0000000..e5380c1
--- /dev/null
@@ -0,0 +1 @@
+Utilities for working with big-endian and little-endian data
diff --git a/basis/environment/unix/macosx/summary.txt b/basis/environment/unix/macosx/summary.txt
new file mode 100644 (file)
index 0000000..d7f2162
--- /dev/null
@@ -0,0 +1 @@
+Mac OS X environment variables implementation
diff --git a/basis/environment/unix/summary.txt b/basis/environment/unix/summary.txt
new file mode 100644 (file)
index 0000000..cc4d5de
--- /dev/null
@@ -0,0 +1 @@
+Unix environment variables implementation
diff --git a/basis/environment/winnt/summary.txt b/basis/environment/winnt/summary.txt
new file mode 100644 (file)
index 0000000..9059709
--- /dev/null
@@ -0,0 +1 @@
+Windows environment variables implementation
index eea30a30408fed49cc44e521b85cc7b336860722..50ee938659f41fe2638ab450786af1b548f64c3c 100755 (executable)
@@ -157,7 +157,7 @@ stand-alone
            = (line | code | heading | list | table | paragraph | nl)*
 ;EBNF
 
-: invalid-url "javascript:alert('Invalid URL in farkup');" ;
+CONSTANT: invalid-url "javascript:alert('Invalid URL in farkup');"
 
 : check-url ( href -- href' )
     {
index 8e27be7d6154a1f68ea9160ef0e18691d20560dc..5df72b3467b08c78d9095abaefbb11fad30ec01e 100644 (file)
@@ -1 +1,2 @@
 text
+web
index ac21bb8f78b39aa1d1a824e2b2de656cc3f102a0..14877110d35a87a82a7116ce183a33d1ffb2207e 100644 (file)
@@ -93,7 +93,7 @@ ERROR: ftp-error got expected ;
 : ensure-login ( url -- url )
     dup username>> [
         "anonymous" >>username
-        "ftp-client" >>password
+        "ftp-client@factorcode.org" >>password
     ] unless ;
 
 : >ftp-url ( url -- url' ) >url ensure-port ensure-login ;
diff --git a/basis/ftp/client/summary.txt b/basis/ftp/client/summary.txt
new file mode 100644 (file)
index 0000000..17a546e
--- /dev/null
@@ -0,0 +1 @@
+FTP client
index adf7d5b41b77437315ececa45f93a1cf21f5d661..eea98c01721be9f5c5951c15c135dbc4ddb92b41 100644 (file)
@@ -4,8 +4,7 @@ USING: accessors arrays assocs combinators io io.files kernel
 math.parser sequences strings ;
 IN: ftp
 
-SINGLETON: active
-SINGLETON: passive
+SYMBOLS: +active+ +passive+ ;
 
 TUPLE: ftp-response n strings parsed ;
 
@@ -17,5 +16,3 @@ TUPLE: ftp-response n strings parsed ;
     over strings>> push ;
 
 : ftp-send ( string -- ) write "\r\n" write flush ;
-: ftp-ipv4 1 ; inline
-: ftp-ipv6 2 ; inline
diff --git a/basis/ftp/server/server-tests.factor b/basis/ftp/server/server-tests.factor
new file mode 100644 (file)
index 0000000..d7d9d83
--- /dev/null
@@ -0,0 +1,50 @@
+USING: calendar ftp.server io.encodings.ascii io.files
+io.files.unique namespaces threads tools.test kernel
+io.servers.connection ftp.client accessors urls
+io.pathnames io.directories sequences fry ;
+IN: ftp.server.tests
+
+: test-file-contents ( -- string )
+    "Files are so boring anymore." ;
+
+: create-test-file ( -- path )
+    test-file-contents
+    "ftp.server" "test" make-unique-file
+    [ ascii set-file-contents ] keep canonicalize-path ;
+
+: test-ftp-server ( quot -- )
+    '[
+        current-temporary-directory get 0
+        <ftp-server>
+        [ start-server* ]
+        [
+            sockets>> first addr>> port>>
+            <url>
+                swap >>port
+                "ftp" >>protocol
+                "localhost" >>host
+                create-test-file >>path
+                _ call
+        ]
+        [ stop-server ] tri
+    ] with-unique-directory drop ; inline
+
+[ t ]
+[
+    
+    [
+        unique-directory [
+            [ ftp-get ] [ path>> file-name ascii file-contents ] bi
+        ] with-directory
+    ] test-ftp-server test-file-contents =
+] unit-test
+
+[
+    
+    [
+        "/" >>path
+        unique-directory [
+            [ ftp-get ] [ path>> file-name ascii file-contents ] bi
+        ] with-directory
+    ] test-ftp-server test-file-contents =
+] must-fail
index 20a753785ce6452da4bfc4045eb3716755e23212..8438aae94e1b2792e3cfbe98e8583006f8ea56c1 100644 (file)
@@ -1,52 +1,46 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: combinators.short-circuit accessors combinators io
-io.encodings.8-bit io.encodings io.encodings.binary
-io.encodings.utf8 io.files io.files.info io.directories
-io.sockets kernel math.parser namespaces make sequences
-ftp io.launcher.unix.parser unicode.case splitting
-assocs classes io.servers.connection destructors calendar
-io.timeouts io.streams.duplex threads continuations math
-concurrency.promises byte-arrays io.backend tools.hexdump
-io.streams.string math.bitwise tools.files io.pathnames ;
+USING: accessors assocs byte-arrays calendar classes
+combinators combinators.short-circuit concurrency.promises
+continuations destructors ftp io io.backend io.directories
+io.encodings io.encodings.8-bit io.encodings.binary
+tools.files io.encodings.utf8 io.files io.files.info
+io.pathnames io.launcher.unix.parser io.servers.connection
+io.sockets io.streams.duplex io.streams.string io.timeouts
+kernel make math math.bitwise math.parser namespaces sequences
+splitting threads unicode.case logging calendar.format
+strings io.files.links io.files.types ;
 IN: ftp.server
 
-TUPLE: ftp-client url mode state command-promise user password ;
-
-: <ftp-client> ( url -- ftp-client )
-    ftp-client new
-        swap >>url ;
-    
+SYMBOL: server
 SYMBOL: client
 
-: ftp-server-directory ( -- str )
-    \ ftp-server-directory get-global "resource:temp" or
-    normalize-path ;
+TUPLE: ftp-server < threaded-server { serving-directory string } ;
 
-TUPLE: ftp-command raw tokenized ;
+TUPLE: ftp-client user password extra-connection ;
 
-: <ftp-command> ( -- obj )
-    ftp-command new ;
+TUPLE: ftp-command raw tokenized ;
+: <ftp-command> ( str -- obj )
+    dup \ <ftp-command> DEBUG log-message
+    ftp-command new
+        over >>raw
+        swap tokenize-command >>tokenized ;
 
 TUPLE: ftp-get path ;
-
 : <ftp-get> ( path -- obj )
     ftp-get new
         swap >>path ;
 
 TUPLE: ftp-put path ;
-
 : <ftp-put> ( path -- obj )
     ftp-put new
         swap >>path ;
 
 TUPLE: ftp-list ;
-
 C: <ftp-list> ftp-list
 
-: read-command ( -- ftp-command )
-    <ftp-command> readln
-    [ >>raw ] [ tokenize-command >>tokenized ] bi ;
+TUPLE: ftp-disconnect ;
+C: <ftp-disconnect> ftp-disconnect
 
 : (send-response) ( n string separator -- )
     [ number>string write ] 2dip write ftp-send ;
@@ -56,28 +50,42 @@ C: <ftp-list> ftp-list
     [ but-last-slice [ "-" (send-response) ] with each ]
     [ first " " (send-response) ] 2bi ;
 
-: server-response ( n string -- )
+: server-response ( string n -- )
+    2dup number>string swap ":" glue \ server-response DEBUG log-message
     <ftp-response>
-        swap add-response-line
         swap >>n
+        swap add-response-line
     send-response ;
 
-: ftp-error ( string -- )
-    500 "Unrecognized command: " rot append server-response ;
+: serving? ( path -- ? )
+    canonicalize-path server get serving-directory>> head? ;
+
+: can-serve-directory? ( path -- ? )
+    { [ exists? ] [ file-info directory? ] [ serving? ] } 1&& ;
+
+: can-serve-file? ( path -- ? )
+    {
+        [ exists? ]
+        [ file-info type>> +regular-file+ = ]
+        [ serving? ]
+    } 1&& ;
+
+: ftp-error ( string -- ) 500 server-response ;
+: ftp-unimplemented ( string -- ) 502 server-response ;
 
 : send-banner ( -- )
-    220 "Welcome to " host-name append server-response ;
+    "Welcome to " host-name append 220 server-response ;
 
 : anonymous-only ( -- )
-    530 "This FTP server is anonymous only." server-response ;
+    "This FTP server is anonymous only." 530 server-response ;
 
 : handle-QUIT ( obj -- )
-    drop 221 "Goodbye." server-response ;
+    drop "Goodbye." 221 server-response ;
 
 : handle-USER ( ftp-command -- )
     [
         tokenized>> second client get (>>user)
-        331 "Please specify the password." server-response
+        "Please specify the password." 331 server-response
     ] [
         2drop "bad USER" ftp-error
     ] recover ;
@@ -85,7 +93,7 @@ C: <ftp-list> ftp-list
 : handle-PASS ( ftp-command -- )
     [
         tokenized>> second client get (>>password)
-        230 "Login successful" server-response
+        "Login successful" 230 server-response
     ] [
         2drop "PASS error" ftp-error
     ] recover ;
@@ -102,7 +110,7 @@ ERROR: type-error type ;
 : handle-TYPE ( obj -- )
     [
         tokenized>> second parse-type
-        [ 200 ] dip "Switching to " " mode" surround server-response
+        "Switching to " " mode" surround 200 server-response
     ] [
         2drop "TYPE is binary only" ftp-error
     ] recover ;
@@ -115,65 +123,57 @@ ERROR: type-error type ;
 
 : handle-PWD ( obj -- )
     drop
-    257 current-directory get "\"" dup surround server-response ;
+    current-directory get "\"" dup surround 257 server-response ;
 
 : handle-SYST ( obj -- )
     drop
-    215 "UNIX Type: L8" server-response ;
+    "UNIX Type: L8" 215 server-response ;
 
-: if-command-promise ( quot -- )
-    [ client get command-promise>> ] dip
-    [ "Establish an active or passive connection first" ftp-error ] if* ;
+: start-directory ( -- )
+    "Here comes the directory listing." 150 server-response ;
 
-: handle-STOR ( obj -- )
-    [
-        tokenized>> second
-        [ [ <ftp-put> ] dip fulfill ] if-command-promise
-    ] [
-        2drop
-    ] recover ;
+: transfer-outgoing-file ( path -- )
+    [ "Opening BINARY mode data connection for " ] dip
+    [ file-name ] [
+        file-info size>> number>string
+        "(" " bytes)." surround
+    ] bi " " glue append 150 server-response ;
 
-! EPRT |2|::1|62138|
-! : handle-EPRT ( obj -- )
-    ! tokenized>> second "|" split harvest ;
+: transfer-incoming-file ( path -- )
+    "Opening BINARY mode data connection for " prepend
+    150 server-response ;
 
-: start-directory ( -- )
-    150 "Here comes the directory listing." server-response ;
+: finish-file-transfer ( -- )
+    "File send OK." 226 server-response ;
 
-: finish-directory ( -- )
-    226 "Directory send OK." server-response ;
+GENERIC: handle-passive-command ( stream obj -- )
+
+: passive-loop ( server -- )
+    [
+        [
+            |dispose
+            30 seconds over set-timeout
+            accept drop &dispose
+            client get extra-connection>>
+            30 seconds ?promise-timeout
+            handle-passive-command
+        ]
+        [ client get f >>extra-connection drop ]
+        [ drop ] cleanup
+    ] with-destructors ;
 
-GENERIC: service-command ( stream obj -- )
+: finish-directory ( -- )
+    "Directory send OK." 226 server-response ;
 
-M: ftp-list service-command ( stream obj -- )
+M: ftp-list handle-passive-command ( stream obj -- )
     drop
     start-directory [
         utf8 encode-output
         [ current-directory get directory. ] with-string-writer string-lines
         harvest [ ftp-send ] each
-    ] with-output-stream
-    finish-directory ;
+    ] with-output-stream finish-directory ;
 
-: transfer-outgoing-file ( path -- )
-    [
-        150
-        "Opening BINARY mode data connection for "
-    ] dip
-    [
-        file-name
-    ] [
-        file-info size>> number>string
-        "(" " bytes)." surround
-    ] bi " " glue append server-response ;
-
-: transfer-incoming-file ( path -- )
-    [ 150 ] dip "Opening BINARY mode data connection for " prepend
-    server-response ;
-
-: finish-file-transfer ( -- )
-    226 "File send OK." server-response ;
-
-M: ftp-get service-command ( stream obj -- )
+M: ftp-get handle-passive-command ( stream obj -- )
     [
         path>>
         [ transfer-outgoing-file ]
@@ -183,7 +183,7 @@ M: ftp-get service-command ( stream obj -- )
         3drop "File transfer failed" ftp-error
     ] recover ;
 
-M: ftp-put service-command ( stream obj -- )
+M: ftp-put handle-passive-command ( stream obj -- )
     [
         path>>
         [ transfer-incoming-file ]
@@ -193,165 +193,165 @@ M: ftp-put service-command ( stream obj -- )
         3drop "File transfer failed" ftp-error
     ] recover ;
 
-: passive-loop ( server -- )
-    [
-        [
-            |dispose
-            30 seconds over set-timeout
-            accept drop &dispose
-            client get command-promise>>
-            30 seconds ?promise-timeout
-            service-command
-        ]
-        [ client get f >>command-promise drop ]
-        [ drop ] cleanup
-    ] with-destructors ;
+M: ftp-disconnect handle-passive-command ( stream obj -- )
+    drop dispose ;
 
-: handle-LIST ( obj -- )
-    drop
-    [ [ <ftp-list> ] dip fulfill ] if-command-promise ;
+: fulfill-client ( obj -- )
+    client get extra-connection>> [
+        fulfill
+    ] [
+        drop
+        "Establish an active or passive connection first" ftp-error
+    ] if* ;
 
-: handle-SIZE ( obj -- )
-    [
-        [ 213 ] dip
-        tokenized>> second file-info size>>
-        number>string server-response
+: handle-STOR ( obj -- )
+    tokenized>> second
+    dup can-serve-file? [
+        <ftp-put> fulfill-client
     ] [
-        2drop
-        550 "Could not get file size" server-response
-    ] recover ;
+        drop 
+        <ftp-disconnect> fulfill-client
+    ] if ;
+
+: handle-LIST ( obj -- )
+    drop current-directory get
+    can-serve-directory? [
+        <ftp-list> fulfill-client
+    ] [
+        <ftp-disconnect> fulfill-client
+    ] if ;
+
+: not-a-plain-file ( path -- )
+    ": not a plain file." append ftp-error ;
 
 : handle-RETR ( obj -- )
-    [ tokenized>> second <ftp-get> swap fulfill ]
-    curry if-command-promise ;
+    tokenized>> second
+    dup can-serve-file? [
+        <ftp-get> fulfill-client
+    ] [
+        not-a-plain-file
+        <ftp-disconnect> fulfill-client
+    ] if ;
+
+: handle-SIZE ( obj -- )
+    tokenized>> second
+    dup can-serve-file? [
+        file-info size>> number>string 213 server-response
+    ] [
+        not-a-plain-file
+    ] if ;
 
 : expect-connection ( -- port )
+    <promise> client get (>>extra-connection)
     random-local-server
-    client get <promise> >>command-promise drop
     [ [ passive-loop ] curry in-thread ]
     [ addr>> port>> ] bi ;
 
 : handle-PASV ( obj -- )
-    drop client get passive >>mode drop
-    221
+    drop
     expect-connection port>bytes [ number>string ] bi@ "," glue
     "Entering Passive Mode (127,0,0,1," ")" surround
-    server-response ;
+    221 server-response ;
 
 : handle-EPSV ( obj -- )
     drop
-    client get command-promise>> [
-        "You already have a passive stream" ftp-error
+    client get f >>extra-connection drop
+    expect-connection number>string
+    "Entering Extended Passive Mode (|||" "|)" surround
+    229 server-response ;
+
+: handle-MDTM ( obj -- )
+    tokenized>> 1 swap ?nth [
+        dup file-info dup directory? [
+            drop not-a-plain-file
+        ] [
+            nip
+            modified>> timestamp>mdtm
+            213 server-response
+        ] if
     ] [
-        229
-        expect-connection number>string
-        "Entering Extended Passive Mode (|||" "|)" surround
-        server-response
-    ] if ;
-
-! LPRT 6,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,242,186
-! : handle-LPRT ( obj -- ) tokenized>> "," split ;
+        "" not-a-plain-file
+    ] if* ;
 
 ERROR: not-a-directory ;
-ERROR: no-permissions ;
+ERROR: no-directory-permissions ;
 
-: handle-CWD ( obj -- )
-    [
-        tokenized>> second dup normalize-path
-        dup ftp-server-directory head? [
-            no-permissions
-        ] unless
+: directory-change-success ( -- )
+    "Directory successully changed." 250 server-response ;
+
+: directory-change-failed ( -- )
+    "Failed to change directory." 553 server-response ;
 
-        file-info directory? [
+: handle-CWD ( obj -- )
+    tokenized>> 1 swap ?nth [
+        dup can-serve-directory? [
             set-current-directory
-            250 "Directory successully changed." server-response
+            directory-change-success
         ] [
-            not-a-directory
+            drop
+            directory-change-failed
         ] if
     ] [
-        2drop
-        550 "Failed to change directory." server-response
-    ] recover ;
+        directory-change-success
+    ] if* ;
 
-: unrecognized-command ( obj -- ) raw>> ftp-error ;
+: unrecognized-command ( obj -- )
+    raw>> "Unrecognized command: " prepend ftp-error ;
 
-: handle-client-loop ( -- )
-    <ftp-command> readln
-    USE: prettyprint    global [ dup . flush ] bind
-    [ >>raw ]
-    [ tokenize-command >>tokenized ] bi
+: client-loop-dispatch ( str/f -- ? )
     dup tokenized>> first >upper {
+        { "QUIT" [ handle-QUIT f ] }
         { "USER" [ handle-USER t ] }
         { "PASS" [ handle-PASS t ] }
-        { "ACCT" [ drop "ACCT unimplemented" ftp-error t ] }
+        { "SYST" [ handle-SYST t ] }
+        { "ACCT" [ drop "ACCT unimplemented" ftp-unimplemented t ] }
+        { "PWD" [ handle-PWD t ] }
+        { "TYPE" [ handle-TYPE t ] }
         { "CWD" [ handle-CWD t ] }
-        ! { "XCWD" [ ] }
-        ! { "CDUP" [ ] }
-        ! { "SMNT" [ ] }
-
-        ! { "REIN" [ drop client get reset-ftp-client t ] }
-        { "QUIT" [ handle-QUIT f ] }
-
-        ! { "PORT" [  ] } ! TODO
         { "PASV" [ handle-PASV t ] }
-        ! { "MODE" [ ] }
-        { "TYPE" [ handle-TYPE t ] }
-        ! { "STRU" [ ] }
-
-        ! { "ALLO" [ ] }
-        ! { "REST" [ ] }
+        { "EPSV" [ handle-EPSV t ] }
+        { "LIST" [ handle-LIST t ] }
         { "STOR" [ handle-STOR t ] }
-        ! { "STOU" [ ] }
         { "RETR" [ handle-RETR t ] }
-        { "LIST" [ handle-LIST t ] }
         { "SIZE" [ handle-SIZE t ] }
-        ! { "NLST" [ ] }
-        ! { "APPE" [ ] }
-        ! { "RNFR" [ ] }
-        ! { "RNTO" [ ] }
-        ! { "DELE" [ handle-DELE t ] }
-        ! { "RMD" [ handle-RMD t ] }
-        ! ! { "XRMD" [ handle-XRMD t ] }
-        ! { "MKD" [ handle-MKD t ] }
-        { "PWD" [ handle-PWD t ] }
-        ! { "ABOR" [ ] }
-
-        { "SYST" [ handle-SYST t ] }
-        ! { "STAT" [ ] }
-        ! { "HELP" [ ] }
+        { "MDTM" [ handle-MDTM t ] }
+        [ drop unrecognized-command t ]
+    } case ;
 
-        ! { "SITE" [ ] }
-        ! { "NOOP" [ ] }
+: read-command ( -- ftp-command/f )
+    readln [ f ] [ <ftp-command> ] if-empty ;
 
-        ! { "EPRT" [ handle-EPRT ] }
-        ! { "LPRT" [ handle-LPRT ] }
-        { "EPSV" [ handle-EPSV t ] }
-        ! { "LPSV" [ drop handle-LPSV t ] }
-        [ drop unrecognized-command t ]
-    } case [ handle-client-loop ] when ;
+: handle-client-loop ( -- )
+    read-command [
+        client-loop-dispatch
+        [ handle-client-loop ] when
+    ] when* ;
 
-TUPLE: ftp-server < threaded-server ;
+: serve-directory ( server -- )
+    serving-directory>> [
+        send-banner
+        handle-client-loop
+    ] with-directory ;
 
 M: ftp-server handle-client* ( server -- )
-    drop
     [
-        ftp-server-directory [
-            host-name <ftp-client> client set
-            send-banner handle-client-loop
-        ] with-directory
+        "New client" \ handle-client* DEBUG log-message
+        ftp-client new client set
+        [ server set ] [ serve-directory ] bi
     ] with-destructors ;
 
-: <ftp-server> ( port -- server )
+: <ftp-server> ( directory port -- server )
     ftp-server new-threaded-server
         swap >>insecure
+        swap canonicalize-path >>serving-directory
         "ftp.server" >>name
         5 minutes >>timeout
         latin1 >>encoding ;
 
-: ftpd ( port -- )
+: ftpd ( directory port -- )
     <ftp-server> start-server ;
 
-: ftpd-main ( -- ) 2100 ftpd ;
+: ftpd-main ( path -- ) 2100 ftpd ;
 
 MAIN: ftpd-main
 
diff --git a/basis/ftp/server/summary.txt b/basis/ftp/server/summary.txt
new file mode 100644 (file)
index 0000000..e839816
--- /dev/null
@@ -0,0 +1 @@
+FTP server
diff --git a/basis/ftp/summary.txt b/basis/ftp/summary.txt
new file mode 100644 (file)
index 0000000..a1c6bf6
--- /dev/null
@@ -0,0 +1 @@
+Common code shared by FTP client and server
index 14151692f06704981501b93d45c623233d288adb..0b9c9caa450f21ef5f03f3030edb85c05220fb34 100644 (file)
@@ -80,9 +80,9 @@ M: object fake-quotations> ;
     scan-param parsed
     \ add-mixin-instance parsed ; parsing
 
-: `inline \ inline parsed ; parsing
+: `inline [ word make-inline ] over push-all ; parsing
 
-: `parsing \ parsing parsed ; parsing
+: `parsing [ word make-parsing ] over push-all ; parsing
 
 : `(
     ")" parse-effect effect set ; parsing
index 97cb73c9cb694086b1f7dc8c38d0ddc7f935af39..166d2a88a2381a5349946ad8afac8284a70e6c0a 100644 (file)
@@ -63,7 +63,7 @@ TUPLE: action rest init authorize display validate submit ;
 : param ( name -- value )\r
     params get at ;\r
 \r
-: revalidate-url-key "__u" ;\r
+CONSTANT: revalidate-url-key "__u"\r
 \r
 : revalidate-url ( -- url/f )\r
     revalidate-url-key param\r
index 0fe80427b921361ae846aa21e5fa91b49e63d733..dc280c1e4474f38f5817a21306def76e0aca8309 100644 (file)
@@ -10,7 +10,7 @@ furnace.auth.providers
 furnace.auth.login.permits ;
 IN: furnace.alloy
 
-: state-classes { session aside conversation permit } ; inline
+CONSTANT: state-classes { session aside conversation permit }
 
 : init-furnace-tables ( -- )
     state-classes ensure-tables
index 7489d19f944e52d33e537873ec396036ef54665f..ecf6d0a6280b21c34488b0a32b400e4f50cfc20a 100644 (file)
@@ -23,7 +23,7 @@ aside "ASIDES" {
     { "post-data" "POST_DATA" FACTOR-BLOB }
 } define-persistent
 
-: aside-id-key "__a" ;
+CONSTANT: aside-id-key "__a"
 
 TUPLE: asides < server-state-manager ;
 
index 0ceafa7f86384b7b12548661cabb035cb562700c..915ae1c2249d57331466daae541d63c61a1d2918 100644 (file)
@@ -64,7 +64,7 @@ SYMBOL: capabilities
 \r
 PRIVATE>\r
 \r
-: flashed-variables { description capabilities } ;\r
+CONSTANT: flashed-variables { description capabilities }\r
 \r
 : login-failed ( -- * )\r
     "invalid username or password" validation-error\r
index 39ea812ae7b3b7e158f7772ff0c0f23c742defa3..0fab3c5b09c8c3562eacc9cd338821da0d2f6acc 100644 (file)
@@ -3,9 +3,7 @@
 USING: furnace.auth.providers kernel ;\r
 IN: furnace.auth.providers.null\r
 \r
-TUPLE: no-users ;\r
-\r
-: no-users T{ no-users } ;\r
+SINGLETON: no-users\r
 \r
 M: no-users get-user 2drop f ;\r
 \r
index 266958c8a4cebb26cec2c6bfec998c50b45ea7c2..bbb84e2f0558f3cd6b40b25dfca2531c0d524474 100644 (file)
@@ -20,7 +20,7 @@ conversation "CONVERSATIONS" {
     { "session" "SESSION" BIG-INTEGER +not-null+ }
 } define-persistent
 
-: conversation-id-key "__c" ;
+CONSTANT: conversation-id-key "__c"
 
 TUPLE: conversations < server-state-manager ;
 
index 52e705c153b7a17d140b9cdb1d8f8dbadf5aece7..3eb7a1121519855b6df5416c4c9868087e89a122 100644 (file)
@@ -73,7 +73,7 @@ TUPLE: sessions < server-state-manager domain verify? ;
     [ session set ] [ save-session-after ] bi
     sessions get responder>> call-responder ;
 
-: session-id-key "__s" ;
+CONSTANT: session-id-key "__s"
 
 : verify-session ( session -- session )
     sessions get verify?>> [
index 4fc68f773577b69fefec98889ce77e04bee335f9..c0cb7dbced83176a25d1b5063ec4bf8870a19a80 100755 (executable)
@@ -89,7 +89,7 @@ M: object modify-form drop f ;
         [XML <input type="hidden" value=<-> name=<->/> XML]
     ] [ drop ] if ;
 
-: nested-forms-key "__n" ;
+CONSTANT: nested-forms-key "__n"
 
 : request-params ( request -- assoc )
     dup method>> {
@@ -131,7 +131,7 @@ M: object modify-form drop f ;
 
 SYMBOL: exit-continuation
 
-: exit-with ( value -- )
+: exit-with ( value -- )
     exit-continuation get continue-with ;
 
 : with-exit-continuation ( quot -- value )
index ebc711d5273ca13b4ef4211b7dc0ef7561eac5d3..3fe09de263b33460680e52fb19daee9668e5c037 100644 (file)
@@ -220,24 +220,6 @@ ARTICLE: "cookbook-io" "Input and output cookbook"
     "io"
 } ;
 
-ARTICLE: "cookbook-compiler" "Compiler cookbook"
-"Factor includes two compilers which work behind the scenes. Words are always compiled, and the compilers do not have to be invoked explicitly. For the most part, compilation is a fully transparent process. However, there are a few things worth knowing about the compilation process."
-$nl
-"The optimizing compiler trades off compile time for performance of generated code, so loading certain vocabularies might take a while. Saving the image after loading vocabularies can save you a lot of time that you would spend waiting for the same code to load in every coding session; see " { $link "images" } " for information."
-$nl
-"After loading a vocabulary, you might see messages like:"
-{ $code
-    ":errors - print 2 compiler errors."
-    ":warnings - print 50 compiler warnings."
-}
-"These warnings arise from the compiler's stack effect checker. Warnings are non-fatal conditions -- not all code has a static stack effect, so you try to minimize warnings but understand that in many cases they cannot be eliminated. Errors indicate programming mistakes, such as erroneous stack effect declarations."
-{ $references
-    "To learn more about the compiler and static stack effect inference, read these articles:"
-    "compiler"
-    "compiler-errors"
-    "inference"
-} ;
-
 ARTICLE: "cookbook-application" "Application cookbook"
 "Vocabularies can define a main entry point:"
 { $code "IN: game-of-life"
@@ -396,7 +378,6 @@ ARTICLE: "cookbook" "Factor cookbook"
 { $subsection "cookbook-io" }
 { $subsection "cookbook-application" }
 { $subsection "cookbook-scripts" }
-{ $subsection "cookbook-compiler" }
 { $subsection "cookbook-philosophy" }
 { $subsection "cookbook-pitfalls" }
 { $subsection "cookbook-next" } ;
index 39b5a13e30c19335092d97e04c58fc4668fd260c..36496ac5c4aed9fcf113e2bf29502d1ecd9c3497 100644 (file)
@@ -33,8 +33,8 @@ $nl
     { { $snippet { $emphasis "foo" } "*" } { "alternative form of " { $snippet "foo" } ", or a generic word called by " { $snippet "foo" } } { { $links at* pprint* } } }
     { { $snippet "(" { $emphasis "foo" } ")" } { "implementation detail word used by " { $snippet "foo" } } { { $link (clone) } } }
     { { $snippet "set-" { $emphasis "foo" } } { "sets " { $snippet "foo" } " to a new value" } { $links set-length } }
-    { { $snippet { $emphasis "foo" } ">>" } { "gets the " { $snippet "foo" } " slot of the tuple at the top of the stack; see " { $link "accessors" } } { { $link >>name } } }
-    { { $snippet ">>" { $emphasis "foo" } } { "sets the " { $snippet "foo" } " slot of the tuple at the top of the stack; see " { $link "accessors" } } { { $link name>> } } }
+    { { $snippet { $emphasis "foo" } ">>" } { "gets the " { $snippet "foo" } " slot of the tuple at the top of the stack; see " { $link "accessors" } } { { $link name>> } } }
+    { { $snippet ">>" { $emphasis "foo" } } { "sets the " { $snippet "foo" } " slot of the tuple at the top of the stack; see " { $link "accessors" } } { { $link >>name } } }
     { { $snippet "with-" { $emphasis "foo" } } { "performs some kind of initialization and cleanup related to " { $snippet "foo" } ", usually in a new dynamic scope" } { $links with-scope with-input-stream with-output-stream } }
     { { $snippet "$" { $emphasis "foo" } } { "help markup" } { $links $heading $emphasis } }
 }
index cccf320e4437ac3b787865c7eeefcb44ecd647c0..f8d06064f0e37af31caeeb64c126e8e4260abe1e 100644 (file)
@@ -54,7 +54,7 @@ M: f topic>filename* drop \ f topic>filename* ;
 M: topic url-of topic>filename ;
 
 : help-stylesheet ( -- string )
-    "resource:basis/help/html/stylesheet.css" ascii file-contents
+    "vocab:help/html/stylesheet.css" ascii file-contents
     [XML <style><-></style> XML] ;
 
 : help>html ( topic -- xml )
diff --git a/basis/help/html/summary.txt b/basis/help/html/summary.txt
new file mode 100644 (file)
index 0000000..913a9a5
--- /dev/null
@@ -0,0 +1 @@
+Converting help to HTML
index 8c687eb1d5d47263ec05f32304a0e42358552517..9fba09913dc808e5798125bf532d830d6f6f2ad0 100644 (file)
@@ -54,7 +54,7 @@ M: no-article summary
     drop "Help article does not exist" ;
 
 : article ( name -- article )
-    dup articles get at* [ nip ] [ drop no-article ] if ;
+    articles get ?at [ no-article ] unless ;
 
 M: object article-name article article-name ;
 M: object article-title article article-title ;
diff --git a/basis/html/summary.txt b/basis/html/summary.txt
new file mode 100644 (file)
index 0000000..6fb5a3c
--- /dev/null
@@ -0,0 +1 @@
+HTML utilities
index 4e454dcee408862efd3d765be144947bb2029a3f..86f86a8468e8b62bd4c88b312de78b842497a8c9 100644 (file)
@@ -10,7 +10,7 @@ IN: html.templates.chloe.tests
     "?>" split1 nip ; inline
 
 : test-template ( name -- template )
-    "resource:basis/html/templates/chloe/test/"
+    "vocab:html/templates/chloe/test/"
     prepend <chloe> ;
 
 [ "Hello world" ] [
index 439b207063bd4f39b80d90c73b3f74ab6689831a..da0d45a9d4f1489556896b4e093f11a54804ec31 100644 (file)
@@ -107,7 +107,7 @@ TUPLE: cached-template path last-modified quot ;
     path>> ".xml" append
     [ ]
     [ file-info modified>> ]
-    [ utf8 <file-reader> read-xml compile-template ] tri
+    [ file>xml compile-template ] tri
     \ cached-template boa ;
 
 \ load-template DEBUG add-input-logging
diff --git a/basis/html/templates/chloe/compiler/summary.txt b/basis/html/templates/chloe/compiler/summary.txt
new file mode 100644 (file)
index 0000000..c77d722
--- /dev/null
@@ -0,0 +1 @@
+Compiling Chloe templates to Factor quotations
index faf8bed66bc0d79b3d0f117f0f90c9025e6cdf43..9e7079023d8def8154cf733f74c548d369a330ef 100644 (file)
@@ -18,7 +18,7 @@ tags [ H{ } clone ] initialize
 : CHLOE:
     scan parse-definition define-chloe-tag ; parsing
 
-: chloe-ns "http://factorcode.org/chloe/1.0" ; inline
+CONSTANT: chloe-ns "http://factorcode.org/chloe/1.0"
 
 : chloe-name? ( name -- ? )
     url>> chloe-ns = ;
index 6cebb55688127bf5c1c68d73a934fc8df49535b1..55cf90c2dd18744b7d14ab413a42aed82bb26157 100644 (file)
@@ -4,7 +4,7 @@ tools.test sequences parser splitting prettyprint ;
 IN: html.templates.fhtml.tests
 
 : test-template ( path -- ? )
-    "resource:basis/html/templates/fhtml/test/"
+    "vocab:html/templates/fhtml/test/"
     prepend
     [ ".fhtml" append <fhtml> [ call-template ] with-string-writer ]
     [ ".html" append utf8 file-contents ] bi
index 4f685945aab391365085126ffe528e4748c8cb7b..229d05615ece724efdc3256e626cd2f7cd2c121f 100644 (file)
@@ -213,7 +213,7 @@ test-db [
     <dispatcher>
         add-quit-action
         <dispatcher>
-            "resource:basis/http/test" <static> >>default
+            "vocab:http/test" <static> >>default
         "nested" add-responder
         <action>
             [ URL" redirect-loop" <temporary-redirect> ] >>display
@@ -226,7 +226,7 @@ test-db [
     >url clone "port" get >>port ;
 
 [ t ] [
-    "resource:basis/http/test/foo.html" ascii file-contents
+    "vocab:http/test/foo.html" ascii file-contents
     "http://localhost/nested/foo.html" add-port http-get nip =
 ] unit-test
 
diff --git a/basis/http/server/dispatchers/summary.txt b/basis/http/server/dispatchers/summary.txt
new file mode 100644 (file)
index 0000000..b3a5b41
--- /dev/null
@@ -0,0 +1 @@
+Dispatcher responder for dispaching requests to a set of child responders
diff --git a/basis/http/server/filters/summary.txt b/basis/http/server/filters/summary.txt
new file mode 100644 (file)
index 0000000..dc07e1a
--- /dev/null
@@ -0,0 +1 @@
+Filter responders which wrap an underlying responder
diff --git a/basis/http/server/redirection/summary.txt b/basis/http/server/redirection/summary.txt
new file mode 100644 (file)
index 0000000..1e5f38e
--- /dev/null
@@ -0,0 +1 @@
+Redirection responses which redirect the client to another URL
diff --git a/basis/http/server/remapping/summary.txt b/basis/http/server/remapping/summary.txt
new file mode 100644 (file)
index 0000000..4515eee
--- /dev/null
@@ -0,0 +1 @@
+Support for port remapping
diff --git a/basis/http/server/responses/summary.txt b/basis/http/server/responses/summary.txt
new file mode 100644 (file)
index 0000000..091d586
--- /dev/null
@@ -0,0 +1 @@
+Constructing various simple responses
diff --git a/basis/http/server/static/summary.txt b/basis/http/server/static/summary.txt
new file mode 100644 (file)
index 0000000..3aa2f37
--- /dev/null
@@ -0,0 +1 @@
+Serving static files
index 102c13c2955aa07e6e8e3661e7d8bed6a519445a..e250d81ae5843ac0a9ebe4784cf0ff304d751d40 100644 (file)
@@ -3,16 +3,16 @@ io.files io.files.unique kernel tools.test ;
 IN: images.bitmap.tests
 
 : test-bitmap24 ( -- path )
-    "resource:basis/images/test-images/thiswayup24.bmp" ;
+    "vocab:images/test-images/thiswayup24.bmp" ;
 
 : test-bitmap8 ( -- path )
-    "resource:basis/images/test-images/rgb8bit.bmp" ;
+    "vocab:images/test-images/rgb8bit.bmp" ;
 
 : test-bitmap4 ( -- path )
-    "resource:basis/images/test-images/rgb4bit.bmp" ;
+    "vocab:images/test-images/rgb4bit.bmp" ;
 
 : test-bitmap1 ( -- path )
-    "resource:basis/images/test-images/1bit.bmp" ;
+    "vocab:images/test-images/1bit.bmp" ;
 
 [ t ]
 [
diff --git a/basis/images/bitmap/summary.txt b/basis/images/bitmap/summary.txt
new file mode 100644 (file)
index 0000000..2411e58
--- /dev/null
@@ -0,0 +1 @@
+Windows BMP image loader
index c2dc33608e17f1507a1e5495e10b2c5a1415a648..5ac0da7a28d846c064162e132c4b7f085b6acef8 100644 (file)
@@ -9,6 +9,24 @@ IN: images
 SINGLETONS: BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR
 R16G16B16 R32G32B32 R16G16B16A16 R32G32B32A32 ;
 
+: bytes-per-pixel ( component-order -- n )
+    {
+        { BGR [ 3 ] }
+        { RGB [ 3 ] }
+        { BGRA [ 4 ] }
+        { RGBA [ 4 ] }
+        { ABGR [ 4 ] }
+        { ARGB [ 4 ] }
+        { RGBX [ 4 ] }
+        { XRGB [ 4 ] }
+        { BGRX [ 4 ] }
+        { XBGR [ 4 ] }
+        { R16G16B16 [ 6 ] }
+        { R32G32B32 [ 12 ] }
+        { R16G16B16A16 [ 8 ] }
+        { R32G32B32A32 [ 16 ] }
+    } case ;
+
 TUPLE: image dim component-order bitmap ;
 
 : <image> ( -- image ) image new ; inline
@@ -63,4 +81,4 @@ M: image normalize-scan-line-order ;
 : normalize-image ( image -- image )
     [ >byte-array ] change-bitmap
     normalize-component-order
-    normalize-scan-line-order ;
+    normalize-scan-line-order ;
\ No newline at end of file
diff --git a/basis/images/loader/summary.txt b/basis/images/loader/summary.txt
new file mode 100644 (file)
index 0000000..69d35c4
--- /dev/null
@@ -0,0 +1 @@
+Loading bitmap images from files
diff --git a/basis/images/summary.txt b/basis/images/summary.txt
new file mode 100644 (file)
index 0000000..3c1ddbb
--- /dev/null
@@ -0,0 +1 @@
+Bitmap images
diff --git a/basis/images/tiff/summary.txt b/basis/images/tiff/summary.txt
new file mode 100644 (file)
index 0000000..ff340da
--- /dev/null
@@ -0,0 +1 @@
+TIFF image loader
index 02440deea53bdde7661024ef9a1a1ca739172933..a50ac0cad98b2c5d950137d71497a6e53d3763fb 100755 (executable)
@@ -243,9 +243,6 @@ ERROR: bad-tiff-magic bytes ;
 
 ERROR: no-tag class ;
 
-: ?at ( key assoc -- value/key ? )
-    dupd at* [ nip t ] [ drop f ] if ; inline
-
 : find-tag ( idf class -- tag )
     swap processed-tags>> ?at [ no-tag ] unless ;
 
diff --git a/basis/interpolate/summary.txt b/basis/interpolate/summary.txt
new file mode 100644 (file)
index 0000000..b9cf1b7
--- /dev/null
@@ -0,0 +1 @@
+Interpolating variable values into strings
diff --git a/basis/io/backend/unix/multiplexers/epoll/summary.txt b/basis/io/backend/unix/multiplexers/epoll/summary.txt
new file mode 100644 (file)
index 0000000..74c9b80
--- /dev/null
@@ -0,0 +1 @@
+Linux epoll multiplexer
diff --git a/basis/io/backend/unix/multiplexers/kqueue/summary.txt b/basis/io/backend/unix/multiplexers/kqueue/summary.txt
new file mode 100644 (file)
index 0000000..74f9ce6
--- /dev/null
@@ -0,0 +1 @@
+BSD and Mac OS X kqueue multiplexer
diff --git a/basis/io/backend/unix/multiplexers/run-loop/summary.txt b/basis/io/backend/unix/multiplexers/run-loop/summary.txt
new file mode 100644 (file)
index 0000000..559de8a
--- /dev/null
@@ -0,0 +1 @@
+Mac OS X CFRunLoop multiplexer
diff --git a/basis/io/backend/unix/multiplexers/select/summary.txt b/basis/io/backend/unix/multiplexers/select/summary.txt
new file mode 100644 (file)
index 0000000..46360fd
--- /dev/null
@@ -0,0 +1 @@
+Generic Unix select multiplexer
diff --git a/basis/io/backend/unix/multiplexers/summary.txt b/basis/io/backend/unix/multiplexers/summary.txt
new file mode 100644 (file)
index 0000000..36ac79d
--- /dev/null
@@ -0,0 +1 @@
+Generic protocol for Unix I/O multiplexers
index f5e6426859aaa4543a1a407b5fd721ea3b59bca9..f21018051742c98a6a4ee63762f251ca2199437c 100644 (file)
@@ -77,7 +77,7 @@ M: io-timeout summary drop "I/O operation timed out" ;
     '[ handle>> _ wait-for-fd ] with-timeout ;
 
 ! Some general stuff
-: file-mode OCT: 0666 ;
+CONSTANT: file-mode OCT: 0666
  
 ! Readers
 : (refill) ( port -- n )
index 41031f8ac38c3272b2ebe53ec1aa47588b62ed80..b56fb7b6a3ff2c37fec947c0cad17f4b07cac993 100755 (executable)
@@ -57,8 +57,14 @@ PRIVATE>
         pusher [ [ f ] compose iterate-directory drop ] dip
     ] [ drop f ] recover ; inline
 
+ERROR: file-not-found ;
+
 : find-in-directories ( directories bfs? quot: ( obj -- ? ) -- path'/f )
-    '[ _ _ find-file ] attempt-all ;
+    [
+        '[ _ _ find-file [ file-not-found ] unless* ] attempt-all
+    ] [
+        drop f
+    ] recover ;
 
 : find-all-in-directories ( directories bfs? quot: ( obj -- ? ) -- paths/f )
     '[ _ _ find-all-files ] map concat ;
diff --git a/basis/io/directories/search/summary.txt b/basis/io/directories/search/summary.txt
new file mode 100644 (file)
index 0000000..a9df0ba
--- /dev/null
@@ -0,0 +1 @@
+Recursive directory traversal
index 1ef80b3438c481fa7a77ea56c1e01b4e366a2816..89e091f91914b622c7387899b4d5e4838628f2a0 100644 (file)
@@ -27,16 +27,8 @@ M: unix make-directory ( path -- )
 M: unix delete-directory ( path -- )
     normalize-path rmdir io-error ;
 
-: (copy-file) ( from to -- )
-    dup parent-directory make-directories
-    binary <file-writer> [
-        swap binary <file-reader> [
-            swap stream-copy
-        ] with-disposal
-    ] with-disposal ;
-
 M: unix copy-file ( from to -- )
-    [ normalize-path ] bi@ (copy-file) ;
+    [ normalize-path ] bi@ call-next-method ;
 
 : with-unix-directory ( path quot -- )
     [ opendir dup [ (io-error) ] unless ] dip
index a11edeb703d43fe9a671041eb646d31364cf0b08..9ef2b07322825d2033cc8d4ebd8b9b4d17bf4f74 100644 (file)
@@ -4,12 +4,12 @@ USING: math.parser arrays io.encodings sequences kernel assocs
 hashtables io.encodings.ascii generic parser classes.tuple words
 words.symbol io io.files splitting namespaces math
 compiler.units accessors classes.singleton classes.mixin
-io.encodings.iana ;
+io.encodings.iana fry ;
 IN: io.encodings.8-bit
 
 <PRIVATE
 
-: mappings {
+CONSTANT: mappings {
     ! encoding-name iana-name file-name
     { "latin1" "ISO_8859-1:1987" "8859-1" }
     { "latin2" "ISO_8859-2:1987" "8859-2" }
@@ -30,11 +30,10 @@ IN: io.encodings.8-bit
     { "windows-1252" "windows-1252" "CP1252" }
     { "ebcdic" "IBM037" "CP037" }
     { "mac-roman" "macintosh" "ROMAN" }
-} ;
+}
 
 : encoding-file ( file-name -- stream )
-    "resource:basis/io/encodings/8-bit/" swap ".TXT"
-    3append ascii <file-reader> ;
+    "vocab:io/encodings/8-bit/" ".TXT" surround ;
 
 : process-contents ( lines -- assoc )
     [ "#" split1 drop ] map harvest
@@ -42,13 +41,13 @@ IN: io.encodings.8-bit
 
 : byte>ch ( assoc -- array )
     256 replacement-char <array>
-    [ [ swapd set-nth ] curry assoc-each ] keep ;
+    [ '[ swap _ set-nth ] assoc-each ] keep ;
 
 : ch>byte ( assoc -- newassoc )
     [ swap ] assoc-map >hashtable ;
 
-: parse-file ( stream -- byte>ch ch>byte )
-    lines process-contents
+: parse-file ( path -- byte>ch ch>byte )
+    ascii file-lines process-contents
     [ byte>ch ] [ ch>byte ] bi ;
 
 SYMBOL: 8-bit-encodings
diff --git a/basis/io/encodings/8-bit/tags.txt b/basis/io/encodings/8-bit/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/basis/io/encodings/ascii/tags.txt b/basis/io/encodings/ascii/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/basis/io/encodings/binary/tags.txt b/basis/io/encodings/binary/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
index b0013b6e08fecc585761bad8a2a9bfb4b8fd5e63..1d6ef52d8d46e984544f4ffc104ec9c6bdf7cf43 100644 (file)
@@ -80,7 +80,7 @@ VALUE: gb>u
 VALUE: u>gb
 VALUE: mapping
 
-"resource:basis/io/encodings/chinese/gb-18030-2000.xml"
+"vocab:io/encodings/chinese/gb-18030-2000.xml"
 ascii <file-reader> xml>gb-data
 [ ranges-u>gb to: u>gb ] [ ranges-gb>u to: gb>u ] bi
 >biassoc to: mapping
diff --git a/basis/io/encodings/chinese/summary.txt b/basis/io/encodings/chinese/summary.txt
new file mode 100644 (file)
index 0000000..da29694
--- /dev/null
@@ -0,0 +1 @@
+GB18030 encoding for Chinese text
index 6afae924292620cf3fb746931cf3193d1323de98..a8555ac3393bc74d70d633eed2765e04d69e263a 100644 (file)
@@ -21,14 +21,14 @@ ERROR: missing-name encoding ;
     dup e>n-table get-global at [ ] [ missing-name ] ?if ;
 
 <PRIVATE
-: parse-iana ( stream -- synonym-set )
-    lines { "" } split [
+: parse-iana ( file -- synonym-set )
+    utf8 file-lines { "" } split [
         [ " " split ] map
         [ first { "Name:" "Alias:" } member? ] filter
         [ second ] map { "None" } diff
     ] map harvest ;
 
-: make-aliases ( stream -- n>e )
+: make-aliases ( file -- n>e )
     parse-iana [ [ first ] [ ] bi ] H{ } map>assoc ;
 
 : initial-n>e ( -- assoc )
@@ -44,8 +44,8 @@ ERROR: missing-name encoding ;
 
 PRIVATE>
 
-"resource:basis/io/encodings/iana/character-sets"
-utf8 <file-reader> make-aliases aliases set-global
+"vocab:io/encodings/iana/character-sets"
+make-aliases aliases set-global
 
 n>e-table [ initial-n>e ] initialize
 e>n-table [ initial-e>n ] initialize
index 194ade377b244b827237ea739285e5f1ac0f8762..8f38f597ca8097085b9c7e1ee347fbafb4b94541 100644 (file)
@@ -44,10 +44,10 @@ TUPLE: jis assoc ;
 : make-jis ( filename -- jis )
     ascii file-lines process-jis <jis> ;
 
-"resource:basis/io/encodings/japanese/CP932.txt"
+"vocab:io/encodings/japanese/CP932.txt"
 make-jis to: windows-31j-table
 
-"resource:basis/io/encodings/japanese/sjis-0208-1997-std.txt"
+"vocab:io/encodings/japanese/sjis-0208-1997-std.txt"
 make-jis to: shift-jis-table
 
 : small? ( char -- ? )
diff --git a/basis/io/encodings/japanese/tags.txt b/basis/io/encodings/japanese/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2500e794a73a06dbb509382d1d9685fea093df82 100644 (file)
@@ -0,0 +1,14 @@
+! Copyright (C) 2009 Yun, Jonghyouk.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.syntax help.markup ;
+IN: io.encodings.korean
+
+ARTICLE: "io.encodings.korean" "Korean text encodings"
+"The " { $vocab-link "io.encodings.korean" } " vocabulary implements encodings used for Korean text besides the standard UTF encodings for Unicode strings."
+{ $subsection cp949 } ;
+
+ABOUT: "io.encodings.korean"
+
+HELP: cp949
+{ $class-description "This encoding class implements Microsoft's code page #949 encoding, also called Unified Hangul Code or ks_c_5601-1987, UHC. CP949 is extended version of EUC-KR and downward-compatibility to EUC-KR. " }
+{ $see-also "encodings-introduction" } ;
index 4f387d89878a7b1517826daa6f48f85a1b8d40f2..a021cfce33c84b9967bd2b6b818a2a6f96567852 100644 (file)
@@ -6,6 +6,8 @@ math.order math.parser memoize multiline sequences splitting
 values hashtables io.binary ;
 IN: io.encodings.korean
 
+! TODO: migrate to common code-table parser (by Dan).
+
 SINGLETON: cp949
 
 cp949 "EUC-KR" register-encoding
@@ -17,7 +19,7 @@ cp949 "EUC-KR" register-encoding
 : cp949.txt-lines ( -- seq )
     ! "cp949.txt" from ...
     ! <http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP949.TXT>
-    "resource:basis/io/encodings/korean/data/cp949.txt"
+    "vocab:io/encodings/korean/data/cp949.txt"
     ascii file-lines ;
 
 : drop-comments ( seq -- newseq )
diff --git a/basis/io/encodings/korean/tags.txt b/basis/io/encodings/korean/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/basis/io/encodings/strict/tags.txt b/basis/io/encodings/strict/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
index 59b8927dea9ba7edab4b606da9c10da62f746a4c..da2f7957b2518457238a160145674b9d66238c0d 100644 (file)
@@ -1 +1 @@
-Encoding and decoding strings
+Converting strings to byte arrays and vice versa
diff --git a/basis/io/encodings/string/tags.factor b/basis/io/encodings/string/tags.factor
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/basis/io/encodings/string/tags.txt b/basis/io/encodings/string/tags.txt
new file mode 100644 (file)
index 0000000..8e27be7
--- /dev/null
@@ -0,0 +1 @@
+text
diff --git a/basis/io/encodings/utf16/tags.txt b/basis/io/encodings/utf16/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
diff --git a/basis/io/encodings/utf16n/summary.txt b/basis/io/encodings/utf16n/summary.txt
new file mode 100644 (file)
index 0000000..4d94d1b
--- /dev/null
@@ -0,0 +1 @@
+UTF16 encoding with native byte order
diff --git a/basis/io/encodings/utf32/tags.txt b/basis/io/encodings/utf32/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
index 5dddca4f9d005928402609ee44f0a29f2b3afbf4..72401004ae96dd0cf77222273e3e0f85eeddbb51 100644 (file)
@@ -72,13 +72,14 @@ M: linux file-systems
     ] map ;
 
 : (find-mount-point) ( path mtab-paths -- mtab-entry )
-    [ follow-links ] dip 2dup at* [
+    2dup at* [
         2nip
     ] [
         drop [ parent-directory ] dip (find-mount-point)
     ] if ;
 
 : find-mount-point ( path -- mtab-entry )
+    canonicalize-path
     parse-mtab [ [ mount-point>> ] keep ] H{ } map>assoc (find-mount-point) ;
 
 ERROR: file-system-not-found ;
index b7edc14c2ca76b5abdf0b17f6d5e1616bc985610..616f70ccccac90167df568de923247d33c7395e5 100644 (file)
@@ -114,21 +114,21 @@ M: file-info file-mode? [ permissions>> ] dip mask? ;
 
 PRIVATE>
 
-: UID           OCT: 0004000 ; inline
-: GID           OCT: 0002000 ; inline
-: STICKY        OCT: 0001000 ; inline
-: USER-ALL      OCT: 0000700 ; inline
-: USER-READ     OCT: 0000400 ; inline
-: USER-WRITE    OCT: 0000200 ; inline
-: USER-EXECUTE  OCT: 0000100 ; inline
-: GROUP-ALL     OCT: 0000070 ; inline
-: GROUP-READ    OCT: 0000040 ; inline
-: GROUP-WRITE   OCT: 0000020 ; inline
-: GROUP-EXECUTE OCT: 0000010 ; inline
-: OTHER-ALL     OCT: 0000007 ; inline
-: OTHER-READ    OCT: 0000004 ; inline
-: OTHER-WRITE   OCT: 0000002 ; inline
-: OTHER-EXECUTE OCT: 0000001 ; inline
+CONSTANT: UID           OCT: 0004000
+CONSTANT: GID           OCT: 0002000
+CONSTANT: STICKY        OCT: 0001000
+CONSTANT: USER-ALL      OCT: 0000700
+CONSTANT: USER-READ     OCT: 0000400
+CONSTANT: USER-WRITE    OCT: 0000200
+CONSTANT: USER-EXECUTE  OCT: 0000100
+CONSTANT: GROUP-ALL     OCT: 0000070
+CONSTANT: GROUP-READ    OCT: 0000040
+CONSTANT: GROUP-WRITE   OCT: 0000020
+CONSTANT: GROUP-EXECUTE OCT: 0000010
+CONSTANT: OTHER-ALL     OCT: 0000007
+CONSTANT: OTHER-READ    OCT: 0000004
+CONSTANT: OTHER-WRITE   OCT: 0000002
+CONSTANT: OTHER-EXECUTE OCT: 0000001
 
 : uid? ( obj -- ? ) UID file-mode? ;
 : gid? ( obj -- ? ) GID file-mode? ;
index 2f38c39e02a3a91a835e5d9b7362ef6ceeb7e807..7d2a6ee4f3c31b474388fc6f78589a39e2850ece 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: io.backend io.files.links system unix ;
+USING: io.backend io.files.links system unix io.pathnames kernel
+io.files sequences ;
 IN: io.files.links.unix
 
 M: unix make-link ( path1 path2 -- )
@@ -8,3 +9,7 @@ M: unix make-link ( path1 path2 -- )
 
 M: unix read-link ( path -- path' )
     normalize-path read-symbolic-link ;
+
+M: unix canonicalize-path ( path -- path' )
+    path-components "/"
+    [ append-path dup exists? [ follow-links ] when ] reduce ;
diff --git a/basis/io/files/types/summary.txt b/basis/io/files/types/summary.txt
new file mode 100644 (file)
index 0000000..1e0118a
--- /dev/null
@@ -0,0 +1 @@
+File types for file-info and directory listing
diff --git a/basis/io/files/unique/summary.txt b/basis/io/files/unique/summary.txt
new file mode 100644 (file)
index 0000000..08584aa
--- /dev/null
@@ -0,0 +1 @@
+Temporary files with unique names
diff --git a/basis/io/pipes/summary.txt b/basis/io/pipes/summary.txt
new file mode 100644 (file)
index 0000000..3a1f8c7
--- /dev/null
@@ -0,0 +1 @@
+Pipes for inter-process communication
index bc909152138e753b1fe0806b7b56f2d22d8ae35d..589a50d2ebf58063d4e25f1813150fdf766ea77f 100644 (file)
@@ -12,6 +12,7 @@ IN: io.servers.connection
 
 TUPLE: threaded-server
 name
+log-level
 secure insecure
 secure-config
 sockets
@@ -29,6 +30,7 @@ ready ;
 : new-threaded-server ( class -- threaded-server )
     new
         "server" >>name
+        DEBUG >>log-level
         ascii >>encoding
         1 minutes >>timeout
         V{ } clone >>sockets
@@ -115,7 +117,7 @@ M: threaded-server handle-client* handler>> call ;
 : (start-server) ( threaded-server -- )
     init-server
     dup threaded-server [
-        dup name>> [
+        [ ] [ name>> ] bi [
             [ listen-on [ start-accept-loop ] parallel-each ]
             [ ready>> raise-flag ]
             bi
diff --git a/basis/io/servers/packet/datagram.factor b/basis/io/servers/packet/datagram.factor
deleted file mode 100644 (file)
index c081dfb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-IN: io.servers.datagram
-
-<PRIVATE
-
-LOG: received-datagram NOTICE
-
-: datagram-loop ( quot datagram -- )
-    [
-        [ receive dup received-datagram [ swap call ] dip ] keep
-        pick [ send ] [ 3drop ] if
-    ] 2keep datagram-loop ; inline
-
-: spawn-datagrams ( quot addrspec -- )
-    <datagram> [ datagram-loop ] with-disposal ; inline
-
-\ spawn-datagrams NOTICE add-input-logging
-
-PRIVATE>
-
-: with-datagrams ( seq service quot -- )
-    '[ [ [ _ ] dip spawn-datagrams ] parallel-each ] with-logging ; inline
diff --git a/basis/io/servers/packet/packet.factor b/basis/io/servers/packet/packet.factor
new file mode 100644 (file)
index 0000000..2a346b4
--- /dev/null
@@ -0,0 +1,23 @@
+USING: concurrency.combinators destructors fry
+io.sockets kernel logging ;
+IN: io.servers.packet
+
+<PRIVATE
+
+LOG: received-datagram NOTICE
+
+: datagram-loop ( quot datagram -- )
+    [
+        [ receive dup received-datagram [ swap call ] dip ] keep
+        pick [ send ] [ 3drop ] if
+    ] 2keep datagram-loop ; inline
+
+: spawn-datagrams ( quot addrspec -- )
+    <datagram> [ datagram-loop ] with-disposal ; inline
+
+\ spawn-datagrams NOTICE add-input-logging
+
+PRIVATE>
+
+: with-datagrams ( seq service quot -- )
+    '[ [ [ _ ] dip spawn-datagrams ] parallel-each ] with-logging ; inline
index 557bba52d267c66b71fb86a05cdfcfbccf1b4aee..b5af1301688b9e1e97b5c87facefe3e8520166b9 100644 (file)
@@ -5,8 +5,8 @@ USING: accessors kernel io.sockets io.sockets.secure tools.test ;
 
 [ ] [
     <secure-config>
-        "resource:basis/openssl/test/server.pem" >>key-file
-        "resource:basis/openssl/test/dh1024.pem" >>dh-file
+        "vocab:openssl/test/server.pem" >>key-file
+        "vocab:openssl/test/dh1024.pem" >>dh-file
         "password" >>password
     [ ] with-secure-context
 ] unit-test
index c4a1475f4871b5c76cada33ddfafc1b18cb078ff..bff2dbaf1a22d4e3765ef3f7760200efb6fd749e 100644 (file)
@@ -26,7 +26,7 @@ ephemeral-key-bits ;
     secure-config new
         SSLv23 >>method
         1024 >>ephemeral-key-bits
-        "resource:basis/openssl/cacert.pem" >>ca-file
+        "vocab:openssl/cacert.pem" >>ca-file
         t >>verify ;
 
 TUPLE: secure-context config handle disposed ;
index d32cdee2ed7e9fc8a865ee80dccca0c1968cca50..10df82ae7bf28ee8b4ad186219fae9a56eb61d98 100644 (file)
@@ -5,7 +5,7 @@ IN: io.sockets.secure.unix.debug
 
 : with-test-context ( quot -- )
     <secure-config>
-        "resource:basis/openssl/test/server.pem" >>key-file
-        "resource:basis/openssl/test/dh1024.pem" >>dh-file
+        "vocab:openssl/test/server.pem" >>key-file
+        "vocab:openssl/test/dh1024.pem" >>dh-file
         "password" >>password
     swap with-secure-context ; inline
index e701874afd951753c8959a79e63ca6887c224fb3..799dfa78d53be343e6224a08b653cf1458e37226 100644 (file)
@@ -94,7 +94,7 @@ M: unix (datagram)
 
 SYMBOL: receive-buffer
 
-: packet-size 65536 ; inline
+CONSTANT: packet-size 65536
 
 [ packet-size malloc receive-buffer set-global ] "io.sockets.unix" add-init-hook
 
diff --git a/basis/io/streams/byte-array/summary.txt b/basis/io/streams/byte-array/summary.txt
new file mode 100644 (file)
index 0000000..2f0b772
--- /dev/null
@@ -0,0 +1 @@
+Streams for reading and writing bytes in a byte array
diff --git a/basis/io/streams/limited/summary.txt b/basis/io/streams/limited/summary.txt
new file mode 100644 (file)
index 0000000..3861434
--- /dev/null
@@ -0,0 +1 @@
+Streams with a maximum length cutoff
diff --git a/basis/io/streams/memory/summary.txt b/basis/io/streams/memory/summary.txt
new file mode 100644 (file)
index 0000000..b0ecbf6
--- /dev/null
@@ -0,0 +1 @@
+Streams for reading data directly from memory
diff --git a/basis/lcs/diff2html/summary.txt b/basis/lcs/diff2html/summary.txt
new file mode 100644 (file)
index 0000000..066e78a
--- /dev/null
@@ -0,0 +1 @@
+Pretty HTML rendering of diffs
index 7a259ee59ae26932130dc175a0479efb6675a397..5030e93abc955492392a6f5b6e813ec4b2153257 100644 (file)
@@ -54,4 +54,12 @@ IN: linked-assocs.test
     { [ [ 1- ] bi@ ] [ 2 / ] }  "second"  pick set-at
     4 6 pick values [ first call ] each
     + swap values <reversed> [ second call ] each
+] unit-test
+
+{ V{ { "az" 1 } { "by" 2 } { "cx" 3 } } } [
+    <linked-hash>
+    1 "az" pick set-at
+    2 "by" pick set-at
+    3 "cx" pick set-at
+    >alist
 ] unit-test
\ No newline at end of file
diff --git a/basis/lists/lazy/examples/summary.txt b/basis/lists/lazy/examples/summary.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/basis/locals/backend/summary.txt b/basis/locals/backend/summary.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/basis/locals/definitions/summary.txt b/basis/locals/definitions/summary.txt
new file mode 100644 (file)
index 0000000..e08d7bf
--- /dev/null
@@ -0,0 +1 @@
+Definition protocol implementation for lambda words
diff --git a/basis/locals/errors/summary.txt b/basis/locals/errors/summary.txt
new file mode 100644 (file)
index 0000000..a5d40df
--- /dev/null
@@ -0,0 +1 @@
+Errors thrown by locals implementation
diff --git a/basis/locals/fry/summary.txt b/basis/locals/fry/summary.txt
new file mode 100644 (file)
index 0000000..2173b22
--- /dev/null
@@ -0,0 +1 @@
+Support for mixing fry and locals
diff --git a/basis/locals/macros/summary.txt b/basis/locals/macros/summary.txt
new file mode 100644 (file)
index 0000000..92b4c4c
--- /dev/null
@@ -0,0 +1 @@
+Support for macro expansion inside lambdas
diff --git a/basis/locals/parser/summary.txt b/basis/locals/parser/summary.txt
new file mode 100644 (file)
index 0000000..095b0e2
--- /dev/null
@@ -0,0 +1 @@
+Utility words used by locals parsing words
diff --git a/basis/locals/prettyprint/summary.txt b/basis/locals/prettyprint/summary.txt
new file mode 100644 (file)
index 0000000..ecfc104
--- /dev/null
@@ -0,0 +1 @@
+Prettyprinting of lambdas
diff --git a/basis/locals/rewrite/closures/summary.txt b/basis/locals/rewrite/closures/summary.txt
new file mode 100644 (file)
index 0000000..d0a28aa
--- /dev/null
@@ -0,0 +1 @@
+Rewriting closures to not have any free variables
diff --git a/basis/locals/rewrite/point-free/summary.txt b/basis/locals/rewrite/point-free/summary.txt
new file mode 100644 (file)
index 0000000..40ab193
--- /dev/null
@@ -0,0 +1 @@
+Rewriting applicative code to use the retain stack instead of named values
diff --git a/basis/locals/rewrite/sugar/summary.txt b/basis/locals/rewrite/sugar/summary.txt
new file mode 100644 (file)
index 0000000..485bb84
--- /dev/null
@@ -0,0 +1 @@
+Desugaring locals in literals and let binding
diff --git a/basis/locals/types/summary.txt b/basis/locals/types/summary.txt
new file mode 100644 (file)
index 0000000..be667d0
--- /dev/null
@@ -0,0 +1 @@
+Data types used by locals implementation
index 275d900f3dff82c29120d396d930bff0bfb22816..a4b3f3f019998f879827a5538a3cc890fb1fbe30 100644 (file)
@@ -8,6 +8,9 @@ HELP: DEBUG
 HELP: NOTICE
 { $description "Log level for ordinary messages." } ;
 
+HELP: WARNING
+{ $description "Log level for warnings." } ;
+
 HELP: ERROR
 { $description "Log level for error messages." } ;
 
@@ -18,6 +21,7 @@ ARTICLE: "logging.levels" "Log levels"
 "Several log levels are supported, from lowest to highest:"
 { $subsection DEBUG }
 { $subsection NOTICE }
+{ $subsection WARNING }
 { $subsection ERROR }
 { $subsection CRITICAL } ;
 
@@ -36,7 +40,7 @@ ARTICLE: "logging.files" "Log files"
 
 HELP: log-message
 { $values { "msg" string } { "word" word } { "level" "a log level" } }
-{ $description "Sends a message to the current log. Does nothing if not executing in a dynamic scope established by " { $link with-logging } "." } ;
+{ $description "Sends a message to the current log if the level is more urgent than " { $link log-level } ". Does nothing if not executing in a dynamic scope established by " { $link with-logging } "." } ;
 
 HELP: add-logging
 { $values { "level" "a log level" } { "word" word } }
@@ -91,7 +95,7 @@ HELP: close-logs
 
 HELP: with-logging
 { $values { "service" "a log service name" } { "quot" quotation } }
-{ $description "Calls the quotation a new dynamic scope where all logging calls are sent to the log file for " { $snippet "service" } "." } ;
+{ $description "Calls the quotation a new dynamic scope where all logging calls more urgent than " { $link log-level } " are sent to the log file for " { $snippet "service" } "." } ;
 
 ARTICLE: "logging.rotation" "Log rotation"
 "Log files should be rotated periodically to prevent unbounded growth."
@@ -120,4 +124,3 @@ ARTICLE: "logging" "Logging framework"
 { $subsection "logging.server" } ;
 
 ABOUT: "logging"
-
index 6769932c886ab54b2a65690115fea9bb1c45bc94..e295960baa81f219866017f2e44022624f72dc6a 100644 (file)
@@ -4,25 +4,47 @@ USING: logging.server sequences namespaces concurrency.messaging
 words kernel arrays shuffle tools.annotations\r
 prettyprint.config prettyprint debugger io.streams.string\r
 splitting continuations effects generalizations parser strings\r
-quotations fry accessors ;\r
+quotations fry accessors math assocs math.order ;\r
 IN: logging\r
 \r
 SYMBOLS: DEBUG NOTICE WARNING ERROR CRITICAL ;\r
 \r
-: log-levels { DEBUG NOTICE NOTICE WARNING ERROR CRITICAL } ;\r
+SYMBOL: log-level\r
+\r
+log-level [ DEBUG ] initialize\r
+\r
+: log-levels ( -- assoc )\r
+    H{\r
+        { DEBUG 0 }\r
+        { NOTICE 10 }\r
+        { WARNING 20 }\r
+        { ERROR 30 }\r
+        { CRITICAL 40 }\r
+    } ;\r
+\r
+ERROR: undefined-log-level ;\r
+\r
+: log-level<=> ( log-level log-level -- ? )\r
+    [ log-levels at* [ undefined-log-level ] unless ] bi@ <=> ;\r
+\r
+: log? ( log-level -- ? )\r
+    log-level get log-level<=> +lt+ = not ;\r
 \r
 : send-to-log-server ( array string -- )\r
     prefix "log-server" get send ;\r
 \r
 SYMBOL: log-service\r
 \r
+ERROR: bad-log-message-parameters msg word level ;\r
+\r
 : check-log-message ( msg word level -- msg word level )\r
     3dup [ string? ] [ word? ] [ word? ] tri* and and\r
-    [ "Bad parameters to log-message" throw ] unless ; inline\r
+    [ bad-log-message-parameters ] unless ; inline\r
 \r
 : log-message ( msg word level -- )\r
     check-log-message\r
-    log-service get dup [\r
+    log-service get\r
+    2dup [ log? ] [ ] bi* and [\r
         [ [ string-lines ] [ name>> ] [ name>> ] tri* ] dip\r
         4array "log-message" send-to-log-server\r
     ] [\r
@@ -36,7 +58,7 @@ SYMBOL: log-service
     { } "close-logs" send-to-log-server ;\r
 \r
 : with-logging ( service quot -- )\r
-    log-service swap with-variable ; inline\r
+    [ log-service ] dip with-variable ; inline\r
 \r
 ! Aspect-oriented programming idioms\r
 \r
index 07a84ec5c6973f3c02730f31d83dbe404370701a..5406d8fcd0796d1e4a82377e4f3601df5270aa17 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors peg peg.parsers memoize kernel sequences\r
 logging arrays words strings vectors io io.files\r
 io.encodings.utf8 namespaces make combinators logging.server\r
-calendar calendar.format ;\r
+calendar calendar.format assocs ;\r
 IN: logging.parser\r
 \r
 TUPLE: log-entry date level word-name message ;\r
@@ -21,7 +21,7 @@ SYMBOL: multiline
     "[" "]" surrounded-by ;\r
 \r
 : 'log-level' ( -- parser )\r
-    log-levels [\r
+    log-levels keys [\r
         [ name>> token ] keep [ nip ] curry action\r
     ] map choice ;\r
 \r
index 618dba544cb8637e7d7e92b367735803350600b7..7dced852fd18411963168d10c871a36a0c38bf04 100644 (file)
@@ -63,7 +63,7 @@ SYMBOL: log-files
     dup values [ try-dispose ] each\r
     clear-assoc ;\r
 \r
-: keep-logs 10 ;\r
+CONSTANT: keep-logs 10\r
 \r
 : ?delete-file ( path -- )\r
     dup exists? [ delete-file ] [ drop ] if ;\r
diff --git a/basis/macros/expander/summary.txt b/basis/macros/expander/summary.txt
new file mode 100644 (file)
index 0000000..0fd81ed
--- /dev/null
@@ -0,0 +1 @@
+Macro expansion utility, used for debugging and in the locals implementation
index 4fba7efba3890be862ea629c0acc5f97e78f18cf..21a91e567d4e193756b3f03a41d47e53268cdf5b 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: parser kernel sequences words effects combinators assocs
 definitions quotations namespaces memoize accessors ;
@@ -7,7 +7,7 @@ IN: macros
 <PRIVATE
 
 : real-macro-effect ( word -- effect' )
-    "declared-effect" word-prop in>> 1 <effect> ;
+    stack-effect in>> 1 <effect> ;
 
 PRIVATE>
 
diff --git a/basis/math/bits/authors.txt b/basis/math/bits/authors.txt
new file mode 100644 (file)
index 0000000..f990dd0
--- /dev/null
@@ -0,0 +1 @@
+Daniel Ehrenberg
diff --git a/basis/math/bits/bits-docs.factor b/basis/math/bits/bits-docs.factor
new file mode 100644 (file)
index 0000000..6ae83f7
--- /dev/null
@@ -0,0 +1,26 @@
+! Copyright (C) 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.syntax help.markup math ;
+IN: math.bits
+
+ABOUT: "math.bits"
+
+ARTICLE: "math.bits" "Number bits virtual sequence"
+{ $subsection bits }
+{ $subsection <bits> }
+{ $subsection make-bits } ;
+
+HELP: bits
+{ $class-description "Virtual sequence class of bits of a number. The first bit is the least significant bit. This can be constructed with " { $link <bits> } " or " { $link make-bits } "." } ;
+
+HELP: <bits>
+{ $values { "number" integer } { "length" integer } { "bits" bits } }
+{ $description "Creates a virtual sequence of bits of a number in little endian order, with the given length." } ;
+
+HELP: make-bits
+{ $values { "number" integer } { "bits" bits } }
+{ $description "Creates a " { $link bits } " object out of the given number, using its log base 2 as the length. This implies that the last element, corresponding to the most significant bit, will be 1." }
+{ $examples
+    { $example "USING: math.bits prettyprint arrays ;" "BIN: 1101 make-bits >array ." "{ t f t t }" }
+    { $example "USING: math.bits prettyprint arrays ;" "-3 make-bits >array ." "{ t f }" }
+} ;
diff --git a/basis/math/bits/bits-tests.factor b/basis/math/bits/bits-tests.factor
new file mode 100644 (file)
index 0000000..ed4e841
--- /dev/null
@@ -0,0 +1,31 @@
+! Copyright (C) 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test math math.bits sequences arrays ;
+IN: math.bits.tests
+
+[ t ] [ BIN: 111111 3 <bits> second ] unit-test
+[ { t t t } ] [ BIN: 111111 3 <bits> >array ] unit-test
+[ f ] [ BIN: 111101 3 <bits> second ] unit-test
+[ { f f t } ] [ BIN: 111100 3 <bits> >array ] unit-test
+[ 3 ] [ BIN: 111111 3 <bits> length ] unit-test
+[ 6 ] [ BIN: 111111 make-bits length ] unit-test
+[ 0 ] [ 0 make-bits length ] unit-test
+[ 2 ] [ 3 make-bits length ] unit-test
+[ 2 ] [ -3 make-bits length ] unit-test
+[ 1 ] [ 1 make-bits length ] unit-test
+[ 1 ] [ -1 make-bits length ] unit-test
+
+! Odd bug
+[ t ] [
+    1067811677921310779 make-bits
+    1067811677921310779 >bignum make-bits
+    sequence=
+] unit-test
+
+[ t ] [
+    1067811677921310779 make-bits peek
+] unit-test
+
+[ t ] [
+    1067811677921310779 >bignum make-bits peek
+] unit-test
\ No newline at end of file
diff --git a/basis/math/bits/bits.factor b/basis/math/bits/bits.factor
new file mode 100644 (file)
index 0000000..8920955
--- /dev/null
@@ -0,0 +1,16 @@
+! Copyright (C) 2009 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: sequences kernel math accessors sequences.private ;
+IN: math.bits
+
+TUPLE: bits { number read-only } { length read-only } ;
+C: <bits> bits
+
+: make-bits ( number -- bits )
+    dup zero? [ drop T{ bits f 0 0 } ] [ dup abs log2 1+ <bits> ] if ; inline
+
+M: bits length length>> ;
+
+M: bits nth-unsafe number>> swap bit? ;
+
+INSTANCE: bits immutable-sequence
diff --git a/basis/math/bits/summary.txt b/basis/math/bits/summary.txt
new file mode 100644 (file)
index 0000000..265a7b8
--- /dev/null
@@ -0,0 +1 @@
+Virtual sequence for bits of an integer
index 40eb20642c55cc19e34234f56958d48de828ce4c..7698760f84f5db4146c3fbb7e125323e4a59f91f 100644 (file)
@@ -19,8 +19,8 @@ IN: math.bitwise.tests
 [ 268 ] [ 1 { 8 { 3 2 } } bitfield ] unit-test
 [ 512 ] [ 1 { { 1+ 8 } } bitfield ] unit-test
 
-: a 1 ; inline
-: b 2 ; inline
+CONSTANT: a 1
+CONSTANT: b 2
 
 : foo ( -- flags ) { a b } flags ;
 
index 339703c0a6f3299fa0d8445851e5cf100818ef5c..4f639c02a7ce5d6cbbe29f8c5f2e42ecf5d535ae 100755 (executable)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007, 2008 Slava Pestov, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays kernel math math.functions sequences
+USING: arrays kernel math sequences accessors math.bits
 sequences.private words namespaces macros hints
 combinators fry io.binary combinators.smart ;
 IN: math.bitwise
@@ -65,7 +65,7 @@ DEFER: byte-bit-count
 
 \ byte-bit-count
 256 [
-    0 swap [ [ 1+ ] when ] each-bit
+    8 <bits> 0 [ [ 1+ ] when ] reduce
 ] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ]
 (( byte -- table )) define-declared
 
index ea3da550829cebc94fab39344282fcde22320c2a..33a5d96fc468dffd5bea90fe287fdc2d72b75f66 100644 (file)
@@ -235,7 +235,7 @@ HELP: arg
 
 HELP: >polar
 { $values { "z" number } { "abs" "a non-negative real number" } { "arg" "a number in the interval " { $snippet "(-pi,pi]" } } }
-{ $description "Creates a complex number from an absolute value and argument (polar form)." } ;
+{ $description "Converts a complex number into an absolute value and argument (polar form)." } ;
 
 HELP: cis
 { $values { "arg" "a real number" } { "z" "a complex number on the unit circle" } }
@@ -278,14 +278,6 @@ HELP: mod-inv
     { $example "USING: math prettyprint ;" "173 815 * 1119 mod ." "1" }
 } ;
 
-HELP: each-bit
-{ $values { "n" integer } { "quot" { $quotation "( ? -- )" } } }
-{ $description "Applies the quotation to each bit of the integer, starting from the least significant bit, and stopping at the last bit from which point on all bits are either clear (if the integer is positive) or all bits are set (if the integer is negataive)." }
-{ $examples
-    { $example "USING: math.functions make prettyprint ;" "[ BIN: 1101 [ , ] each-bit ] { } make ." "{ t f t t }" }
-    { $example "USING: math.functions make prettyprint ;" "[ -3 [ , ] each-bit ] { } make ." "{ t f }" }
-} ;
-
 HELP: ~
 { $values { "x" real } { "y" real } { "epsilon" real } { "?" "a boolean" } }
 { $description "Tests if " { $snippet "x" } " and " { $snippet "y" } " are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of " { $snippet "epsilon" } ":"
index cf0ce5f0bb5642b7f72e84fa6022a50eca9f9473..9f5ce36be1fb593bafc1277b6e7e86f592476539 100644 (file)
@@ -137,3 +137,17 @@ IN: math.functions.tests
 
 [ 6 59967 ] [ 3837888 factor-2s ] unit-test
 [ 6 -59967 ] [ -3837888 factor-2s ] unit-test
+
+[ 1 ] [
+    183009416410801897
+    1067811677921310779
+    2135623355842621559
+    ^mod
+] unit-test
+
+[ 1 ] [
+    183009416410801897
+    1067811677921310779
+    2135623355842621559
+    [ >bignum ] tri@ ^mod
+] unit-test
\ No newline at end of file
index 85b4d711ac045e1bf726c8e0828a0ec933e0d087..7e2ac0884ca9edae5a042c7507544aa4df370e40 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2004, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: math kernel math.constants math.private
+USING: math kernel math.constants math.private math.bits
 math.libm combinators math.order sequences ;
 IN: math.functions
 
@@ -26,16 +26,6 @@ GENERIC: sqrt ( x -- y ) foldable
 M: real sqrt
     >float dup 0.0 < [ neg fsqrt 0.0 swap rect> ] [ fsqrt ] if ;
 
-: each-bit ( n quot: ( ? -- ) -- )
-    over [ 0 = ] [ -1 = ] bi or [
-        2drop
-    ] [
-        2dup { [ odd? ] [ call ] [ 2/ ] [ each-bit ] } spread
-    ] if ; inline recursive
-
-: map-bits ( n quot: ( ? -- obj ) -- seq )
-    accumulator [ each-bit ] dip ; inline
-
 : factor-2s ( n -- r s )
     #! factor an integer into 2^r * s
     dup 0 = [ 1 ] [
@@ -47,7 +37,7 @@ M: real sqrt
 GENERIC# ^n 1 ( z w -- z^w )
 
 : (^n) ( z w -- z^w )
-    1 swap [ [ dupd * ] when [ sq ] dip ] each-bit nip ; inline
+    make-bits 1 [ [ dupd * ] when [ sq ] dip ] reduce nip ; inline
 
 M: integer ^n
     [ factor-2s ] dip [ (^n) ] keep rot * shift ;
@@ -94,9 +84,9 @@ PRIVATE>
     dup zero? [ drop 0./0. ] [ 0 < 1./0. 0 ? ] if ; inline
 
 : (^mod) ( n x y -- z )
-    1 swap [
+    make-bits 1 [
         [ dupd * pick mod ] when [ sq over mod ] dip
-    ] each-bit 2nip ; inline
+    ] reduce 2nip ; inline
 
 : (gcd) ( b a x y -- a d )
     over zero? [
index 9ca85ea72c5681a63510afb795d8ee914b2d9ae6..5f1b9835e49c32b9739cfd59663d5f7d06e8fa57 100644 (file)
@@ -7,4 +7,5 @@ IN: math.miller-rabin.tests
 [ f ] [ 36 miller-rabin ] unit-test
 [ t ] [ 37 miller-rabin ] unit-test
 [ 101 ] [ 100 next-prime ] unit-test
-[ 100000000000031 ] [ 100000000000000 next-prime ] unit-test
+[ t ] [ 2135623355842621559 miller-rabin ] unit-test
+[ 100000000000031 ] [ 100000000000000 next-prime ] unit-test
\ No newline at end of file
diff --git a/basis/math/partial-dispatch/summary.txt b/basis/math/partial-dispatch/summary.txt
new file mode 100644 (file)
index 0000000..a1bc1a1
--- /dev/null
@@ -0,0 +1 @@
+Partially-dispatched math operations, used by the compiler
index bc6da9f5643360c50f8cb6100bd212a987cc738c..f2c2c6d226051727e007403d6e002deb1fa30037 100755 (executable)
@@ -45,13 +45,13 @@ PRIVATE>
     first2 [ imaginary-part ] dip >rect 3array ;
 
 ! Zero
-: q0 { 0 0 } ;
+CONSTANT: q0 { 0 0 }
 
 ! Units
-: q1 { 1 0 } ;
-: qi { C{ 0 1 } 0 } ;
-: qj { 0 1 } ;
-: qk { 0 C{ 0 1 } } ;
+CONSTANT: q1 { 1 0 }
+CONSTANT: qi { C{ 0 1 } 0 }
+CONSTANT: qj { 0 1 }
+CONSTANT: qk { 0 C{ 0 1 } }
 
 ! Euler angles
 
index 7ee56866cecd823dde9e3d1f3fc2f650d80f251c..03549d9b80601f72311eeb78aec1a7160d59481f 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007 Slava Pestov, Daniel Ehrenberg.
+! Copyright (C) 2007, 2009 Slava Pestov, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: math kernel memoize tools.test parser generalizations
 prettyprint io.streams.string sequences eval ;
@@ -17,6 +17,10 @@ MEMO: see-test ( a -- b ) reverse ;
 [ [ \ see-test see ] with-string-writer ]
 unit-test
 
-[ ] [ "IN: memoize.tests : fib ;" eval ] unit-test
+[ ] [ "IN: memoize.tests : fib ( -- ) ;" eval ] unit-test
 
 [ "IN: memoize.tests\n: fib ( -- ) ;\n" ] [ [ \ fib see ] with-string-writer ] unit-test
+
+[ sq ] (( a -- b )) memoize-quot "q" set
+
+[ 9 ] [ 3 "q" get call ] unit-test
index 7b8c30c534fb8e99ad2eddfe2a4d13f3f97f7ce4..3bc573dff513c73bb0bb3d3d0efc2e9aea616509 100644 (file)
@@ -1,47 +1,45 @@
-! Copyright (C) 2007 Slava Pestov, Daniel Ehrenberg.
+! Copyright (C) 2007, 2009 Slava Pestov, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel hashtables sequences arrays words namespaces make
 parser math assocs effects definitions quotations summary
-accessors ;
+accessors fry ;
 IN: memoize
 
-: packer ( n -- quot )
-    { [ f ] [ ] [ 2array ] [ 3array ] [ 4array ] } nth ;
+ERROR: too-many-arguments ;
 
-: unpacker ( n -- quot )
-    { [ drop ] [ ] [ first2 ] [ first3 ] [ first4 ] } nth ;
+M: too-many-arguments summary
+    drop "There must be no more than 4 input and 4 output arguments" ;
 
-: #in ( word -- n )
-    stack-effect in>> length ;
+<PRIVATE
 
-: #out ( word -- n )
-    stack-effect out>> length ;
+: packer ( seq -- quot )
+    length { [ f ] [ ] [ 2array ] [ 3array ] [ 4array ] } nth ;
 
-: pack/unpack ( quot word -- newquot )
-    [ dup #in unpacker % swap % #out packer % ] [ ] make ;
+: unpacker ( seq -- quot )
+    length { [ drop ] [ ] [ first2 ] [ first3 ] [ first4 ] } nth ;
 
-: make-memoizer ( quot word -- quot )
-    [
-        [ #in packer % ] keep
-        [ "memoize" word-prop , ] keep
-        [ pack/unpack , ] keep
-        \ cache ,
-        #out unpacker %
-    ] [ ] make ;
+: pack/unpack ( quot effect -- newquot )
+    [ in>> packer ] [ out>> unpacker ] bi surround ;
 
-ERROR: too-many-arguments ;
+: unpack/pack ( quot effect -- newquot )
+    [ in>> unpacker ] [ out>> packer ] bi surround ;
 
-M: too-many-arguments summary
-    drop "There must be no more than 4 input and 4 output arguments" ;
+: check-memoized ( effect -- )
+    [ in>> ] [ out>> ] bi [ length 4 > ] either? [ too-many-arguments ] when ;
+
+: make-memoizer ( table quot effect -- quot )
+    [ check-memoized ] keep
+    [ unpack/pack '[ _ _ cache ] ] keep
+    pack/unpack ;
 
-: check-memoized ( word -- )
-    [ #in ] [ #out ] bi [ 4 > ] either? [ too-many-arguments ] when ;
+PRIVATE>
 
 : define-memoized ( word quot -- )
-    over check-memoized
-    2dup "memo-quot" set-word-prop
-    over H{ } clone "memoize" set-word-prop
-    over make-memoizer define ;
+    [ H{ } clone ] dip
+    [ pick stack-effect make-memoizer define ]
+    [ nip "memo-quot" set-word-prop ]
+    [ drop "memoize" set-word-prop ]
+    3tri ;
 
 : MEMO: (:) define-memoized ; parsing
 
@@ -57,11 +55,10 @@ M: memoized reset-word
     bi ;
 
 : memoize-quot ( quot effect -- memo-quot )
-    gensym swap dupd "declared-effect" set-word-prop
-    dup rot define-memoized 1quotation ;
+    [ H{ } clone ] 2dip make-memoizer ;
 
 : reset-memoized ( word -- )
     "memoize" word-prop clear-assoc ;
 
 : invalidate-memoized ( inputs... word -- )
-    [ #in packer call ] [ "memoize" word-prop delete-at ] bi ;
+    [ stack-effect in>> packer call ] [ "memoize" word-prop delete-at ] bi ;
index 37d5e13129be5a1375f4321b646161c99dd1d640..0edfb05a3081da96ed583c0454792630a6be6cc7 100755 (executable)
@@ -3,7 +3,8 @@
 USING: multiline kernel sequences io splitting fry namespaces
 http.parsers hashtables assocs combinators ascii io.files.unique
 accessors io.encodings.binary io.files byte-arrays math
-io.streams.string combinators.short-circuit strings math.order ;
+io.streams.string combinators.short-circuit strings math.order
+quoting ;
 IN: mime.multipart
 
 CONSTANT: buffer-size 65536
@@ -75,18 +76,6 @@ ERROR: end-of-stream multipart ;
 : empty-name? ( string -- ? )
     { "''" "\"\"" "" f } member? ;
 
-: quote? ( ch -- ? ) "'\"" member? ;
-
-: quoted? ( str -- ? )
-    {
-        [ length 1 > ]
-        [ first quote? ]
-        [ [ first ] [ peek ] bi = ]
-    } 1&& ;
-
-: unquote ( str -- newstr )
-    dup quoted? [ but-last-slice rest-slice >string ] when ;
-
 : save-uploaded-file ( multipart -- )
     dup filename>> empty-name? [
         drop
diff --git a/basis/mime/multipart/summary.txt b/basis/mime/multipart/summary.txt
new file mode 100644 (file)
index 0000000..ab08c83
--- /dev/null
@@ -0,0 +1 @@
+MIME multipart parser
diff --git a/basis/mime/types/summary.txt b/basis/mime/types/summary.txt
new file mode 100644 (file)
index 0000000..7ead547
--- /dev/null
@@ -0,0 +1 @@
+MIME types database
index ac5233c543292b16e764aa966ed2622bc5ba2e11..5693aa9162c451e9678bab641928a133a468aff9 100644 (file)
@@ -5,7 +5,7 @@ splitting kernel namespaces fry memoize ;
 IN: mime.types
 
 MEMO: mime-db ( -- seq )
-    "resource:basis/mime/types/mime.types" ascii file-lines
+    "vocab:mime/types/mime.types" ascii file-lines
     [ "#" head? not ] filter [ " \t" split harvest ] map harvest ;
 
 : nonstandard-mime-types ( -- assoc )
diff --git a/basis/models/compose/summary.txt b/basis/models/compose/summary.txt
new file mode 100644 (file)
index 0000000..962b30a
--- /dev/null
@@ -0,0 +1 @@
+Composed models combine the values of a sequence of models into one
diff --git a/basis/models/delay/summary.txt b/basis/models/delay/summary.txt
new file mode 100644 (file)
index 0000000..46fa0d6
--- /dev/null
@@ -0,0 +1 @@
+Delay models update a fixed period of time after the underlying model changes
diff --git a/basis/models/filter/summary.txt b/basis/models/filter/summary.txt
new file mode 100644 (file)
index 0000000..a8267ac
--- /dev/null
@@ -0,0 +1 @@
+Filter models apply a quotation to the value of an underlying model
diff --git a/basis/models/history/summary.txt b/basis/models/history/summary.txt
new file mode 100644 (file)
index 0000000..76f7b88
--- /dev/null
@@ -0,0 +1 @@
+History models remember prior values
diff --git a/basis/models/mapping/summary.txt b/basis/models/mapping/summary.txt
new file mode 100644 (file)
index 0000000..5b15621
--- /dev/null
@@ -0,0 +1 @@
+Mapping models combine an assoc of models into a single model
diff --git a/basis/models/range/summary.txt b/basis/models/range/summary.txt
new file mode 100644 (file)
index 0000000..b00df47
--- /dev/null
@@ -0,0 +1 @@
+Range models bound their values
index d1ab0a34c1c50fa3384a7f1d5678ca88165f539a..22a1515908fa7a1e8238c631cce6e20adaea2e08 100644 (file)
@@ -10,7 +10,7 @@ TUPLE: nibble-array
 
 <PRIVATE
 
-: nibble BIN: 1111 ; inline
+CONSTANT: nibble BIN: 1111
 
 : nibbles>bytes ( m -- n ) 1 + 2/ ; inline
 
diff --git a/basis/nibble-arrays/summary.txt b/basis/nibble-arrays/summary.txt
new file mode 100644 (file)
index 0000000..ae8abe6
--- /dev/null
@@ -0,0 +1 @@
+Space-efficient arrays of 4-bit values
index 66a0de83289682b9ff0e2a00eefe2e6c32963f27..77941479aa0cba43adbe3f4a260477fb3a042996 100644 (file)
@@ -1,6 +1,6 @@
 ! Just a dummy shell for the -run switch...
 IN: none
 
-: none ;
+: none ( -- ) ;
 
 MAIN: none
index da19ac52fc3b5b71825713ba371ff1309139b622..d603724a55cb46aa562dbc1d4c84d27f951d09fc 100644 (file)
@@ -11,183 +11,183 @@ TYPEDEF: void* GLubyte*
 TYPEDEF: void* GLUfuncptr
 
 ! StringName
-: GLU_VERSION                        100800 ;
-: GLU_EXTENSIONS                     100801 ;
+CONSTANT: GLU_VERSION                        100800
+CONSTANT: GLU_EXTENSIONS                     100801
 
 ! ErrorCode
-: GLU_INVALID_ENUM                   100900 ;
-: GLU_INVALID_VALUE                  100901 ;
-: GLU_OUT_OF_MEMORY                  100902 ;
-: GLU_INCOMPATIBLE_GL_VERSION        100903 ;
-: GLU_INVALID_OPERATION              100904 ;
+CONSTANT: GLU_INVALID_ENUM                   100900
+CONSTANT: GLU_INVALID_VALUE                  100901
+CONSTANT: GLU_OUT_OF_MEMORY                  100902
+CONSTANT: GLU_INCOMPATIBLE_GL_VERSION        100903
+CONSTANT: GLU_INVALID_OPERATION              100904
 
 ! NurbsDisplay
-: GLU_OUTLINE_POLYGON                100240 ;
-: GLU_OUTLINE_PATCH                  100241 ;
+CONSTANT: GLU_OUTLINE_POLYGON                100240
+CONSTANT: GLU_OUTLINE_PATCH                  100241
 
 ! NurbsCallback
-: GLU_NURBS_ERROR                    100103 ;
-: GLU_ERROR                          100103 ;
-: GLU_NURBS_BEGIN                    100164 ;
-: GLU_NURBS_BEGIN_EXT                100164 ;
-: GLU_NURBS_VERTEX                   100165 ;
-: GLU_NURBS_VERTEX_EXT               100165 ;
-: GLU_NURBS_NORMAL                   100166 ;
-: GLU_NURBS_NORMAL_EXT               100166 ;
-: GLU_NURBS_COLOR                    100167 ;
-: GLU_NURBS_COLOR_EXT                100167 ;
-: GLU_NURBS_TEXTURE_COORD            100168 ;
-: GLU_NURBS_TEX_COORD_EXT            100168 ;
-: GLU_NURBS_END                      100169 ;
-: GLU_NURBS_END_EXT                  100169 ;
-: GLU_NURBS_BEGIN_DATA               100170 ;
-: GLU_NURBS_BEGIN_DATA_EXT           100170 ;
-: GLU_NURBS_VERTEX_DATA              100171 ;
-: GLU_NURBS_VERTEX_DATA_EXT          100171 ;
-: GLU_NURBS_NORMAL_DATA              100172 ;
-: GLU_NURBS_NORMAL_DATA_EXT          100172 ;
-: GLU_NURBS_COLOR_DATA               100173 ;
-: GLU_NURBS_COLOR_DATA_EXT           100173 ;
-: GLU_NURBS_TEXTURE_COORD_DATA       100174 ;
-: GLU_NURBS_TEX_COORD_DATA_EXT       100174 ;
-: GLU_NURBS_END_DATA                 100175 ;
-: GLU_NURBS_END_DATA_EXT             100175 ;
+CONSTANT: GLU_NURBS_ERROR                    100103
+CONSTANT: GLU_ERROR                          100103
+CONSTANT: GLU_NURBS_BEGIN                    100164
+CONSTANT: GLU_NURBS_BEGIN_EXT                100164
+CONSTANT: GLU_NURBS_VERTEX                   100165
+CONSTANT: GLU_NURBS_VERTEX_EXT               100165
+CONSTANT: GLU_NURBS_NORMAL                   100166
+CONSTANT: GLU_NURBS_NORMAL_EXT               100166
+CONSTANT: GLU_NURBS_COLOR                    100167
+CONSTANT: GLU_NURBS_COLOR_EXT                100167
+CONSTANT: GLU_NURBS_TEXTURE_COORD            100168
+CONSTANT: GLU_NURBS_TEX_COORD_EXT            100168
+CONSTANT: GLU_NURBS_END                      100169
+CONSTANT: GLU_NURBS_END_EXT                  100169
+CONSTANT: GLU_NURBS_BEGIN_DATA               100170
+CONSTANT: GLU_NURBS_BEGIN_DATA_EXT           100170
+CONSTANT: GLU_NURBS_VERTEX_DATA              100171
+CONSTANT: GLU_NURBS_VERTEX_DATA_EXT          100171
+CONSTANT: GLU_NURBS_NORMAL_DATA              100172
+CONSTANT: GLU_NURBS_NORMAL_DATA_EXT          100172
+CONSTANT: GLU_NURBS_COLOR_DATA               100173
+CONSTANT: GLU_NURBS_COLOR_DATA_EXT           100173
+CONSTANT: GLU_NURBS_TEXTURE_COORD_DATA       100174
+CONSTANT: GLU_NURBS_TEX_COORD_DATA_EXT       100174
+CONSTANT: GLU_NURBS_END_DATA                 100175
+CONSTANT: GLU_NURBS_END_DATA_EXT             100175
 
 ! NurbsError
-: GLU_NURBS_ERROR1                   100251 ;
-: GLU_NURBS_ERROR2                   100252 ;
-: GLU_NURBS_ERROR3                   100253 ;
-: GLU_NURBS_ERROR4                   100254 ;
-: GLU_NURBS_ERROR5                   100255 ;
-: GLU_NURBS_ERROR6                   100256 ;
-: GLU_NURBS_ERROR7                   100257 ;
-: GLU_NURBS_ERROR8                   100258 ;
-: GLU_NURBS_ERROR9                   100259 ;
-: GLU_NURBS_ERROR10                  100260 ;
-: GLU_NURBS_ERROR11                  100261 ;
-: GLU_NURBS_ERROR12                  100262 ;
-: GLU_NURBS_ERROR13                  100263 ;
-: GLU_NURBS_ERROR14                  100264 ;
-: GLU_NURBS_ERROR15                  100265 ;
-: GLU_NURBS_ERROR16                  100266 ;
-: GLU_NURBS_ERROR17                  100267 ;
-: GLU_NURBS_ERROR18                  100268 ;
-: GLU_NURBS_ERROR19                  100269 ;
-: GLU_NURBS_ERROR20                  100270 ;
-: GLU_NURBS_ERROR21                  100271 ;
-: GLU_NURBS_ERROR22                  100272 ;
-: GLU_NURBS_ERROR23                  100273 ;
-: GLU_NURBS_ERROR24                  100274 ;
-: GLU_NURBS_ERROR25                  100275 ;
-: GLU_NURBS_ERROR26                  100276 ;
-: GLU_NURBS_ERROR27                  100277 ;
-: GLU_NURBS_ERROR28                  100278 ;
-: GLU_NURBS_ERROR29                  100279 ;
-: GLU_NURBS_ERROR30                  100280 ;
-: GLU_NURBS_ERROR31                  100281 ;
-: GLU_NURBS_ERROR32                  100282 ;
-: GLU_NURBS_ERROR33                  100283 ;
-: GLU_NURBS_ERROR34                  100284 ;
-: GLU_NURBS_ERROR35                  100285 ;
-: GLU_NURBS_ERROR36                  100286 ;
-: GLU_NURBS_ERROR37                  100287 ;
+CONSTANT: GLU_NURBS_ERROR1                   100251
+CONSTANT: GLU_NURBS_ERROR2                   100252
+CONSTANT: GLU_NURBS_ERROR3                   100253
+CONSTANT: GLU_NURBS_ERROR4                   100254
+CONSTANT: GLU_NURBS_ERROR5                   100255
+CONSTANT: GLU_NURBS_ERROR6                   100256
+CONSTANT: GLU_NURBS_ERROR7                   100257
+CONSTANT: GLU_NURBS_ERROR8                   100258
+CONSTANT: GLU_NURBS_ERROR9                   100259
+CONSTANT: GLU_NURBS_ERROR10                  100260
+CONSTANT: GLU_NURBS_ERROR11                  100261
+CONSTANT: GLU_NURBS_ERROR12                  100262
+CONSTANT: GLU_NURBS_ERROR13                  100263
+CONSTANT: GLU_NURBS_ERROR14                  100264
+CONSTANT: GLU_NURBS_ERROR15                  100265
+CONSTANT: GLU_NURBS_ERROR16                  100266
+CONSTANT: GLU_NURBS_ERROR17                  100267
+CONSTANT: GLU_NURBS_ERROR18                  100268
+CONSTANT: GLU_NURBS_ERROR19                  100269
+CONSTANT: GLU_NURBS_ERROR20                  100270
+CONSTANT: GLU_NURBS_ERROR21                  100271
+CONSTANT: GLU_NURBS_ERROR22                  100272
+CONSTANT: GLU_NURBS_ERROR23                  100273
+CONSTANT: GLU_NURBS_ERROR24                  100274
+CONSTANT: GLU_NURBS_ERROR25                  100275
+CONSTANT: GLU_NURBS_ERROR26                  100276
+CONSTANT: GLU_NURBS_ERROR27                  100277
+CONSTANT: GLU_NURBS_ERROR28                  100278
+CONSTANT: GLU_NURBS_ERROR29                  100279
+CONSTANT: GLU_NURBS_ERROR30                  100280
+CONSTANT: GLU_NURBS_ERROR31                  100281
+CONSTANT: GLU_NURBS_ERROR32                  100282
+CONSTANT: GLU_NURBS_ERROR33                  100283
+CONSTANT: GLU_NURBS_ERROR34                  100284
+CONSTANT: GLU_NURBS_ERROR35                  100285
+CONSTANT: GLU_NURBS_ERROR36                  100286
+CONSTANT: GLU_NURBS_ERROR37                  100287
 
 ! NurbsProperty
-: GLU_AUTO_LOAD_MATRIX               100200 ;
-: GLU_CULLING                        100201 ;
-: GLU_SAMPLING_TOLERANCE             100203 ;
-: GLU_DISPLAY_MODE                   100204 ;
-: GLU_PARAMETRIC_TOLERANCE           100202 ;
-: GLU_SAMPLING_METHOD                100205 ;
-: GLU_U_STEP                         100206 ;
-: GLU_V_STEP                         100207 ;
-: GLU_NURBS_MODE                     100160 ;
-: GLU_NURBS_MODE_EXT                 100160 ;
-: GLU_NURBS_TESSELLATOR              100161 ;
-: GLU_NURBS_TESSELLATOR_EXT          100161 ;
-: GLU_NURBS_RENDERER                 100162 ;
-: GLU_NURBS_RENDERER_EXT             100162 ;
+CONSTANT: GLU_AUTO_LOAD_MATRIX               100200
+CONSTANT: GLU_CULLING                        100201
+CONSTANT: GLU_SAMPLING_TOLERANCE             100203
+CONSTANT: GLU_DISPLAY_MODE                   100204
+CONSTANT: GLU_PARAMETRIC_TOLERANCE           100202
+CONSTANT: GLU_SAMPLING_METHOD                100205
+CONSTANT: GLU_U_STEP                         100206
+CONSTANT: GLU_V_STEP                         100207
+CONSTANT: GLU_NURBS_MODE                     100160
+CONSTANT: GLU_NURBS_MODE_EXT                 100160
+CONSTANT: GLU_NURBS_TESSELLATOR              100161
+CONSTANT: GLU_NURBS_TESSELLATOR_EXT          100161
+CONSTANT: GLU_NURBS_RENDERER                 100162
+CONSTANT: GLU_NURBS_RENDERER_EXT             100162
 
 ! NurbsSampling
-: GLU_OBJECT_PARAMETRIC_ERROR        100208 ;
-: GLU_OBJECT_PARAMETRIC_ERROR_EXT    100208 ;
-: GLU_OBJECT_PATH_LENGTH             100209 ;
-: GLU_OBJECT_PATH_LENGTH_EXT         100209 ;
-: GLU_PATH_LENGTH                    100215 ;
-: GLU_PARAMETRIC_ERROR               100216 ;
-: GLU_DOMAIN_DISTANCE                100217 ;
+CONSTANT: GLU_OBJECT_PARAMETRIC_ERROR        100208
+CONSTANT: GLU_OBJECT_PARAMETRIC_ERROR_EXT    100208
+CONSTANT: GLU_OBJECT_PATH_LENGTH             100209
+CONSTANT: GLU_OBJECT_PATH_LENGTH_EXT         100209
+CONSTANT: GLU_PATH_LENGTH                    100215
+CONSTANT: GLU_PARAMETRIC_ERROR               100216
+CONSTANT: GLU_DOMAIN_DISTANCE                100217
 
 ! NurbsTrim
-: GLU_MAP1_TRIM_2                    100210 ;
-: GLU_MAP1_TRIM_3                    100211 ;
+CONSTANT: GLU_MAP1_TRIM_2                    100210
+CONSTANT: GLU_MAP1_TRIM_3                    100211
 
 ! QuadricDrawStyle
-: GLU_POINT                          100010 ;
-: GLU_LINE                           100011 ;
-: GLU_FILL                           100012 ;
-: GLU_SILHOUETTE                     100013 ;
+CONSTANT: GLU_POINT                          100010
+CONSTANT: GLU_LINE                           100011
+CONSTANT: GLU_FILL                           100012
+CONSTANT: GLU_SILHOUETTE                     100013
 
 ! QuadricNormal
-: GLU_SMOOTH                         100000 ;
-: GLU_FLAT                           100001 ;
-: GLU_NONE                           100002 ;
+CONSTANT: GLU_SMOOTH                         100000
+CONSTANT: GLU_FLAT                           100001
+CONSTANT: GLU_NONE                           100002
 
 ! QuadricOrientation
-: GLU_OUTSIDE                        100020 ;
-: GLU_INSIDE                         100021 ;
+CONSTANT: GLU_OUTSIDE                        100020
+CONSTANT: GLU_INSIDE                         100021
 
 ! TessCallback
-: GLU_TESS_BEGIN                     100100 ;
-: GLU_BEGIN                          100100 ;
-: GLU_TESS_VERTEX                    100101 ;
-: GLU_VERTEX                         100101 ;
-: GLU_TESS_END                       100102 ;
-: GLU_END                            100102 ;
-: GLU_TESS_ERROR                     100103 ;
-: GLU_TESS_EDGE_FLAG                 100104 ;
-: GLU_EDGE_FLAG                      100104 ;
-: GLU_TESS_COMBINE                   100105 ;
-: GLU_TESS_BEGIN_DATA                100106 ;
-: GLU_TESS_VERTEX_DATA               100107 ;
-: GLU_TESS_END_DATA                  100108 ;
-: GLU_TESS_ERROR_DATA                100109 ;
-: GLU_TESS_EDGE_FLAG_DATA            100110 ;
-: GLU_TESS_COMBINE_DATA              100111 ;
+CONSTANT: GLU_TESS_BEGIN                     100100
+CONSTANT: GLU_BEGIN                          100100
+CONSTANT: GLU_TESS_VERTEX                    100101
+CONSTANT: GLU_VERTEX                         100101
+CONSTANT: GLU_TESS_END                       100102
+CONSTANT: GLU_END                            100102
+CONSTANT: GLU_TESS_ERROR                     100103
+CONSTANT: GLU_TESS_EDGE_FLAG                 100104
+CONSTANT: GLU_EDGE_FLAG                      100104
+CONSTANT: GLU_TESS_COMBINE                   100105
+CONSTANT: GLU_TESS_BEGIN_DATA                100106
+CONSTANT: GLU_TESS_VERTEX_DATA               100107
+CONSTANT: GLU_TESS_END_DATA                  100108
+CONSTANT: GLU_TESS_ERROR_DATA                100109
+CONSTANT: GLU_TESS_EDGE_FLAG_DATA            100110
+CONSTANT: GLU_TESS_COMBINE_DATA              100111
 
 ! TessContour
-: GLU_CW                             100120 ;
-: GLU_CCW                            100121 ;
-: GLU_INTERIOR                       100122 ;
-: GLU_EXTERIOR                       100123 ;
-: GLU_UNKNOWN                        100124 ;
+CONSTANT: GLU_CW                             100120
+CONSTANT: GLU_CCW                            100121
+CONSTANT: GLU_INTERIOR                       100122
+CONSTANT: GLU_EXTERIOR                       100123
+CONSTANT: GLU_UNKNOWN                        100124
 
 ! TessProperty
-: GLU_TESS_WINDING_RULE              100140 ;
-: GLU_TESS_BOUNDARY_ONLY             100141 ;
-: GLU_TESS_TOLERANCE                 100142 ;
+CONSTANT: GLU_TESS_WINDING_RULE              100140
+CONSTANT: GLU_TESS_BOUNDARY_ONLY             100141
+CONSTANT: GLU_TESS_TOLERANCE                 100142
 
 ! TessError
-: GLU_TESS_ERROR1                    100151 ;
-: GLU_TESS_ERROR2                    100152 ;
-: GLU_TESS_ERROR3                    100153 ;
-: GLU_TESS_ERROR4                    100154 ;
-: GLU_TESS_ERROR5                    100155 ;
-: GLU_TESS_ERROR6                    100156 ;
-: GLU_TESS_ERROR7                    100157 ;
-: GLU_TESS_ERROR8                    100158 ;
-: GLU_TESS_MISSING_BEGIN_POLYGON     100151 ;
-: GLU_TESS_MISSING_BEGIN_CONTOUR     100152 ;
-: GLU_TESS_MISSING_END_POLYGON       100153 ;
-: GLU_TESS_MISSING_END_CONTOUR       100154 ;
-: GLU_TESS_COORD_TOO_LARGE           100155 ;
-: GLU_TESS_NEED_COMBINE_CALLBACK     100156 ;
+CONSTANT: GLU_TESS_ERROR1                    100151
+CONSTANT: GLU_TESS_ERROR2                    100152
+CONSTANT: GLU_TESS_ERROR3                    100153
+CONSTANT: GLU_TESS_ERROR4                    100154
+CONSTANT: GLU_TESS_ERROR5                    100155
+CONSTANT: GLU_TESS_ERROR6                    100156
+CONSTANT: GLU_TESS_ERROR7                    100157
+CONSTANT: GLU_TESS_ERROR8                    100158
+CONSTANT: GLU_TESS_MISSING_BEGIN_POLYGON     100151
+CONSTANT: GLU_TESS_MISSING_BEGIN_CONTOUR     100152
+CONSTANT: GLU_TESS_MISSING_END_POLYGON       100153
+CONSTANT: GLU_TESS_MISSING_END_CONTOUR       100154
+CONSTANT: GLU_TESS_COORD_TOO_LARGE           100155
+CONSTANT: GLU_TESS_NEED_COMBINE_CALLBACK     100156
 
 ! TessWinding
-: GLU_TESS_WINDING_ODD               100130 ;
-: GLU_TESS_WINDING_NONZERO           100131 ;
-: GLU_TESS_WINDING_POSITIVE          100132 ;
-: GLU_TESS_WINDING_NEGATIVE          100133 ;
-: GLU_TESS_WINDING_ABS_GEQ_TWO       100134 ;
+CONSTANT: GLU_TESS_WINDING_ODD               100130
+CONSTANT: GLU_TESS_WINDING_NONZERO           100131
+CONSTANT: GLU_TESS_WINDING_POSITIVE          100132
+CONSTANT: GLU_TESS_WINDING_NEGATIVE          100133
+CONSTANT: GLU_TESS_WINDING_ABS_GEQ_TWO       100134
 
 LIBRARY: glu
 
index 80bf3b177274313f77c26f2897ba2ef689598af1..9cbed1f752e961dab54e20c53eed411730713263 100644 (file)
@@ -48,14 +48,14 @@ C-STRUCT: bio
     { "void*" "crypto-ex-data-stack" }
     { "int" "crypto-ex-data-dummy" } ;
 
-: BIO_NOCLOSE       HEX: 00 ; inline
-: BIO_CLOSE         HEX: 01 ; inline
+CONSTANT: BIO_NOCLOSE       HEX: 00
+CONSTANT: BIO_CLOSE         HEX: 01
 
-: RSA_3             HEX: 3 ; inline
-: RSA_F4            HEX: 10001 ; inline
+CONSTANT: RSA_3             HEX: 3
+CONSTANT: RSA_F4            HEX: 10001
 
-: BIO_C_SET_SSL     109 ; inline
-: BIO_C_GET_SSL     110 ; inline
+CONSTANT: BIO_C_SET_SSL     109
+CONSTANT: BIO_C_GET_SSL     110
 
 LIBRARY: libcrypto
 
@@ -99,7 +99,7 @@ FUNCTION: void* BIO_f_buffer (  ) ;
 ! evp.h
 ! ===============================================
 
-: EVP_MAX_MD_SIZE 64 ;
+CONSTANT: EVP_MAX_MD_SIZE 64
 
 C-STRUCT: EVP_MD_CTX
     { "EVP_MD*" "digest" }
diff --git a/basis/openssl/libcrypto/summary.txt b/basis/openssl/libcrypto/summary.txt
new file mode 100644 (file)
index 0000000..f140b3c
--- /dev/null
@@ -0,0 +1 @@
+Low-level FFI binding to libcrypto
diff --git a/basis/openssl/libssl/summary.txt b/basis/openssl/libssl/summary.txt
new file mode 100644 (file)
index 0000000..e823bb6
--- /dev/null
@@ -0,0 +1 @@
+Low-level FFI binding to libssl
index 93af70b3e082b57497500d8539fc04189e9821ad..aaae521a62b74502f3feedf9abd6fdedaeb2330e 100644 (file)
@@ -4,17 +4,17 @@ openssl namespaces accessors tools.test continuations kernel ;
 openssl secure-socket-backend [
     [ ] [
         <secure-config>
-            "resource:basis/openssl/test/server.pem" >>key-file
-            "resource:basis/openssl/test/root.pem" >>ca-file
-            "resource:basis/openssl/test/dh1024.pem" >>dh-file
+            "vocab:openssl/test/server.pem" >>key-file
+            "vocab:openssl/test/root.pem" >>ca-file
+            "vocab:openssl/test/dh1024.pem" >>dh-file
             "password" >>password
         [ ] with-secure-context
     ] unit-test
 
     [
         <secure-config>
-            "resource:basis/openssl/test/server.pem" >>key-file
-            "resource:basis/openssl/test/root.pem" >>ca-file
+            "vocab:openssl/test/server.pem" >>key-file
+            "vocab:openssl/test/root.pem" >>ca-file
             "wrong password" >>password
         [ ] with-secure-context
     ] must-fail
diff --git a/basis/pack/summary.txt b/basis/pack/summary.txt
new file mode 100644 (file)
index 0000000..ae884f6
--- /dev/null
@@ -0,0 +1 @@
+Packing and unpacking binary data
index 473cf4f3a20e03c485cbdbf5ec21c5eb023e2003..76ad8b1b1ee22bf65f73edcb3aa92f3e18bf94ad 100644 (file)
@@ -1 +1 @@
-Grammar for parsing EBNF
+Declarative EBNF language for writing PEG parsers
index 9da56880c05634f9926aa909be4d4c4531bcc897..5af5dba74811bd315ffe3b3b2e9775ea15fca681 100644 (file)
@@ -1 +1,2 @@
+text
 parsing
index a9fb3668121afc7f28a8f4df732bb2486667a26b..aadbbaff16710a36a2c08e3c2cdca4a1affab7d3 100644 (file)
@@ -7,12 +7,12 @@ IN: peg.parsers
 
 TUPLE: just-parser p1 ;
 
-: just-pattern
+CONSTANT: just-pattern
   [
     execute dup [
       dup remaining>> empty? [ drop f ] unless
     ] when
-  ] ;
+  ]
 
 
 M: just-parser (compile) ( parser -- quot )
diff --git a/basis/peg/parsers/summary.txt b/basis/peg/parsers/summary.txt
new file mode 100644 (file)
index 0000000..a87ccc9
--- /dev/null
@@ -0,0 +1 @@
+Additional PEG parsers
diff --git a/basis/peg/parsers/tags.txt b/basis/peg/parsers/tags.txt
new file mode 100644 (file)
index 0000000..8e27be7
--- /dev/null
@@ -0,0 +1 @@
+text
index 324a5440369053174cc06074c4968edefdae2856..498b4e0bb01e58cd1330235c478df1ec5b8b9bf9 100644 (file)
@@ -1 +1 @@
-Parsing Expression Grammar and Packrat Parser
+Parsing expression grammar and packrat parser
index 554db08e703890f2feb6f8f7e187a3b45dce7add..478fc0ad254ade4c7cffdac81b4fa9147f57f4ca 100644 (file)
@@ -20,7 +20,7 @@ TUPLE: persistent-vector
 
 M: persistent-vector length count>> ;
 
-: node-size 32 ; inline
+CONSTANT: node-size 32
 
 : node-mask ( m -- n ) node-size mod ; inline
 
index 72bf5c0bb5adcbf46bf3356e939c868ef2b14324..4403541608af786b488d99642a5380a7a6951c8e 100644 (file)
@@ -57,8 +57,8 @@ io.files io.encodings.utf8 ;
 [ "mate" ] [ "mate" step5 "" like ] unit-test
 
 [ { } ] [
-    "resource:basis/porter-stemmer/test/voc.txt" utf8 file-lines
+    "vocab:porter-stemmer/test/voc.txt" utf8 file-lines
     [ stem ] map
-    "resource:basis/porter-stemmer/test/output.txt" utf8 file-lines
+    "vocab:porter-stemmer/test/output.txt" utf8 file-lines
     [ 2array ] 2map [ first2 = not ] filter
 ] unit-test
diff --git a/basis/prettyprint/custom/summary.txt b/basis/prettyprint/custom/summary.txt
new file mode 100644 (file)
index 0000000..a9cd58a
--- /dev/null
@@ -0,0 +1 @@
+Protocol for extending the prettyprinter on custom data types
diff --git a/basis/quoting/authors.txt b/basis/quoting/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/quoting/quoting-docs.factor b/basis/quoting/quoting-docs.factor
new file mode 100644 (file)
index 0000000..5fb68db
--- /dev/null
@@ -0,0 +1,32 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax strings ;
+IN: quoting
+
+HELP: quote?
+{ $values
+     { "ch" "a character" }
+     { "?" "a boolean" }
+}
+{ $description "Returns true if the character is a single or double quote." } ;
+
+HELP: quoted?
+{ $values
+     { "str" string }
+     { "?" "a boolean" }
+}
+{ $description "Returns true if a string is surrounded by matching single or double quotes as the first and last characters." } ;
+
+HELP: unquote
+{ $values
+     { "str" string }
+     { "newstr" string }
+}
+{ $description "Removes a pair of matching single or double quotes from a string." } ;
+
+ARTICLE: "quoting" "Quotation marks"
+"The " { $vocab-link "quoting" } " vocabulary is for removing quotes from a string." $nl
+"Removing quotes:"
+{ $subsection unquote } ;
+
+ABOUT: "quoting"
diff --git a/basis/quoting/quoting-tests.factor b/basis/quoting/quoting-tests.factor
new file mode 100644 (file)
index 0000000..0cc28a1
--- /dev/null
@@ -0,0 +1,10 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test quoting ;
+IN: quoting.tests
+
+
+[ "abc" ] [ "'abc'" unquote ] unit-test
+[ "abc" ] [ "\"abc\"" unquote ] unit-test
+[ "'abc" ] [ "'abc" unquote ] unit-test
+[ "abc'" ] [ "abc'" unquote ] unit-test
diff --git a/basis/quoting/quoting.factor b/basis/quoting/quoting.factor
new file mode 100644 (file)
index 0000000..9e25037
--- /dev/null
@@ -0,0 +1,16 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: combinators.short-circuit kernel math sequences strings ;
+IN: quoting
+
+: quote? ( ch -- ? ) "'\"" member? ;
+
+: quoted? ( str -- ? )
+    {
+        [ length 1 > ]
+        [ first quote? ]
+        [ [ first ] [ peek ] bi = ]
+    } 1&& ;
+
+: unquote ( str -- newstr )
+    dup quoted? [ but-last-slice rest-slice >string ] when ;
diff --git a/basis/random/dummy/summary.txt b/basis/random/dummy/summary.txt
new file mode 100644 (file)
index 0000000..706f2c9
--- /dev/null
@@ -0,0 +1 @@
+Dummy RNG for testing
index 67b0fa23e78f8d99d1bb241fc13b8bdb27abb99e..361ba7719e2304ab5eb0adbbb2484d45e71dc4f0 100644 (file)
@@ -11,9 +11,9 @@ IN: random.mersenne-twister
 
 TUPLE: mersenne-twister { seq uint-array } { i fixnum } ;
 
-: n 624 ; inline
-: m 397 ; inline
-: a uint-array{ 0 HEX: 9908b0df } ; inline
+CONSTANT: n 624
+CONSTANT: m 397
+CONSTANT: a uint-array{ 0 HEX: 9908b0df }
 
 : y ( n seq -- y )
     [ nth-unsafe 31 mask-bit ]
diff --git a/basis/random/unix/summary.txt b/basis/random/unix/summary.txt
new file mode 100644 (file)
index 0000000..c8762e2
--- /dev/null
@@ -0,0 +1 @@
+Native Unix RNG
diff --git a/basis/random/windows/summary.txt b/basis/random/windows/summary.txt
new file mode 100644 (file)
index 0000000..0554a50
--- /dev/null
@@ -0,0 +1 @@
+Native Windows RNG
diff --git a/basis/smtp/server/summary.txt b/basis/smtp/server/summary.txt
new file mode 100644 (file)
index 0000000..1bcabc1
--- /dev/null
@@ -0,0 +1 @@
+SMTP server for testing purposes
diff --git a/basis/sorting/slots/summary.txt b/basis/sorting/slots/summary.txt
new file mode 100644 (file)
index 0000000..240a4ff
--- /dev/null
@@ -0,0 +1 @@
+Sorting by tuple slots
diff --git a/basis/specialized-arrays/direct/functor/summary.txt b/basis/specialized-arrays/direct/functor/summary.txt
new file mode 100644 (file)
index 0000000..79df0a5
--- /dev/null
@@ -0,0 +1 @@
+Code generation for direct specialized arrays
diff --git a/basis/specialized-arrays/functor/summary.txt b/basis/specialized-arrays/functor/summary.txt
new file mode 100644 (file)
index 0000000..77cb2d4
--- /dev/null
@@ -0,0 +1 @@
+Code generation for specialized arrays
diff --git a/basis/specialized-vectors/functor/summary.txt b/basis/specialized-vectors/functor/summary.txt
new file mode 100644 (file)
index 0000000..dc26fa6
--- /dev/null
@@ -0,0 +1 @@
+Code generation for specialized vectors
diff --git a/basis/stack-checker/alien/summary.txt b/basis/stack-checker/alien/summary.txt
new file mode 100644 (file)
index 0000000..18cf21c
--- /dev/null
@@ -0,0 +1 @@
+Stack effect inference for alien calls
index b08bdd84362c9679e59b500c6d9ebb803e10f5b6..3c298bdfedaa1ff9d468840109ff4c1b2c749765 100755 (executable)
@@ -124,18 +124,13 @@ M: object apply-object push-literal ;
 : undo-infer ( -- )
     recorded get [ f "inferred-effect" set-word-prop ] each ;
 
-: consume/produce ( effect quot -- )
-    #! quot is ( inputs outputs -- )
-    [
-        [
-            [ in>> length consume-d ]
-            [ out>> length produce-d ]
-            bi
-        ] dip call
-    ] [
-        drop
-        terminated?>> [ terminate ] when
-    ] 2bi ; inline
+: (consume/produce) ( effect -- inputs outputs )
+    [ in>> length consume-d ] [ out>> length produce-d ] bi ;
+
+: consume/produce ( effect quot: ( inputs outputs -- ) -- )
+    '[ (consume/produce) @ ]
+    [ terminated?>> [ terminate ] when ]
+    bi ; inline
 
 : infer-word-def ( word -- )
     [ specialized-def ] [ add-recursive-state ] bi infer-quot ;
@@ -143,30 +138,18 @@ M: object apply-object push-literal ;
 : end-infer ( -- )
     meta-d clone #return, ;
 
-: effect-required? ( word -- ? )
-    {
-        { [ dup deferred? ] [ drop f ] }
-        { [ dup crossref? not ] [ drop f ] }
-        [ def>> [ word? ] any? ]
-    } cond ;
-
-: ?missing-effect ( word -- )
-    dup effect-required?
-    [ missing-effect inference-error ] [ drop ] if ;
+: required-stack-effect ( word -- effect )
+    dup stack-effect [ ] [ missing-effect inference-error ] ?if ;
 
 : check-effect ( word effect -- )
-    over stack-effect {
-        { [ dup not ] [ 2drop ?missing-effect ] }
-        { [ 2dup effect<= ] [ 3drop ] }
-        [ effect-error ]
-    } cond ;
+    over required-stack-effect 2dup effect<=
+    [ 3drop ] [ effect-error ] if ;
 
 : finish-word ( word -- )
-    current-effect
-    [ check-effect ]
-    [ drop recorded get push ]
-    [ "inferred-effect" set-word-prop ]
-    2tri ;
+    [ current-effect check-effect ]
+    [ recorded get push ]
+    [ t "inferred-effect" set-word-prop ]
+    tri ;
 
 : cannot-infer-effect ( word -- * )
     "cannot-infer" word-prop throw ;
@@ -183,22 +166,20 @@ M: object apply-object push-literal ;
             dependencies off
             generic-dependencies off
             [ infer-word-def end-infer ]
-            [ finish-word current-effect ]
-            bi
+            [ finish-word ]
+            [ stack-effect ]
+            tri
         ] with-scope
     ] maybe-cannot-infer ;
 
 : apply-word/effect ( word effect -- )
     swap '[ _ #call, ] consume/produce ;
 
-: required-stack-effect ( word -- effect )
-    dup stack-effect [ ] [ \ missing-effect inference-error ] ?if ;
-
 : call-recursive-word ( word -- )
     dup required-stack-effect apply-word/effect ;
 
 : cached-infer ( word -- )
-    dup "inferred-effect" word-prop apply-word/effect ;
+    dup stack-effect apply-word/effect ;
 
 : with-infer ( quot -- effect visitor )
     [
diff --git a/basis/stack-checker/branches/summary.txt b/basis/stack-checker/branches/summary.txt
new file mode 100644 (file)
index 0000000..c63c8d0
--- /dev/null
@@ -0,0 +1 @@
+Stack effect inference for conditionals
index c3b9797a363a42095dd052aeddb3b03ea121a434..5b314a3154d11d4a7d7a2e03702c4937122d9abe 100644 (file)
@@ -87,6 +87,8 @@ HELP: inconsistent-recursive-call-error
 } ;
 
 ARTICLE: "inference-errors" "Inference warnings and errors"
+"These conditions are thrown by " { $link "inference" } ", as well as the " { $link "compiler" } "."
+$nl
 "Main wrapper for all inference warnings and errors:"
 { $subsection inference-error }
 "Inference warnings:"
diff --git a/basis/stack-checker/inlining/summary.txt b/basis/stack-checker/inlining/summary.txt
new file mode 100644 (file)
index 0000000..422401d
--- /dev/null
@@ -0,0 +1 @@
+Stack effect inference for inline and inline recursive words
index 56aebb20e7ed931095298f84767e35d706a50ab9..4ac9d802ed388c2f6786e4007874c53ee20780ae 100644 (file)
@@ -319,12 +319,18 @@ M: object infer-call*
 \ fixnum/i { fixnum fixnum } { integer } define-primitive
 \ fixnum/i make-foldable
 
+\ fixnum/i-fast { fixnum fixnum } { fixnum } define-primitive
+\ fixnum/i-fast make-foldable
+
 \ fixnum-mod { fixnum fixnum } { fixnum } define-primitive
 \ fixnum-mod make-foldable
 
 \ fixnum/mod { fixnum fixnum } { integer fixnum } define-primitive
 \ fixnum/mod make-foldable
 
+\ fixnum/mod-fast { fixnum fixnum } { fixnum fixnum } define-primitive
+\ fixnum/mod-fast make-foldable
+
 \ fixnum-bitand { fixnum fixnum } { fixnum } define-primitive
 \ fixnum-bitand make-foldable
 
diff --git a/basis/stack-checker/recursive-state/summary.txt b/basis/stack-checker/recursive-state/summary.txt
new file mode 100644 (file)
index 0000000..52f5a14
--- /dev/null
@@ -0,0 +1 @@
+Tracking word nesting during stack effect inference
diff --git a/basis/stack-checker/recursive-state/tree/summary.txt b/basis/stack-checker/recursive-state/tree/summary.txt
new file mode 100644 (file)
index 0000000..ca96da1
--- /dev/null
@@ -0,0 +1 @@
+Simple binary tree
index 5926f08d8c91ee2a5477fb63c768714e194227ae..db8abac4411c7d97e5fffe2ead764064903a5961 100644 (file)
@@ -56,7 +56,7 @@ ARTICLE: "inference-recursive" "Stack effects of recursive words"
 "When a recursive call is encountered, the declared stack effect is substituted in. When inference is complete, the inferred stack effect is compared with the declared stack effect."
 $nl
 "Attempting to infer the stack effect of a recursive word which outputs a variable number of objects on the stack will fail. For example, the following will throw an " { $link unbalanced-branches-error } ":"
-{ $code ": foo ( seq -- ) dup empty? [ drop ] [ dup pop foo ] if" "[ foo ] infer." }
+{ $code ": foo ( seq -- ) dup empty? [ drop ] [ dup pop foo ] if ;" "[ foo ] infer." }
 "If you declare an incorrect stack effect, inference will fail also. Badly defined recursive words cannot confuse the inferencer." ;
 
 ARTICLE: "inference-recursive-combinators" "Recursive combinator inference"
index a2f616480a96c4d045386f604687ef2232cb85e3..afb7e0843ca9cd733580a4d0b7377e6bf6652ab5 100755 (executable)
@@ -105,7 +105,7 @@ IN: stack-checker.transforms
 ] 1 define-transform
 
 ! Membership testing
-: bit-member-n 256 ; inline
+CONSTANT: bit-member-n 256
 
 : bit-member? ( seq -- ? )
     #! Can we use a fast byte array test here?
diff --git a/basis/stack-checker/values/summary.txt b/basis/stack-checker/values/summary.txt
new file mode 100644 (file)
index 0000000..5b57e95
--- /dev/null
@@ -0,0 +1 @@
+Abstract stack checker values
diff --git a/basis/stack-checker/visitor/dummy/summary.txt b/basis/stack-checker/visitor/dummy/summary.txt
new file mode 100644 (file)
index 0000000..b4340ea
--- /dev/null
@@ -0,0 +1 @@
+Dummy implementation of node visitor protocol
diff --git a/basis/stack-checker/visitor/summary.txt b/basis/stack-checker/visitor/summary.txt
new file mode 100644 (file)
index 0000000..29a3c8a
--- /dev/null
@@ -0,0 +1 @@
+Node visitor protocol
index 8cfdc9e1d54ddfa2e22ce867e486d28a703e5b64..616ce2723a6a2d23767730a90a15de805da7cd3d 100644 (file)
@@ -25,7 +25,7 @@ IN: syndication.tests
             f
         }
     }
-} ] [ "resource:basis/syndication/test/rss1.xml" load-news-file ] unit-test
+} ] [ "vocab:syndication/test/rss1.xml" load-news-file ] unit-test
 [ T{
     feed
     f
@@ -42,5 +42,5 @@ IN: syndication.tests
             T{ timestamp f 2003 12 13 8 29 29 T{ duration f 0 0 0 -4 0 0 } }
         }
     }
-} ] [ "resource:basis/syndication/test/atom.xml" load-news-file ] unit-test
-[ ] [ "resource:basis/syndication/test/atom.xml" load-news-file feed>xml xml>string drop ] unit-test
+} ] [ "vocab:syndication/test/atom.xml" load-news-file ] unit-test
+[ ] [ "vocab:syndication/test/atom.xml" load-news-file feed>xml xml>string drop ] unit-test
index 305ef0cca3b8f34c7d336a62f6c64bd3f1390e7f..8556167009db22850f4256da628c0a32ad40cc9f 100644 (file)
@@ -118,7 +118,7 @@ DEFER: stop
     [ ] while
     drop ;
 
-: start ( namestack thread -- )
+: start ( namestack thread -- )
     [
         set-self
         set-namestack
index 3d09802576bb68f3e566f4cc97826c3eb6c06815..d4f2fea2e5c97229f1cf1198ab71c55e46243f90 100755 (executable)
@@ -7,7 +7,7 @@ GENERIC: foo
 
 M: integer foo + ;
 
-"resource:basis/tools/crossref/test/foo.factor" run-file
+"vocab:tools/crossref/test/foo.factor" run-file
 
 [ t ] [ integer \ foo method \ + usage member? ] unit-test
 [ t ] [ \ foo usage [ pathname? ] any? ] unit-test
index ff851edce606a1bc709b14ee8018b8ccd058b83a..7d8f35724007026b68629804dfb688dccde8cf27 100755 (executable)
@@ -58,25 +58,17 @@ DEFER: ?make-staging-image
 : staging-command-line ( profile -- flags )
     [
         "-staging" ,
-
         dup empty? [
             "-i=" my-boot-image-name append ,
         ] [
             dup but-last ?make-staging-image
-
             "-resource-path=" "" resource-path append ,
-
             "-i=" over but-last staging-image-name append ,
-
             "-run=tools.deploy.restage" ,
         ] if
-
         "-output-image=" over staging-image-name append ,
-
         "-include=" swap " " join append ,
-
         strip-word-names? [ "-no-stack-traces" , ] when
-
         "-no-user-init" ,
     ] { } make ;
 
@@ -101,16 +93,11 @@ DEFER: ?make-staging-image
 
         [
             "-i=" bootstrap-profile staging-image-name append ,
-
             "-resource-path=" "" resource-path append ,
-
             "-run=tools.deploy.shaker" ,
-
             [ "-deploy-vocab=" prepend , ]
             [ make-deploy-config "-deploy-config=" prepend , ] bi
-
             "-output-image=" prepend ,
-
             strip-word-names? [ "-no-stack-traces" , ] when
         ] { } make
     ] bind ;
index 1d9761e885c9582dde124d0545fa0eacb121a09f..63c8393b51ff2c8099a067a2969a9272c22fa5b9 100644 (file)
@@ -14,12 +14,12 @@ SYMBOL: deploy-threads?
 
 SYMBOL: deploy-io
 
-: deploy-io-options
+CONSTANT: deploy-io-options
     {
         { 1 "Level 1 - No input/output" }
         { 2 "Level 2 - Basic ANSI C streams" }
         { 3 "Level 3 - Non-blocking streams and networking" }
-    } ;
+    }
 
 : strip-io? ( -- ? ) deploy-io get 1 = ;
 
@@ -27,7 +27,7 @@ SYMBOL: deploy-io
 
 SYMBOL: deploy-reflection
 
-: deploy-reflection-options
+CONSTANT: deploy-reflection-options
     {
         { 1 "Level 1 - No reflection" }
         { 2 "Level 2 - Retain word names" }
@@ -35,7 +35,7 @@ SYMBOL: deploy-reflection
         { 4 "Level 4 - Debugger" }
         { 5 "Level 5 - Parser" }
         { 6 "Level 6 - Full environment" }
-    } ;
+    }
 
 : strip-word-names? ( -- ? ) deploy-reflection get 2 < ;
 : strip-prettyprint? ( -- ? ) deploy-reflection get 3 < ;
index 8b36947f439921ba0bebaa26220f95406290a2ca..0dea093081d499607201b24d1dfd13e233f9b5b0 100644 (file)
@@ -65,7 +65,7 @@ M: quit-responder call-responder*
 [ ] [\r
     <dispatcher>\r
         add-quot-responder\r
-        "resource:basis/http/test" <static> >>default\r
+        "vocab:http/test" <static> >>default\r
 \r
     test-httpd\r
 ] unit-test\r
@@ -104,3 +104,8 @@ M: quit-responder call-responder*
     "tools.deploy.test.10" shake-and-bake\r
     run-temp-image\r
 ] unit-test\r
+\r
+[ ] [\r
+    "tools.deploy.test.11" shake-and-bake\r
+    run-temp-image\r
+] unit-test
\ No newline at end of file
index c894a8931b6462628113305de8a1a137f3de6e32..961d0ff26d12af0d9687ae52e864db76c756a517 100755 (executable)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors io.backend io.streams.c init fry
 namespaces make assocs kernel parser lexer strings.parser vocabs
@@ -42,21 +42,21 @@ IN: tools.deploy.shaker
 : strip-debugger ( -- )
     strip-debugger? "debugger" vocab and [
         "Stripping debugger" show
-        "resource:basis/tools/deploy/shaker/strip-debugger.factor"
+        "vocab:tools/deploy/shaker/strip-debugger.factor"
         run-file
     ] when ;
 
 : strip-libc ( -- )
     "libc" vocab [
         "Stripping manual memory management debug code" show
-        "resource:basis/tools/deploy/shaker/strip-libc.factor"
+        "vocab:tools/deploy/shaker/strip-libc.factor"
         run-file
     ] when ;
 
 : strip-cocoa ( -- )
     "cocoa" vocab [
         "Stripping unused Cocoa methods" show
-        "resource:basis/tools/deploy/shaker/strip-cocoa.factor"
+        "vocab:tools/deploy/shaker/strip-cocoa.factor"
         run-file
     ] when ;
 
@@ -95,7 +95,7 @@ IN: tools.deploy.shaker
                 "cannot-infer"
                 "coercer"
                 "combination"
-                "compiled-effect"
+                "compiled-status"
                 "compiled-generic-uses"
                 "compiled-uses"
                 "constraints"
@@ -190,7 +190,7 @@ IN: tools.deploy.shaker
         "Stripping default methods" show
         [
             [ generic? ] instances
-            [ "No method" throw ] define-temp
+            [ "No method" throw ] (( -- * )) define-temp
             dup t "default" set-word-prop
             '[
                 [ _ "default-method" set-word-prop ] [ make-generic ] bi
@@ -232,7 +232,6 @@ IN: tools.deploy.shaker
             "tools"
             "io.launcher"
             "random"
-            "compiler"
             "stack-checker"
             "bootstrap"
             "listener"
@@ -241,7 +240,7 @@ IN: tools.deploy.shaker
         strip-dictionary? [
             "libraries" "alien" lookup ,
 
-            { } { "cpu" } strip-vocab-globals %
+            { } { "cpu" "compiler" } strip-vocab-globals %
 
             {
                 gensym
@@ -359,12 +358,26 @@ IN: tools.deploy.shaker
 
 SYMBOL: deploy-vocab
 
-: set-boot-quot* ( word -- )
+: [:c] ( -- word ) ":c" "debugger" lookup ;
+
+: [print-error] ( -- word ) "print-error" "debugger" lookup ;
+
+: deploy-boot-quot ( word -- )
     [
-        \ boot ,
+        [ boot ] %
         init-hooks get values concat %
-        ,
-        strip-io? [ \ flush , ] unless
+        strip-debugger? [ , ] [
+            ! Don't reference try directly
+            [:c]
+            [print-error]
+            '[
+                [ _ execute ] [
+                    _ execute nl
+                    _ execute
+                ] recover
+            ] %
+        ] if
+        strip-io? [ [ flush ] % ] unless
         [ 0 exit ] %
     ] [ ] make
     set-boot-quot ;
@@ -380,7 +393,7 @@ SYMBOL: deploy-vocab
             dup next-method-quot "next-method-quot" set-word-prop
         ] assoc-each
     ] each
-    "resource:basis/tools/deploy/shaker/next-methods.factor" run-file ;
+    "vocab:tools/deploy/shaker/next-methods.factor" run-file ;
 
 : strip ( -- )
     init-stripper
@@ -392,7 +405,7 @@ SYMBOL: deploy-vocab
     strip-init-hooks
     strip-c-io
     f 5 setenv ! we can't use the Factor debugger or Factor I/O anymore
-    deploy-vocab get vocab-main set-boot-quot*
+    deploy-vocab get vocab-main deploy-boot-quot
     stripped-word-props
     stripped-globals strip-globals
     compress-byte-arrays
@@ -401,16 +414,33 @@ SYMBOL: deploy-vocab
     compress-wrappers
     strip-words ;
 
+: deploy-error-handler ( quot -- )
+    [
+        strip-debugger?
+        [ error-continuation get call>> callstack>array die ]
+        ! Don't reference these words literally, if we're stripping the
+        ! debugger out we don't want to load the prettyprinter at all
+        [ [:c] execute nl [print-error] execute flush ] if
+        1 exit
+    ] recover ; inline
+
 : (deploy) ( final-image vocab config -- )
     #! Does the actual work of a deployment in the slave
     #! stage2 image
     [
         [
+            strip-debugger? [
+                "debugger" require
+                "inspector" require
+            ] unless
             deploy-vocab set
             deploy-vocab get require
+            deploy-vocab get vocab-main [
+                "Vocabulary has no MAIN: word." print flush 1 exit
+            ] unless
             strip
             finish-deploy
-        ] [ error-continuation get call>> callstack>array die 1 exit ] recover
+        ] deploy-error-handler
     ] bind ;
 
 : do-deploy ( -- )
diff --git a/basis/tools/deploy/test/11/11-tests.factor b/basis/tools/deploy/test/11/11-tests.factor
new file mode 100644 (file)
index 0000000..2eb7009
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test tools.deploy.test.11 ;
+IN: tools.deploy.test.11.tests
diff --git a/basis/tools/deploy/test/11/11.factor b/basis/tools/deploy/test/11/11.factor
new file mode 100644 (file)
index 0000000..b4f8622
--- /dev/null
@@ -0,0 +1,8 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: eval ;
+IN: tools.deploy.test.11
+
+: foo ( -- ) "USING: math prettyprint ; 2 2 + ." eval ;
+
+MAIN: foo
\ No newline at end of file
diff --git a/basis/tools/deploy/test/11/authors.txt b/basis/tools/deploy/test/11/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/tools/deploy/test/11/deploy.factor b/basis/tools/deploy/test/11/deploy.factor
new file mode 100644 (file)
index 0000000..42f707b
--- /dev/null
@@ -0,0 +1,15 @@
+USING: tools.deploy.config ;
+H{
+    { deploy-reflection 5 }
+    { deploy-word-props? f }
+    { deploy-c-types? f }
+    { deploy-name "tools.deploy.test.11" }
+    { "stop-after-last-window?" t }
+    { deploy-word-defs? f }
+    { deploy-math? f }
+    { deploy-unicode? f }
+    { deploy-threads? f }
+    { deploy-compiler? f }
+    { deploy-io 2 }
+    { deploy-ui? f }
+}
index cfa2483c7e7e50f24bbab5a5ae1aea0d06f968d4..8f99e4f44077b90108af55fd1cf72475513c17b7 100644 (file)
@@ -24,10 +24,10 @@ FUNCTION: void ud_translate_att ( ud* u ) ;
 : UD_SYN_INTEL ( -- addr ) &: ud_translate_intel ; inline
 : UD_SYN_ATT ( -- addr ) &: ud_translate_att ; inline
 
-: UD_EOI          -1 ; inline
-: UD_INP_CACHE_SZ 32 ; inline
-: UD_VENDOR_AMD   0 ; inline
-: UD_VENDOR_INTEL 1 ; inline
+CONSTANT: UD_EOI          -1
+CONSTANT: UD_INP_CACHE_SZ 32
+CONSTANT: UD_VENDOR_AMD   0
+CONSTANT: UD_VENDOR_INTEL 1
 
 FUNCTION: void ud_init ( ud* u ) ;
 FUNCTION: void ud_set_mode ( ud* u, uint8_t mode ) ;
index 7508c37cac456ff15469ce89745c1647ef629334..8d882099def92089f74227cfceeb87411f39b382 100755 (executable)
@@ -35,9 +35,10 @@ IN: tools.files
 
 PRIVATE>
 
-SYMBOLS: file-name file-name/type permissions file-type nlinks file-size
-file-date file-time file-datetime uid gid user group link-target unix-datetime
-directory-or-size ;
+SYMBOLS: +file-name+ +file-name/type+ +permissions+ +file-type+
++nlinks+ +file-size+ +file-date+ +file-time+ +file-datetime+
++uid+ +gid+ +user+ +group+ +link-target+ +unix-datetime+
++directory-or-size+ ;
 
 TUPLE: listing-tool path specs sort ;
 
@@ -48,10 +49,10 @@ C: <file-listing> file-listing
 : <listing-tool> ( path -- listing-tool )
     listing-tool new
         swap >>path
-        { file-name } >>specs ;
+        { +file-name+ } >>specs ;
 
 : list-slow? ( listing-tool -- ? )
-    specs>> { file-name } sequence= not ;
+    specs>> { +file-name+ } sequence= not ;
 
 ERROR: unknown-file-spec symbol ;
 
@@ -59,12 +60,12 @@ HOOK: file-spec>string os ( file-listing spec -- string )
 
 M: object file-spec>string ( file-listing spec -- string )
     {
-        { file-name [ directory-entry>> name>> ] }
-        { directory-or-size [ file-info>> dir-or-size ] }
-        { file-size [ file-info>> size>> number>string ] }
-        { file-date [ file-info>> modified>> listing-date ] }
-        { file-time [ file-info>> modified>> listing-time ] }
-        { file-datetime [ file-info>> modified>> timestamp>ymdhms ] }
+        { +file-name+ [ directory-entry>> name>> ] }
+        { +directory-or-size+ [ file-info>> dir-or-size ] }
+        { +file-size+ [ file-info>> size>> number>string ] }
+        { +file-date+ [ file-info>> modified>> listing-date ] }
+        { +file-time+ [ file-info>> modified>> listing-time ] }
+        { +file-datetime+ [ file-info>> modified>> timestamp>ymdhms ] }
         [ unknown-file-spec ]
     } case ;
 
@@ -85,22 +86,22 @@ HOOK: (directory.) os ( path -- lines )
 
 : directory. ( path -- ) (directory.) simple-table. ;
 
-SYMBOLS: device-name mount-point type
-available-space free-space used-space total-space
-percent-used percent-free ;
+SYMBOLS: +device-name+ +mount-point+ +type+
++available-space+ +free-space+ +used-space+ +total-space+
++percent-used+ +percent-free+ ;
 
 : percent ( real -- integer ) 100 * >integer ; inline
 
 : file-system-spec ( file-system-info obj -- str )
     {
-        { device-name [ device-name>> "" or ] }
-        { mount-point [ mount-point>> "" or ] }
-        { type [ type>> "" or ] }
-        { available-space [ available-space>> 0 or ] }
-        { free-space [ free-space>> 0 or ] }
-        { used-space [ used-space>> 0 or ] }
-        { total-space [ total-space>> 0 or ] }
-        { percent-used [
+        { +device-name+ [ device-name>> "" or ] }
+        { +mount-point+ [ mount-point>> "" or ] }
+        { +type+ [ type>> "" or ] }
+        { +available-space+ [ available-space>> 0 or ] }
+        { +free-space+ [ free-space>> 0 or ] }
+        { +used-space+ [ used-space>> 0 or ] }
+        { +total-space+ [ total-space>> 0 or ] }
+        { +percent-used+ [
             [ used-space>> ] [ total-space>> ] bi
             [ 0 or ] bi@ dup 0 =
             [ 2drop 0 ] [ / percent ] if
@@ -116,8 +117,8 @@ percent-used percent-free ;
 
 : file-systems. ( -- )
     {
-        device-name available-space free-space used-space
-        total-space percent-used mount-point
+        +device-name+ +available-space+ +free-space+ +used-space+
+        +total-space+ +percent-used+ +mount-point+
     } print-file-systems ;
 
 {
diff --git a/basis/tools/files/summary.txt b/basis/tools/files/summary.txt
new file mode 100644 (file)
index 0000000..ec49d5b
--- /dev/null
@@ -0,0 +1 @@
+File listing and disk usage tools
index e63ab09076fdd1f99cec080effa7705f09812851..90e91529a1388925ca6ec2bb269022692304bfc4 100755 (executable)
@@ -47,21 +47,24 @@ IN: tools.files.unix
 
 M: unix (directory.) ( path -- lines )
     <listing-tool>
-        { permissions nlinks user group file-size file-date file-name } >>specs
+        {
+            +permissions+ +nlinks+ +user+ +group+
+            +file-size+ +file-date+ +file-name+
+        } >>specs
         { { directory-entry>> name>> <=> } } >>sort
     [ [ list-files ] with-group-cache ] with-user-cache ;
 
 M: unix file-spec>string ( file-listing spec -- string )
     {
-        { file-name/type [
+        { +file-name/type+ [
             directory-entry>> [ name>> ] [ file-type>trailing ] bi append
         ] }
-        { permissions [ file-info>> permissions-string ] }
-        { nlinks [ file-info>> nlink>> number>string ] }
-        { user [ file-info>> uid>> user-name ] }
-        { group [ file-info>> gid>> group-name ] }
-        { uid [ file-info>> uid>> number>string ] }
-        { gid [ file-info>> gid>> number>string ] }
+        { +permissions+ [ file-info>> permissions-string ] }
+        { +nlinks+ [ file-info>> nlink>> number>string ] }
+        { +user+ [ file-info>> uid>> user-name ] }
+        { +group+ [ file-info>> gid>> group-name ] }
+        { +uid+ [ file-info>> uid>> number>string ] }
+        { +gid+ [ file-info>> gid>> number>string ] }
         [ call-next-method ]
     } case ;
 
index f321c2fc7f4507ffa2807c4777bff49e99a9fb60..874b2ef5c1faf89af6d7348b04d70a0a9c92ecd6 100755 (executable)
@@ -9,7 +9,7 @@ IN: tools.files.windows
 
 M: windows (directory.) ( entries -- lines )
     <listing-tool>
-        { file-datetime directory-or-size file-name } >>specs
+        { +file-datetime+ +directory-or-size+ +file-name+ } >>specs
         { { directory-entry>> name>> <=> } } >>sort
     list-files ;
 
index 197ace74d8e8a7ceefdf073dc2b45ab626f3786a..5bf62ef1566e3731c7003ea1f7b4786b8867acca 100644 (file)
@@ -1,6 +1,6 @@
 IN: tools.profiler.tests
 USING: accessors tools.profiler tools.test kernel memory math
-threads alien tools.profiler.private sequences compiler.units
+threads alien tools.profiler.private sequences compiler
 words ;
 
 [ t ] [
index 9074c809869d790f3ee7dd123b99f666b8d1c808..4d1240ad3851044c6d3da7db05577cb79709f197 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax kernel strings words ;
+USING: help.markup help.syntax kernel strings words vocabs ;
 IN: tools.scaffold
 
 HELP: developer-name
@@ -13,7 +13,7 @@ HELP: help.
 { $description "Prints out scaffold help markup for a given word." } ;
 
 HELP: scaffold-help
-{ $values { "string" string } }
+{ $values { "vocab" vocab } }
 { $description "Takes an existing vocabulary and creates a help file with scaffolded help for each word. This word only works if no help file yet exists." } ;
 
 HELP: scaffold-undocumented
@@ -28,6 +28,21 @@ HELP: scaffold-vocab
      { "vocab-root" "a vocabulary root string" } { "string" string } }
 { $description "Creates a directory in the given root for a new vocabulary and adds a main .factor file, a tests file, and an authors.txt file." } ;
 
+HELP: scaffold-emacs
+{ $description "Touches the .emacs file in your home directory and provides a clickable link to open it in an editor." } ;
+
+HELP: scaffold-factor-boot-rc
+{ $description "Touches the .factor-boot-rc file in your home directory and provides a clickable link to open it in an editor." } ;
+
+HELP: scaffold-factor-rc
+{ $description "Touches the .factor-rc file in your home directory and provides a clickable link to open it in an editor." } ;
+
+HELP: scaffold-rc
+{ $values
+     { "path" "a pathname string" }
+}
+{ $description "Touches the given path in your home directory and provides a clickable link to open it in an editor." } ;
+
 HELP: using
 { $description "Stores the vocabularies that are pulled into the documentation file from looking up the stack effect types." } ;
 
@@ -40,7 +55,12 @@ ARTICLE: "tools.scaffold" "Scaffold tool"
 { $subsection scaffold-help }
 { $subsection scaffold-undocumented }
 { $subsection help. }
-"Types that are unrecognized by the scaffold generator will be of type " { $link null } ". The developer should change these to strings that describe the stack effect names instead."
+"Types that are unrecognized by the scaffold generator will be of type " { $link null } ". The developer should change these to strings that describe the stack effect names instead." $nl
+"Scaffolding a configuration file:"
+{ $subsection scaffold-rc }
+{ $subsection scaffold-factor-boot-rc }
+{ $subsection scaffold-factor-rc }
+{ $subsection scaffold-emacs }
 ;
 
 ABOUT: "tools.scaffold"
index acea9847002e5ee1f612ef48944e666ff9bae4e9..16729394bfc9416fb457148ba07300979901f929 100755 (executable)
@@ -5,7 +5,7 @@ io.encodings.utf8 hashtables kernel namespaces sequences
 vocabs.loader io combinators calendar accessors math.parser
 io.streams.string ui.tools.operations quotations strings arrays
 prettyprint words vocabs sorting sets classes math alien urls
-splitting ascii ;
+splitting ascii combinators.short-circuit ;
 IN: tools.scaffold
 
 SYMBOL: developer-name
@@ -18,37 +18,61 @@ ERROR: no-vocab vocab ;
 
 <PRIVATE
 
-: root? ( string -- ? ) vocab-roots get member? ;
+: vocab-root? ( string -- ? ) vocab-roots get member? ;
 
 : contains-dot? ( string -- ? ) ".." swap subseq? ;
 
 : contains-separator? ( string -- ? ) [ path-separator? ] any? ;
 
 : check-vocab-name ( string -- string )
-    dup contains-dot? [ vocab-name-contains-dot ] when
-    dup contains-separator? [ vocab-name-contains-separator ] when ;
+    [ ]
+    [ contains-dot? [ vocab-name-contains-dot ] when ]
+    [ contains-separator? [ vocab-name-contains-separator ] when ] tri ;
 
 : check-root ( string -- string )
-    dup root? [ not-a-vocab-root ] unless ;
+    dup vocab-root? [ not-a-vocab-root ] unless ;
+
+: check-vocab ( vocab -- vocab )
+    dup find-vocab-root [ no-vocab ] unless ;
+
+: check-vocab-root/vocab ( vocab-root string -- vocab-root string )
+    [ check-root ] [ check-vocab-name ] bi* ;
+
+: replace-vocab-separators ( vocab -- path )
+    path-separator first CHAR: . associate substitute ; inline
+
+: vocab-root/vocab>path ( vocab-root vocab -- path )
+    check-vocab-root/vocab
+    [ ] [ replace-vocab-separators ] bi* append-path ;
+
+: vocab>path ( vocab -- path )
+    check-vocab
+    [ find-vocab-root ] keep vocab-root/vocab>path ;
+
+: vocab-root/vocab/file>path ( vocab-root vocab file -- path )
+    [ vocab-root/vocab>path ] dip append-path ;
+
+: vocab-root/vocab/suffix>path ( vocab-root vocab suffix -- path )
+    [ vocab-root/vocab>path dup file-name append-path ] dip append ;
+
+: vocab/suffix>path ( vocab suffix -- path )
+    [ vocab>path dup file-name append-path ] dip append ;
 
 : directory-exists ( path -- )
     "Not creating a directory, it already exists: " write print ;
 
-: scaffold-directory ( path -- )
+: scaffold-directory ( vocab-root vocab -- )
+    vocab-root/vocab>path
     dup exists? [ directory-exists ] [ make-directories ] if ;
 
-: not-scaffolding ( path -- )
-    "Not creating scaffolding for " write <pathname> . ;
-
-: scaffolding ( path -- )
-    "Creating scaffolding for " write <pathname> . ;
+: not-scaffolding ( path -- path )
+    "Not creating scaffolding for " write dup <pathname> . ;
 
-: (scaffold-path) ( path string -- path )
-    dupd [ file-name ] dip append append-path ;
+: scaffolding ( path -- path )
+    "Creating scaffolding for " write dup <pathname> . ;
 
-: scaffold-path ( path string -- path ? )
-    (scaffold-path)
-    dup exists? [ dup not-scaffolding f ] [ dup scaffolding t ] if ;
+: scaffolding? ( path -- path ? )
+    dup exists? [ not-scaffolding f ] [ scaffolding t ] if ;
 
 : scaffold-copyright ( -- )
     "! Copyright (C) " write now year>> number>string write
@@ -62,37 +86,25 @@ ERROR: no-vocab vocab ;
         "IN: " write print
     ] with-string-writer ;
 
-: set-scaffold-main-file ( path vocab -- )
-    main-file-string swap utf8 set-file-contents ;
-
-: scaffold-main ( path vocab -- )
-    [ ".factor" scaffold-path ] dip
-    swap [ set-scaffold-main-file ] [ 2drop ] if ;
-
-: tests-file-string ( vocab -- string )
-    [
-        scaffold-copyright
-        "USING: tools.test " write dup write " ;" print
-        "IN: " write write ".tests" print
-    ] with-string-writer ;
-
-: set-scaffold-tests-file ( path vocab -- )
-    tests-file-string swap utf8 set-file-contents ;
+: set-scaffold-main-file ( vocab path -- )
+    [ main-file-string ] dip utf8 set-file-contents ;
 
-: scaffold-tests ( path vocab -- )
-    [ "-tests.factor" scaffold-path ] dip
-    swap [ set-scaffold-tests-file ] [ 2drop ] if ;
+: scaffold-main ( vocab-root vocab -- )
+    tuck ".factor" vocab-root/vocab/suffix>path scaffolding? [
+        set-scaffold-main-file
+    ] [
+        2drop
+    ] if ;
 
-: scaffold-authors ( path -- )
-    "authors.txt" append-path dup exists? [
-        not-scaffolding
+: scaffold-authors ( vocab-root vocab -- )
+    "authors.txt" vocab-root/vocab/file>path scaffolding? [
+        [ developer-name get ] dip utf8 set-file-contents
     ] [
-        dup scaffolding
-        developer-name get swap utf8 set-file-contents
+        drop
     ] if ;
 
 : lookup-type ( string -- object/string ? )
-    "new" ?head drop [ [ CHAR: ' = ] [ digit? ] bi or ] trim-tail
+    "new" ?head drop [ { [ CHAR: ' = ] [ digit? ] } 1|| ] trim-tail
     H{
         { "object" object } { "obj" object }
         { "quot" quotation }
@@ -134,6 +146,9 @@ ERROR: no-vocab vocab ;
         " }" write
     ] each ;
 
+: 4bl ( -- )
+    "    " write ; inline
+
 : $values. ( word -- )
     "declared-effect" word-prop [
         [ in>> ] [ out>> ] bi
@@ -141,8 +156,8 @@ ERROR: no-vocab vocab ;
             2drop
         ] [
             "{ $values" print
-            [ "    " write ($values.) ]
-            [ [ nl "    " write ($values.) ] unless-empty ] bi*
+            [ 4bl ($values.) ]
+            [ [ nl 4bl ($values.) ] unless-empty ] bi*
             nl "}" print
         ] if
     ] when* ;
@@ -151,21 +166,21 @@ ERROR: no-vocab vocab ;
     drop
     "{ $description \"\" } ;" print ;
 
-: help-header. ( word -- )
+: docs-header. ( word -- )
     "HELP: " write name>> print ;
 
 : (help.) ( word -- )
-    [ help-header. ] [ $values. ] [ $description. ] tri ;
+    [ docs-header. ] [ $values. ] [ $description. ] tri ;
 
 : interesting-words ( vocab -- array )
     words
-    [ [ "help" word-prop ] [ predicate? ] bi or not ] filter
+    [ { [ "help" word-prop ] [ predicate? ] } 1|| not ] filter
     natural-sort ;
 
 : interesting-words. ( vocab -- )
     interesting-words [ (help.) nl ] each ;
 
-: help-file-string ( vocab -- str2 )
+: docs-file-string ( vocab -- str2 )
     [
         {
             [ "IN: " write print nl ]
@@ -186,62 +201,68 @@ ERROR: no-vocab vocab ;
     [ bl write ] each
     " ;" print ;
 
-: set-scaffold-help-file ( path vocab -- )
-    swap utf8 <file-writer> [
+: set-scaffold-docs-file ( vocab path -- )
+    utf8 <file-writer> [
         scaffold-copyright
-        [ help-file-string ] [ write-using ] bi
+        [ docs-file-string ] [ write-using ] bi
         write
     ] with-output-stream ;
 
-: check-scaffold ( vocab-root string -- vocab-root string )
-    [ check-root ] [ check-vocab-name ] bi* ;
-
-: vocab>scaffold-path ( vocab-root string -- path )
-    path-separator first CHAR: . associate substitute
-    append-path ;
-
-: prepare-scaffold ( vocab-root string -- string path )
-    check-scaffold [ vocab>scaffold-path ] keep ;
-
 : with-scaffold ( quot -- )
     [ H{ } clone using ] dip with-variable ; inline
 
-: check-vocab ( vocab -- vocab )
-    dup find-vocab-root [ no-vocab ] unless ;
-
-PRIVATE>
-
 : link-vocab ( vocab -- )
     check-vocab
     "Edit documentation: " write
-    [ find-vocab-root ]
-    [ vocab>scaffold-path ] bi
-    "-docs.factor" (scaffold-path) <pathname> . ;
+    "-docs.factor" vocab/suffix>path <pathname> . ;
+
+PRIVATE>
 
 : help. ( word -- )
     [ (help.) ] [ nl vocabulary>> link-vocab ] bi ;
 
-: scaffold-help ( string -- )
+: scaffold-help ( vocab -- )
     [
-        [ find-vocab-root ] [ check-vocab ] bi
-        prepare-scaffold
-        [ "-docs.factor" scaffold-path ] dip
-        swap [ set-scaffold-help-file ] [ 2drop ] if
+        dup "-docs.factor" vocab/suffix>path scaffolding? [
+            set-scaffold-docs-file
+        ] [
+            2drop
+        ] if
     ] with-scaffold ;
 
 : scaffold-undocumented ( string -- )
     [ interesting-words. ] [ link-vocab ] bi ;
 
 : scaffold-vocab ( vocab-root string -- )
-    prepare-scaffold
     {
-        [ drop scaffold-directory ]
+        [ scaffold-directory ]
         [ scaffold-main ]
-        [ scaffold-tests ]
-        [ drop scaffold-authors ]
+        [ scaffold-authors ]
         [ nip require ]
     } 2cleave ;
 
+<PRIVATE
+
+: tests-file-string ( vocab -- string )
+    [
+        scaffold-copyright
+        "USING: tools.test " write dup write " ;" print
+        "IN: " write write ".tests" print
+    ] with-string-writer ;
+
+: set-scaffold-tests-file ( vocab path -- )
+    [ tests-file-string ] dip utf8 set-file-contents ;
+
+PRIVATE>
+
+: scaffold-tests ( vocab -- )
+    dup "-tests.factor" vocab/suffix>path
+    scaffolding? [
+        set-scaffold-tests-file
+    ] [
+        2drop
+    ] if ;
+
 SYMBOL: examples-flag
 
 : example ( -- )
@@ -250,7 +271,7 @@ SYMBOL: examples-flag
         "           \"\""
         "           \"\""
         "}"
-    } [ examples-flag get [ "    " write ] when print ] each ;
+    } [ examples-flag get [ 4bl ] when print ] each ;
 
 : examples ( n -- )
     t \ examples-flag [
@@ -260,10 +281,11 @@ SYMBOL: examples-flag
     ] with-variable ;
 
 : scaffold-rc ( path -- )
+    [ home ] dip append-path
     [ touch-file ] [ "Click to edit: " write <pathname> . ] bi ;
 
-: scaffold-factor-boot-rc ( -- )
-    home ".factor-boot-rc" append-path scaffold-rc ;
+: scaffold-factor-boot-rc ( -- ) ".factor-boot-rc" scaffold-rc ;
+
+: scaffold-factor-rc ( -- ) ".factor-rc" scaffold-rc ;
 
-: scaffold-factor-rc ( -- )
-    home ".factor-rc" append-path scaffold-rc ;
+: scaffold-emacs ( -- ) ".emacs" scaffold-rc ;
diff --git a/basis/tools/scaffold/summary.txt b/basis/tools/scaffold/summary.txt
new file mode 100644 (file)
index 0000000..9355d14
--- /dev/null
@@ -0,0 +1 @@
+Tool to create the scaffolding for new vocabularies
diff --git a/basis/tools/threads/summary.txt b/basis/tools/threads/summary.txt
new file mode 100644 (file)
index 0000000..3a94df1
--- /dev/null
@@ -0,0 +1 @@
+Listing running threads
diff --git a/basis/tools/vocabs/browser/summary.txt b/basis/tools/vocabs/browser/summary.txt
new file mode 100644 (file)
index 0000000..28b4850
--- /dev/null
@@ -0,0 +1 @@
+Browsing vocabularies
diff --git a/basis/tools/vocabs/summary.txt b/basis/tools/vocabs/summary.txt
new file mode 100644 (file)
index 0000000..1ae5f43
--- /dev/null
@@ -0,0 +1 @@
+Reloading vocabularies and cross-referencing vocabularies
index fe380e0afe6cbcf7cb56fc24ff736553ab1b65cf..6167a5be233fe5a42884d8d667c9be52563e1e45 100644 (file)
@@ -241,6 +241,12 @@ M: vocab-link summary vocab-summary ;
         swap [ "." glue ] with map\r
     ] unless-empty ;\r
 \r
+: vocab-dir? ( root name -- ? )\r
+    over\r
+    [ ".factor" vocab-dir+ append-path exists? ]\r
+    [ 2drop f ]\r
+    if ;\r
+\r
 : vocabs-in-dir ( root name -- )\r
     dupd (all-child-vocabs) [\r
         2dup vocab-dir? [ dup >vocab-link , ] when\r
index 3201779cc5026822e96a68f3a12a3d71654da0db..9e32f2f4de70e3fd54ddb1106262df85e657859b 100644 (file)
@@ -14,15 +14,15 @@ IN: ui.cocoa.views
     #! Cocoa -> Factor UI button mapping
     -> buttonNumber H{ { 0 1 } { 2 2 } { 1 3 } } at ;
 
-: modifiers
+CONSTANT: modifiers
     {
         { S+ HEX: 20000 }
         { C+ HEX: 40000 }
         { A+ HEX: 100000 }
         { M+ HEX: 80000 }
-    } ;
+    }
 
-: key-codes
+CONSTANT: key-codes
     H{
         { 71 "CLEAR" }
         { 36 "RET" }
@@ -47,7 +47,7 @@ IN: ui.cocoa.views
         { 126 "UP" }
         { 116 "PAGE_UP" }
         { 121 "PAGE_DOWN" }
-    } ;
+    }
 
 : key-code ( event -- string ? )
     dup -> keyCode key-codes at
index dabc12d3ae7cda020288f5a768dcf061cbfcdf81..3deb280c83992bcc515b1d9a69f8d98ce4ff5a0e 100644 (file)
@@ -173,7 +173,7 @@ TUPLE: radio-paint < caching-pen color interior-vertices boundary-vertices ;
 
 <PRIVATE
 
-: circle-steps 8 ;
+CONSTANT: circle-steps 8
 
 PRIVATE>
 
diff --git a/basis/ui/gadgets/canvas/summary.txt b/basis/ui/gadgets/canvas/summary.txt
new file mode 100644 (file)
index 0000000..70b35e6
--- /dev/null
@@ -0,0 +1 @@
+Canvas gadget for caching rendering to a display list
index ae4c7d929a5d3658839ce6ad4f28a8ab83dde066..a4d6b46129bd2b10844cc2910af31169bf619dad 100644 (file)
@@ -13,16 +13,16 @@ M: glue pref-dim* drop { 0 0 } ;
 
 : <frame-grid> ( -- grid ) 9 [ <glue> ] replicate 3 group ;
 
-: @center 1 1 ; inline
-: @left 0 1 ; inline
-: @right 2 1 ; inline
-: @top 1 0 ; inline
-: @bottom 1 2 ; inline
-
-: @top-left 0 0 ; inline
-: @top-right 2 0 ; inline
-: @bottom-left 0 2 ; inline
-: @bottom-right 2 2 ; inline
+: @center ( -- i j ) 1 1 ; inline
+: @left ( -- i j ) 0 1 ; inline
+: @right ( -- i j ) 2 1 ; inline
+: @top ( -- i j ) 1 0 ; inline
+: @bottom ( -- i j ) 1 2 ; inline
+
+: @top-left ( -- i j ) 0 0 ; inline
+: @top-right ( -- i j ) 2 0 ; inline
+: @bottom-left ( -- i j ) 0 2 ; inline
+: @bottom-right ( -- i j ) 2 2 ; inline
 
 TUPLE: frame < grid ;
 
index 1c2055156ea346020159fb51e1d0ea1ab21aa0f5..f22bd08ba27736d3977777410b5f00b0422a5be4 100644 (file)
@@ -18,7 +18,7 @@ TUPLE: slider < frame elevator thumb saved line ;
 : elevator-length ( slider -- n )
   [ elevator>> dim>> ] [ orientation>> ] bi v. ;
 
-: min-thumb-dim 15 ;
+CONSTANT: min-thumb-dim 15
 
 : slider-value ( gadget -- n ) model>> range-value >fixnum ;
 : slider-page  ( gadget -- n ) model>> range-page-value    ;
index 6ca3868d87d9ce2245943dae52466c3af61f11d7..7dabd994c2668b105691247d1e833bb438380321 100644 (file)
@@ -56,6 +56,6 @@ IN: ui.gadgets.theme
         T{ gray f 0.5  1.0 }
     } <gradient> ;
 
-: sans-serif-font { "sans-serif" plain 12 } ;
+CONSTANT: sans-serif-font { "sans-serif" plain 12 }
 
-: monospace-font { "monospace" plain 12 } ;
+CONSTANT: monospace-font { "monospace" plain 12 }
index bcfca946dd0ceb3cc3c2ad17d5037456107dcb35..8ba0e5dac7d532e57d3ebe63c139609aade285ea 100644 (file)
@@ -1,8 +1,8 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays definitions kernel ui.commands
 ui.gestures sequences strings math words generic namespaces make
-hashtables help.markup quotations assocs fry ;
+hashtables help.markup quotations assocs fry linked-assocs ;
 IN: ui.operations
 
 SYMBOL: +keyboard+
@@ -34,8 +34,11 @@ M: operation command-word command>> command-word ;
 
 SYMBOL: operations
 
+operations [ <linked-hash> ] initialize
+
 : object-operations ( obj -- operations )
-    operations get [ predicate>> call ] with filter ;
+    operations get values
+    [ predicate>> call ] with filter ;
 
 : find-operation ( obj quot -- command )
     [ object-operations ] dip find-last nip ; inline
@@ -51,10 +54,14 @@ SYMBOL: operations
 : default-flags ( -- assoc )
     H{ { +keyboard+ f } { +primary+ f } { +secondary+ f } } ;
 
+: (define-operation) ( operation -- )
+    dup [ command>> ] [ predicate>> ] bi
+    2array operations get set-at ;
+
 : define-operation ( pred command flags -- )
     default-flags swap assoc-union
     dupd define-command <operation>
-    operations get push ;
+    (define-operation) ;
 
 : modify-operation ( hook translator operation -- operation )
     clone
index 5cbac9798a054f096eb736b12d0eaa9619b9c38b..a913c78f7d68478e447c3d8f0b84b86c2abd9227 100755 (executable)
@@ -191,11 +191,11 @@ M: polygon draw-interior
     [ [ GL_POLYGON 0 ] dip interior-count>> glDrawArrays ]
     tri ;
 
-: arrow-up    { { 3 0 } { 6 6 } { 0 6 } } ;
-: arrow-right { { 0 0 } { 6 3 } { 0 6 } } ;
-: arrow-down  { { 0 0 } { 6 0 } { 3 6 } } ;
-: arrow-left  { { 0 3 } { 6 0 } { 6 6 } } ;
-: close-box   { { 0 0 } { 6 0 } { 6 6 } { 0 6 } } ;
+CONSTANT: arrow-up { { 3 0 } { 6 6 } { 0 6 } }
+CONSTANT: arrow-right { { 0 0 } { 6 3 } { 0 6 } }
+CONSTANT: arrow-down { { 0 0 } { 6 0 } { 3 6 } }
+CONSTANT: arrow-left { { 0 3 } { 6 0 } { 6 6 } }
+CONSTANT: close-box { { 0 0 } { 6 0 } { 6 6 } { 0 6 } }
 
 : <polygon-gadget> ( color points -- gadget )
     dup max-dim
diff --git a/basis/ui/tools/deploy/summary.txt b/basis/ui/tools/deploy/summary.txt
new file mode 100644 (file)
index 0000000..c6f4980
--- /dev/null
@@ -0,0 +1 @@
+Graphical front-end for deploy tool
index a9405424dc283d72cd1f4f49cce790fb9e5d29b2..d8802d66c934ee2fb6f35afff69fd723225a70ba 100644 (file)
@@ -12,8 +12,6 @@ sequences tools.vocabs classes compiler.units accessors
 vocabs.parser ;
 IN: ui.tools.operations
 
-V{ } clone operations set-global
-
 ! Objects
 [ drop t ] \ inspect H{
     { +primary+ t }
diff --git a/basis/ui/windows/summary.txt b/basis/ui/windows/summary.txt
new file mode 100644 (file)
index 0000000..9a0a894
--- /dev/null
@@ -0,0 +1 @@
+Windows UI backend
index c22fcb6cbefce746854294b19a1c36c465b0251e..9df694ee37779c23bd94302e5efea0a4d2c38ee5 100755 (executable)
@@ -104,7 +104,7 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
     [ lo-word ] keep hi-word 2array
     swap window (>>window-loc) ;
 
-: wm-keydown-codes ( -- key )
+CONSTANT: wm-keydown-codes
     H{
         { 8 "BACKSPACE" }
         { 9 "TAB" }
@@ -132,7 +132,7 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
         { 121 "F10" }
         { 122 "F11" }
         { 123 "F12" }
-    } ;
+    }
 
 : key-state-down? ( key -- ? )
     GetKeyState 16 bit? ;
@@ -155,22 +155,22 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
         alt? [ A+ , ] when
     ] { } make [ empty? not ] keep f ? ;
 
-: exclude-keys-wm-keydown
+CONSTANT: exclude-keys-wm-keydown
     H{
         { 16 "SHIFT" }
         { 17 "CTRL" }
         { 18 "ALT" }
         { 20 "CAPS-LOCK" }
-    } ;
+    }
 
-: exclude-keys-wm-char
-    ! Values are ignored
+! Values are ignored
+CONSTANT: exclude-keys-wm-char
     H{
         { 8 "BACKSPACE" }
         { 9 "TAB" }
         { 13 "RET" }
         { 27 "ESC" }
-    } ;
+    }
 
 : exclude-key-wm-keydown? ( n -- ? )
     exclude-keys-wm-keydown key? ;
diff --git a/basis/ui/x11/summary.txt b/basis/ui/x11/summary.txt
new file mode 100644 (file)
index 0000000..046c83a
--- /dev/null
@@ -0,0 +1 @@
+X11 UI backend
index 34cff4277790d35a405836b148c3cb12ae1a375f..d0d7eeb2346dd2811c53cf83e7bb45a310c73a0b 100755 (executable)
@@ -29,14 +29,14 @@ M: world configure-event
     ! In case dimensions didn't change
     relayout-1 ;
 
-: modifiers
+CONSTANT: modifiers
     {
         { S+ HEX: 1 }
         { C+ HEX: 4 }
         { A+ HEX: 8 }
-    } ;
-    
-: key-codes
+    }
+
+CONSTANT: key-codes
     H{
         { HEX: FF08 "BACKSPACE" }
         { HEX: FF09 "TAB"       }
@@ -62,7 +62,7 @@ M: world configure-event
         { HEX: FFC4 "F7"        }
         { HEX: FFC5 "F8"        }
         { HEX: FFC6 "F9"        }
-    } ;
+    }
 
 : key-code ( keysym -- keycode action? )
     dup key-codes at [ t ] [ 1string f ] ?if ;
index b91cb2b26cc3f39b2e9bfb617ccdc0b749deb9c8..d8e220cf1816903c568ad057922fa934c8b59b06 100644 (file)
@@ -10,10 +10,10 @@ IN: unicode.breaks.tests
         dup last-grapheme head last-grapheme ] unit-test
 
 : grapheme-break-test ( -- filename )
-    "resource:basis/unicode/breaks/GraphemeBreakTest.txt" ;
+    "vocab:unicode/breaks/GraphemeBreakTest.txt" ;
 
 : word-break-test ( -- filename )
-    "resource:basis/unicode/breaks/WordBreakTest.txt" ;
+    "vocab:unicode/breaks/WordBreakTest.txt" ;
 
 : parse-test-file ( file-name -- tests )
     utf8 file-lines
index 6bcf8b50ccda03bdf9cadec546cdabee8e2cda51..2f8daef8b216a4eb4a35fefa0f295ac41b4cc0ba 100644 (file)
@@ -127,7 +127,7 @@ to: grapheme-table
 
 VALUE: word-break-table
 
-"resource:basis/unicode/data/WordBreakProperty.txt" load-script
+"vocab:unicode/data/WordBreakProperty.txt" load-script
 to: word-break-table
 
 C-ENUM: wOther wCR wLF wNewline wExtend wFormat wKatakana wALetter wMidLetter
diff --git a/basis/unicode/breaks/summary.txt b/basis/unicode/breaks/summary.txt
new file mode 100644 (file)
index 0000000..4f73d98
--- /dev/null
@@ -0,0 +1 @@
+Unicode grapheme and word breaking
diff --git a/basis/unicode/case/summary.txt b/basis/unicode/case/summary.txt
new file mode 100644 (file)
index 0000000..a88f3d4
--- /dev/null
@@ -0,0 +1 @@
+Unicode case conversion
diff --git a/basis/unicode/categories/summary.txt b/basis/unicode/categories/summary.txt
new file mode 100644 (file)
index 0000000..7efad41
--- /dev/null
@@ -0,0 +1 @@
+Unicode character categories
index d3d0b8199d5f3b1eee0757b6c17d98f4e24fa47c..f53a1382ae0591f95be8742472468ef8a1c00b74 100644 (file)
@@ -4,7 +4,7 @@ tools.test assocs words ;
 IN: unicode.collation.tests\r
 \r
 : parse-test ( -- strings )\r
-    "resource:basis/unicode/collation/CollationTest_SHIFTED.txt"\r
+    "vocab:unicode/collation/CollationTest_SHIFTED.txt"\r
     utf8 file-lines 5 tail\r
     [ ";" split1 drop " " split [ hex> ] "" map-as ] map ;\r
 \r
index a8bd788e2a4c042c1e2ab32f90c21a0306a38a87..2a94d501bdce30de81e10bc4db287f554760ce80 100755 (executable)
@@ -24,12 +24,11 @@ TUPLE: weight primary secondary tertiary ignorable? ;
     ";" split1 [ [ blank? ] trim ] bi@\r
     [ " " split [ hex> ] "" map-as ] [ parse-weight ] bi* ;\r
 \r
-: parse-ducet ( stream -- ducet )\r
-    lines filter-comments\r
+: parse-ducet ( file -- ducet )\r
+    ascii file-lines filter-comments\r
     [ parse-line ] H{ } map>assoc ;\r
 \r
-"resource:basis/unicode/collation/allkeys.txt"\r
-ascii <file-reader> parse-ducet to: ducet\r
+"vocab:unicode/collation/allkeys.txt" parse-ducet to: ducet\r
 \r
 ! Fix up table for long contractions\r
 : help-one ( assoc key -- )\r
diff --git a/basis/unicode/collation/summary.txt b/basis/unicode/collation/summary.txt
new file mode 100644 (file)
index 0000000..0b855e1
--- /dev/null
@@ -0,0 +1 @@
+Unicode string comparison and sorting (collation)
diff --git a/basis/unicode/collation/tags.txt b/basis/unicode/collation/tags.txt
new file mode 100644 (file)
index 0000000..8e27be7
--- /dev/null
@@ -0,0 +1 @@
+text
index 2407b740b01162a5a5305a7957af19b0ea8ead6e..bff4ddeaab3856507e3606cc52aaf08e4f44aead 100644 (file)
@@ -38,7 +38,7 @@ VALUE: properties
     ascii file-lines [ split-; ] map ;
 
 : load-data ( -- data )
-    "resource:basis/unicode/data/UnicodeData.txt" data ;
+    "vocab:unicode/data/UnicodeData.txt" data ;
 
 : filter-comments ( lines -- lines )
     [ "#@" split first ] map harvest ;
@@ -68,7 +68,7 @@ VALUE: properties
     [ " " split [ hex> ] map ] assoc-map ;
 
 : exclusions-file ( -- filename )
-    "resource:basis/unicode/data/CompositionExclusions.txt" ;
+    "vocab:unicode/data/CompositionExclusions.txt" ;
 
 : exclusions ( -- set )
     exclusions-file utf8 file-lines
@@ -97,8 +97,8 @@ VALUE: properties
     [ nip zero? not ] assoc-filter
     >hashtable ;
 
-: categories ( -- names )
-    ! For non-existent characters, use Cn
+! For non-existent characters, use Cn
+CONSTANT: categories
     { "Cn"
       "Lu" "Ll" "Lt" "Lm" "Lo"
       "Mn" "Mc" "Me"
@@ -106,9 +106,9 @@ VALUE: properties
       "Pc" "Pd" "Ps" "Pe" "Pi" "Pf" "Po"
       "Sm" "Sc" "Sk" "So"
       "Zs" "Zl" "Zp"
-      "Cc" "Cf" "Cs" "Co" } ;
+      "Cc" "Cf" "Cs" "Co" }
 
-: num-chars HEX: 2FA1E ;
+CONSTANT: num-chars HEX: 2FA1E
 
 ! the maximum unicode char in the first 3 planes
 
@@ -147,7 +147,7 @@ C: <code-point> code-point
 
 ! Extra properties
 : properties-lines ( -- lines )
-    "resource:basis/unicode/data/PropList.txt"
+    "vocab:unicode/data/PropList.txt"
     ascii file-lines ;
 
 : parse-properties ( -- {{[a,b],prop}} )
@@ -166,7 +166,7 @@ C: <code-point> code-point
 
 ! Special casing data
 : load-special-casing ( -- special-casing )
-    "resource:basis/unicode/data/SpecialCasing.txt" data
+    "vocab:unicode/data/SpecialCasing.txt" data
     [ length 5 = ] filter
     [ [ set-code-point ] each ] H{ } make-assoc ;
 
@@ -196,9 +196,9 @@ load-properties to: properties
 
 SYMBOL: interned
 
-: parse-script ( stream -- assoc )
+: parse-script ( filename -- assoc )
     ! assoc is code point/range => name
-    lines filter-comments [ split-; ] map ;
+    ascii file-lines filter-comments [ split-; ] map ;
 
 : range, ( value key -- )
     swap interned get
@@ -218,7 +218,7 @@ SYMBOL: interned
     [ expand-ranges ] with-variable ;
 
 : load-script ( filename -- table )
-    ascii <file-reader> parse-script process-script ;
+    parse-script process-script ;
 
 [ name>char [ "Invalid character" throw ] unless* ]
 name>char-hook set-global
diff --git a/basis/unicode/data/summary.txt b/basis/unicode/data/summary.txt
new file mode 100644 (file)
index 0000000..c956b23
--- /dev/null
@@ -0,0 +1 @@
+Parsing Unicode data files
index 1242e1d358cca1b0f58b1722934672755fd3ab13..f3ecb96af97dc72c1d17fd4f96b9dd22d3531a38 100644 (file)
@@ -23,7 +23,7 @@ IN: unicode.normalize.tests
 [ "\u00d55c" ] [ "\u001112\u001161\u0011ab" nfc ] unit-test
 
 : parse-test ( -- tests )
-    "resource:basis/unicode/normalize/NormalizationTest.txt"
+    "vocab:unicode/normalize/NormalizationTest.txt"
     utf8 file-lines filter-comments
     [ ";" split 5 head [ " " split [ hex> ] "" map-as ] map ] map ;
 
diff --git a/basis/unicode/normalize/summary.txt b/basis/unicode/normalize/summary.txt
new file mode 100644 (file)
index 0000000..bd8b166
--- /dev/null
@@ -0,0 +1 @@
+Unicode string normalization
index aaa6767685f17bcaeaac02563f1c19f30b6c506e..383f9e3de3ca4c225325af461283327d29e1f888 100644 (file)
@@ -9,7 +9,7 @@ IN: unicode.script
 
 VALUE: script-table
 
-"resource:basis/unicode/script/Scripts.txt" load-script
+"vocab:unicode/script/Scripts.txt" load-script
 to: script-table
 
 : script-of ( char -- script )
diff --git a/basis/unicode/script/tags.txt b/basis/unicode/script/tags.txt
new file mode 100644 (file)
index 0000000..8e27be7
--- /dev/null
@@ -0,0 +1 @@
+text
index ece1e61b5fa94dc8778d886981bb89f76c4b6455..8bd1149524170dc0fe7e6eca5925ab95c4b6a3da 100644 (file)
@@ -1 +1 @@
-Unicode 5.0 support
+Unicode 5.1 support
diff --git a/basis/unicode/syntax/summary.txt b/basis/unicode/syntax/summary.txt
new file mode 100644 (file)
index 0000000..651d51c
--- /dev/null
@@ -0,0 +1 @@
+Parsing words used by Unicode implementation
index f4d91df245e093d0827e98be102471ead4e3783c..b2a50b7374711e536b33696799a9dddd9edf3f7d 100644 (file)
@@ -46,7 +46,7 @@ PRIVATE>
 
 : group-name ( id -- string )
     dup group-cache get [
-        dupd at* [ name>> nip ] [ drop number>string ] if
+        ?at [ name>> ] [ number>string ] if
     ] [
         group-struct [ group-gr_name ] [ f ] if*
     ] if*
diff --git a/basis/unix/groups/summary.txt b/basis/unix/groups/summary.txt
new file mode 100644 (file)
index 0000000..f782bdd
--- /dev/null
@@ -0,0 +1 @@
+Working with Unix user groups
index 0bcb88641757c228ce4f036de0060a5a7c459e51..b60a0b1adc35a626d16733b3146a580572273eec 100644 (file)
@@ -6,8 +6,8 @@ cell-bits {
     { 64 [ "unix.stat.netbsd.64" require ] }
 } case
 
-: _VFS_NAMELEN    32   ; inline
-: _VFS_MNAMELEN   1024 ; inline
+CONSTANT: _VFS_NAMELEN    32  
+CONSTANT: _VFS_MNAMELEN   1024
 
 C-STRUCT: statvfs
     { "ulong"   "f_flag" }   
diff --git a/basis/unix/users/summary.txt b/basis/unix/users/summary.txt
new file mode 100644 (file)
index 0000000..8c1aa0d
--- /dev/null
@@ -0,0 +1 @@
+Working with Unix users
diff --git a/basis/unrolled-lists/summary.txt b/basis/unrolled-lists/summary.txt
new file mode 100644 (file)
index 0000000..c9014d1
--- /dev/null
@@ -0,0 +1 @@
+Deque implementation with constant-time insertion and removal at either end, and better space efficiency than a double-linked list
index d434632abd381f5264c5f728719b593d383a42f2..bd4a2c1114b01d759a335b7e002826a8d331fd81 100644 (file)
@@ -4,7 +4,7 @@ USING: arrays math kernel accessors sequences sequences.private
 deques search-deques hashtables ;
 IN: unrolled-lists
 
-: unroll-factor 32 ; inline
+CONSTANT: unroll-factor 32
 
 <PRIVATE
 
diff --git a/basis/urls/secure/summary.txt b/basis/urls/secure/summary.txt
new file mode 100644 (file)
index 0000000..31692c0
--- /dev/null
@@ -0,0 +1 @@
+Support for https:// URLs
diff --git a/basis/vlists/summary.txt b/basis/vlists/summary.txt
new file mode 100644 (file)
index 0000000..4d6e6b2
--- /dev/null
@@ -0,0 +1 @@
+Persistent sequence implementation optimizing the case where there is no sharing
index 3494e83e8330c70dab4880970eabff1597ac3983..36acc5e3464edc5db53d63ec9d715fc0c70f1f92 100755 (executable)
@@ -993,8 +993,8 @@ FUNCTION: BOOL DuplicateHandle (
     BOOL bInheritHandle,
     DWORD dwOptions ) ;
 
-: DUPLICATE_CLOSE_SOURCE 1 ;
-: DUPLICATE_SAME_ACCESS 2 ;
+CONSTANT: DUPLICATE_CLOSE_SOURCE 1
+CONSTANT: DUPLICATE_SAME_ACCESS 2
 
 ! FUNCTION: EncodePointer
 ! FUNCTION: EncodeSystemPointer
@@ -1226,7 +1226,7 @@ FUNCTION: BOOL GetExitCodeProcess ( HANDLE hProcess, LPDWORD lpExitCode ) ;
 FUNCTION: DWORD GetFileAttributesW ( LPCTSTR lpFileName ) ;
 ! FUNCTION: GetFileAttributesExA
 
-: GetFileExInfoStandard 0 ; inline
+CONSTANT: GetFileExInfoStandard 0
 
 
 FUNCTION: BOOL GetFileAttributesExW ( LPCTSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation ) ;
index 3d080817bfc561fd8c33b20d94d06fcb21bba4ee..e69a9213b0622b67c07de9acd5a3ffd6142b0afd 100755 (executable)
@@ -20,61 +20,61 @@ FUNCTION: BOOL IsEqualGUID ( REFGUID rguid1, REFGUID rguid2 ) ;
 FUNCTION: int StringFromGUID2 ( REFGUID rguid, LPOLESTR lpsz, int cchMax ) ;
 FUNCTION: HRESULT CLSIDFromString ( LPOLESTR lpsz, REFGUID out_rguid ) ;
 
-: S_OK 0 ; inline
-: S_FALSE 1 ; inline
-: E_NOINTERFACE HEX: 80004002 ; inline
-: E_FAIL HEX: 80004005 ; inline
-: E_INVALIDARG HEX: 80070057 ; inline
-
-: MK_ALT HEX: 20 ; inline
-: DROPEFFECT_NONE 0 ; inline
-: DROPEFFECT_COPY 1 ; inline
-: DROPEFFECT_MOVE 2 ; inline
-: DROPEFFECT_LINK 4 ; inline
-: DROPEFFECT_SCROLL HEX: 80000000 ; inline
-: DD_DEFSCROLLINSET 11 ; inline
-: DD_DEFSCROLLDELAY 50 ; inline
-: DD_DEFSCROLLINTERVAL 50 ; inline
-: DD_DEFDRAGDELAY 200 ; inline
-: DD_DEFDRAGMINDIST 2 ; inline
-
-: CF_TEXT             1 ; inline
-: CF_BITMAP           2 ; inline
-: CF_METAFILEPICT     3 ; inline
-: CF_SYLK             4 ; inline
-: CF_DIF              5 ; inline
-: CF_TIFF             6 ; inline
-: CF_OEMTEXT          7 ; inline
-: CF_DIB              8 ; inline
-: CF_PALETTE          9 ; inline
-: CF_PENDATA          10 ; inline
-: CF_RIFF             11 ; inline
-: CF_WAVE             12 ; inline
-: CF_UNICODETEXT      13 ; inline
-: CF_ENHMETAFILE      14 ; inline
-: CF_HDROP            15 ; inline
-: CF_LOCALE           16 ; inline
-: CF_MAX              17 ; inline
-
-: CF_OWNERDISPLAY     HEX: 0080 ; inline
-: CF_DSPTEXT          HEX: 0081 ; inline
-: CF_DSPBITMAP        HEX: 0082 ; inline
-: CF_DSPMETAFILEPICT  HEX: 0083 ; inline
-: CF_DSPENHMETAFILE   HEX: 008E ; inline
-
-: DVASPECT_CONTENT    1 ; inline
-: DVASPECT_THUMBNAIL  2 ; inline
-: DVASPECT_ICON       4 ; inline
-: DVASPECT_DOCPRINT   8 ; inline
-
-: TYMED_HGLOBAL  1 ; inline
-: TYMED_FILE     2 ; inline
-: TYMED_ISTREAM  4 ; inline
-: TYMED_ISTORAGE 8 ; inline
-: TYMED_GDI      16 ; inline
-: TYMED_MFPICT   32 ; inline
-: TYMED_ENHMF    64 ; inline
-: TYMED_NULL     0 ; inline
+CONSTANT: S_OK 0
+CONSTANT: S_FALSE 1
+CONSTANT: E_NOINTERFACE HEX: 80004002
+CONSTANT: E_FAIL HEX: 80004005
+CONSTANT: E_INVALIDARG HEX: 80070057
+
+CONSTANT: MK_ALT HEX: 20
+CONSTANT: DROPEFFECT_NONE 0
+CONSTANT: DROPEFFECT_COPY 1
+CONSTANT: DROPEFFECT_MOVE 2
+CONSTANT: DROPEFFECT_LINK 4
+CONSTANT: DROPEFFECT_SCROLL HEX: 80000000
+CONSTANT: DD_DEFSCROLLINSET 11
+CONSTANT: DD_DEFSCROLLDELAY 50
+CONSTANT: DD_DEFSCROLLINTERVAL 50
+CONSTANT: DD_DEFDRAGDELAY 200
+CONSTANT: DD_DEFDRAGMINDIST 2
+
+CONSTANT: CF_TEXT             1
+CONSTANT: CF_BITMAP           2
+CONSTANT: CF_METAFILEPICT     3
+CONSTANT: CF_SYLK             4
+CONSTANT: CF_DIF              5
+CONSTANT: CF_TIFF             6
+CONSTANT: CF_OEMTEXT          7
+CONSTANT: CF_DIB              8
+CONSTANT: CF_PALETTE          9
+CONSTANT: CF_PENDATA          10
+CONSTANT: CF_RIFF             11
+CONSTANT: CF_WAVE             12
+CONSTANT: CF_UNICODETEXT      13
+CONSTANT: CF_ENHMETAFILE      14
+CONSTANT: CF_HDROP            15
+CONSTANT: CF_LOCALE           16
+CONSTANT: CF_MAX              17
+
+CONSTANT: CF_OWNERDISPLAY     HEX: 0080
+CONSTANT: CF_DSPTEXT          HEX: 0081
+CONSTANT: CF_DSPBITMAP        HEX: 0082
+CONSTANT: CF_DSPMETAFILEPICT  HEX: 0083
+CONSTANT: CF_DSPENHMETAFILE   HEX: 008E
+
+CONSTANT: DVASPECT_CONTENT    1
+CONSTANT: DVASPECT_THUMBNAIL  2
+CONSTANT: DVASPECT_ICON       4
+CONSTANT: DVASPECT_DOCPRINT   8
+
+CONSTANT: TYMED_HGLOBAL  1
+CONSTANT: TYMED_FILE     2
+CONSTANT: TYMED_ISTREAM  4
+CONSTANT: TYMED_ISTORAGE 8
+CONSTANT: TYMED_GDI      16
+CONSTANT: TYMED_MFPICT   32
+CONSTANT: TYMED_ENHMF    64
+CONSTANT: TYMED_NULL     0
 
 C-STRUCT: DVTARGETDEVICE
     { "DWORD" "tdSize" }
@@ -101,10 +101,10 @@ C-STRUCT: STGMEDIUM
     { "LPUNKNOWN" "punkForRelease" } ;
 TYPEDEF: STGMEDIUM* LPSTGMEDIUM
 
-: COINIT_MULTITHREADED     0 ; inline
-: COINIT_APARTMENTTHREADED 2 ; inline
-: COINIT_DISABLE_OLE1DDE   4 ; inline
-: COINIT_SPEED_OVER_MEMORY 8 ; inline
+CONSTANT: COINIT_MULTITHREADED     0
+CONSTANT: COINIT_APARTMENTTHREADED 2
+CONSTANT: COINIT_DISABLE_OLE1DDE   4
+CONSTANT: COINIT_SPEED_OVER_MEMORY 8
 
 FUNCTION: HRESULT OleInitialize ( void* reserved ) ;
 FUNCTION: HRESULT CoInitializeEx ( void* reserved, DWORD dwCoInit ) ;
index 63384e8858f2754674bb73ffb2d0e143c544c2f4..d0b396eba22e64581130cfc50338dbd32efbc8e3 100755 (executable)
@@ -6,70 +6,70 @@ sequences libc ;
 IN: windows.opengl32
 
 ! PIXELFORMATDESCRIPTOR flags
-: PFD_DOUBLEBUFFER            HEX: 00000001 ; inline
-: PFD_STEREO                  HEX: 00000002 ; inline
-: PFD_DRAW_TO_WINDOW          HEX: 00000004 ; inline
-: PFD_DRAW_TO_BITMAP          HEX: 00000008 ; inline
-: PFD_SUPPORT_GDI             HEX: 00000010 ; inline
-: PFD_SUPPORT_OPENGL          HEX: 00000020 ; inline
-: PFD_GENERIC_FORMAT          HEX: 00000040 ; inline
-: PFD_NEED_PALETTE            HEX: 00000080 ; inline
-: PFD_NEED_SYSTEM_PALETTE     HEX: 00000100 ; inline
-: PFD_SWAP_EXCHANGE           HEX: 00000200 ; inline
-: PFD_SWAP_COPY               HEX: 00000400 ; inline
-: PFD_SWAP_LAYER_BUFFERS      HEX: 00000800 ; inline
-: PFD_GENERIC_ACCELERATED     HEX: 00001000 ; inline
-: PFD_SUPPORT_DIRECTDRAW      HEX: 00002000 ; inline
+CONSTANT: PFD_DOUBLEBUFFER            HEX: 00000001
+CONSTANT: PFD_STEREO                  HEX: 00000002
+CONSTANT: PFD_DRAW_TO_WINDOW          HEX: 00000004
+CONSTANT: PFD_DRAW_TO_BITMAP          HEX: 00000008
+CONSTANT: PFD_SUPPORT_GDI             HEX: 00000010
+CONSTANT: PFD_SUPPORT_OPENGL          HEX: 00000020
+CONSTANT: PFD_GENERIC_FORMAT          HEX: 00000040
+CONSTANT: PFD_NEED_PALETTE            HEX: 00000080
+CONSTANT: PFD_NEED_SYSTEM_PALETTE     HEX: 00000100
+CONSTANT: PFD_SWAP_EXCHANGE           HEX: 00000200
+CONSTANT: PFD_SWAP_COPY               HEX: 00000400
+CONSTANT: PFD_SWAP_LAYER_BUFFERS      HEX: 00000800
+CONSTANT: PFD_GENERIC_ACCELERATED     HEX: 00001000
+CONSTANT: PFD_SUPPORT_DIRECTDRAW      HEX: 00002000
 
 ! PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only
-: PFD_DEPTH_DONTCARE          HEX: 20000000 ; inline
-: PFD_DOUBLEBUFFER_DONTCARE   HEX: 40000000 ; inline
-: PFD_STEREO_DONTCARE         HEX: 80000000 ; inline
+CONSTANT: PFD_DEPTH_DONTCARE          HEX: 20000000
+CONSTANT: PFD_DOUBLEBUFFER_DONTCARE   HEX: 40000000
+CONSTANT: PFD_STEREO_DONTCARE         HEX: 80000000
 
 ! pixel types
-: PFD_TYPE_RGBA        0 ; inline
-: PFD_TYPE_COLORINDEX  1 ; inline
+CONSTANT: PFD_TYPE_RGBA        0
+CONSTANT: PFD_TYPE_COLORINDEX  1
  
 ! layer types
-: PFD_MAIN_PLANE       0 ; inline
-: PFD_OVERLAY_PLANE    1 ; inline
-: PFD_UNDERLAY_PLANE   -1 ; inline
+CONSTANT: PFD_MAIN_PLANE       0
+CONSTANT: PFD_OVERLAY_PLANE    1
+CONSTANT: PFD_UNDERLAY_PLANE   -1
 
-: LPD_TYPE_RGBA        0 ; inline
-: LPD_TYPE_COLORINDEX  1 ; inline
+CONSTANT: LPD_TYPE_RGBA        0
+CONSTANT: LPD_TYPE_COLORINDEX  1
 
 ! wglSwapLayerBuffers flags
-: WGL_SWAP_MAIN_PLANE     HEX: 00000001 ; inline
-: WGL_SWAP_OVERLAY1       HEX: 00000002 ; inline
-: WGL_SWAP_OVERLAY2       HEX: 00000004 ; inline
-: WGL_SWAP_OVERLAY3       HEX: 00000008 ; inline
-: WGL_SWAP_OVERLAY4       HEX: 00000010 ; inline
-: WGL_SWAP_OVERLAY5       HEX: 00000020 ; inline
-: WGL_SWAP_OVERLAY6       HEX: 00000040 ; inline
-: WGL_SWAP_OVERLAY7       HEX: 00000080 ; inline
-: WGL_SWAP_OVERLAY8       HEX: 00000100 ; inline
-: WGL_SWAP_OVERLAY9       HEX: 00000200 ; inline
-: WGL_SWAP_OVERLAY10      HEX: 00000400 ; inline
-: WGL_SWAP_OVERLAY11      HEX: 00000800 ; inline
-: WGL_SWAP_OVERLAY12      HEX: 00001000 ; inline
-: WGL_SWAP_OVERLAY13      HEX: 00002000 ; inline
-: WGL_SWAP_OVERLAY14      HEX: 00004000 ; inline
-: WGL_SWAP_OVERLAY15      HEX: 00008000 ; inline
-: WGL_SWAP_UNDERLAY1      HEX: 00010000 ; inline
-: WGL_SWAP_UNDERLAY2      HEX: 00020000 ; inline
-: WGL_SWAP_UNDERLAY3      HEX: 00040000 ; inline
-: WGL_SWAP_UNDERLAY4      HEX: 00080000 ; inline
-: WGL_SWAP_UNDERLAY5      HEX: 00100000 ; inline
-: WGL_SWAP_UNDERLAY6      HEX: 00200000 ; inline
-: WGL_SWAP_UNDERLAY7      HEX: 00400000 ; inline
-: WGL_SWAP_UNDERLAY8      HEX: 00800000 ; inline
-: WGL_SWAP_UNDERLAY9      HEX: 01000000 ; inline
-: WGL_SWAP_UNDERLAY10     HEX: 02000000 ; inline
-: WGL_SWAP_UNDERLAY11     HEX: 04000000 ; inline
-: WGL_SWAP_UNDERLAY12     HEX: 08000000 ; inline
-: WGL_SWAP_UNDERLAY13     HEX: 10000000 ; inline
-: WGL_SWAP_UNDERLAY14     HEX: 20000000 ; inline
-: WGL_SWAP_UNDERLAY15     HEX: 40000000 ; inline
+CONSTANT: WGL_SWAP_MAIN_PLANE     HEX: 00000001
+CONSTANT: WGL_SWAP_OVERLAY1       HEX: 00000002
+CONSTANT: WGL_SWAP_OVERLAY2       HEX: 00000004
+CONSTANT: WGL_SWAP_OVERLAY3       HEX: 00000008
+CONSTANT: WGL_SWAP_OVERLAY4       HEX: 00000010
+CONSTANT: WGL_SWAP_OVERLAY5       HEX: 00000020
+CONSTANT: WGL_SWAP_OVERLAY6       HEX: 00000040
+CONSTANT: WGL_SWAP_OVERLAY7       HEX: 00000080
+CONSTANT: WGL_SWAP_OVERLAY8       HEX: 00000100
+CONSTANT: WGL_SWAP_OVERLAY9       HEX: 00000200
+CONSTANT: WGL_SWAP_OVERLAY10      HEX: 00000400
+CONSTANT: WGL_SWAP_OVERLAY11      HEX: 00000800
+CONSTANT: WGL_SWAP_OVERLAY12      HEX: 00001000
+CONSTANT: WGL_SWAP_OVERLAY13      HEX: 00002000
+CONSTANT: WGL_SWAP_OVERLAY14      HEX: 00004000
+CONSTANT: WGL_SWAP_OVERLAY15      HEX: 00008000
+CONSTANT: WGL_SWAP_UNDERLAY1      HEX: 00010000
+CONSTANT: WGL_SWAP_UNDERLAY2      HEX: 00020000
+CONSTANT: WGL_SWAP_UNDERLAY3      HEX: 00040000
+CONSTANT: WGL_SWAP_UNDERLAY4      HEX: 00080000
+CONSTANT: WGL_SWAP_UNDERLAY5      HEX: 00100000
+CONSTANT: WGL_SWAP_UNDERLAY6      HEX: 00200000
+CONSTANT: WGL_SWAP_UNDERLAY7      HEX: 00400000
+CONSTANT: WGL_SWAP_UNDERLAY8      HEX: 00800000
+CONSTANT: WGL_SWAP_UNDERLAY9      HEX: 01000000
+CONSTANT: WGL_SWAP_UNDERLAY10     HEX: 02000000
+CONSTANT: WGL_SWAP_UNDERLAY11     HEX: 04000000
+CONSTANT: WGL_SWAP_UNDERLAY12     HEX: 08000000
+CONSTANT: WGL_SWAP_UNDERLAY13     HEX: 10000000
+CONSTANT: WGL_SWAP_UNDERLAY14     HEX: 20000000
+CONSTANT: WGL_SWAP_UNDERLAY15     HEX: 40000000
 
 : windowed-pfd-dwFlags ( -- n )
     { PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_DOUBLEBUFFER } flags ;
index 6d1c7b1a366b8946872f93c2d622ddea5fc7a113..7802ceb297c27b8b0dcba804494707fb570a9d54 100644 (file)
@@ -86,7 +86,7 @@ FUNCTION: HINSTANCE ShellExecuteW ( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFi
 ALIAS: ShellExecute ShellExecuteW
 
 : open-in-explorer ( dir -- )
-    f "open" rot (normalize-path) f f SW_SHOWNORMAL ShellExecute drop ;
+    [ f "open" ] dip (normalize-path) f f SW_SHOWNORMAL ShellExecute drop ;
 
 : shell32-directory ( n -- str )
     f swap f SHGFP_TYPE_DEFAULT
@@ -190,9 +190,9 @@ TYPEDEF: ITEMIDLIST ITEMID_CHILD
 TYPEDEF: ITEMID_CHILD* PITEMID_CHILD
 TYPEDEF: ITEMID_CHILD* PCUITEMID_CHILD
 
-: STRRET_WSTR 0 ; inline
-: STRRET_OFFSET 1 ; inline
-: STRRET_CSTR 2 ; inline
+CONSTANT: STRRET_WSTR 0
+CONSTANT: STRRET_OFFSET 1
+CONSTANT: STRRET_CSTR 2
 
 C-UNION: STRRET-union "LPWSTR" "LPSTR" "UINT" "char[260]" ;
 C-STRUCT: STRRET
index 8cc18d403949978b3b5df0be58ab91a9ba2104b7..ee74e47feaa223e86b7c1d2ba3dbb8417c4df412 100755 (executable)
@@ -205,10 +205,10 @@ TYPEDEF: size_t socklen_t
 
 TYPEDEF: void* WNDPROC
 
-: FALSE 0 ; inline
-: TRUE 1 ; inline
+CONSTANT: FALSE 0
+CONSTANT: TRUE 1
 
-: >BOOLEAN ( ? -- 1/0 ) 1 0 ? ; inline
+: >BOOLEAN ( ? -- 1/0 ) TRUE FALSE ? ; inline
 
 ! typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
 
index e2e2c7e1502c65e5556950aed6d188d437bcf83f..9daac21697e4e254a2014334d790339292445dab 100644 (file)
@@ -150,377 +150,377 @@ CONSTANT: PM_NOYIELD    2
 ! 
 ! Standard Cursor IDs
 !
-: IDC_ARROW           32512 ; inline
-: IDC_IBEAM           32513 ; inline
-: IDC_WAIT            32514 ; inline
-: IDC_CROSS           32515 ; inline
-: IDC_UPARROW         32516 ; inline
-: IDC_SIZE            32640 ; inline ! OBSOLETE: use IDC_SIZEALL
-: IDC_ICON            32641 ; inline ! OBSOLETE: use IDC_ARROW
-: IDC_SIZENWSE        32642 ; inline
-: IDC_SIZENESW        32643 ; inline
-: IDC_SIZEWE          32644 ; inline
-: IDC_SIZENS          32645 ; inline
-: IDC_SIZEALL         32646 ; inline
-: IDC_NO              32648 ; inline ! not in win3.1
-: IDC_HAND            32649 ; inline
-: IDC_APPSTARTING     32650 ; inline ! not in win3.1
-: IDC_HELP            32651 ; inline
+CONSTANT: IDC_ARROW           32512
+CONSTANT: IDC_IBEAM           32513
+CONSTANT: IDC_WAIT            32514
+CONSTANT: IDC_CROSS           32515
+CONSTANT: IDC_UPARROW         32516
+CONSTANT: IDC_SIZE            32640 ! OBSOLETE: use IDC_SIZEALL
+CONSTANT: IDC_ICON            32641 ! OBSOLETE: use IDC_ARROW
+CONSTANT: IDC_SIZENWSE        32642
+CONSTANT: IDC_SIZENESW        32643
+CONSTANT: IDC_SIZEWE          32644
+CONSTANT: IDC_SIZENS          32645
+CONSTANT: IDC_SIZEALL         32646
+CONSTANT: IDC_NO              32648 ! not in win3.1
+CONSTANT: IDC_HAND            32649
+CONSTANT: IDC_APPSTARTING     32650 ! not in win3.1
+CONSTANT: IDC_HELP            32651
 
 ! Predefined Clipboard Formats
-: CF_TEXT             1 ; inline
-: CF_BITMAP           2 ; inline
-: CF_METAFILEPICT     3 ; inline
-: CF_SYLK             4 ; inline
-: CF_DIF              5 ; inline
-: CF_TIFF             6 ; inline
-: CF_OEMTEXT          7 ; inline
-: CF_DIB              8 ; inline
-: CF_PALETTE          9 ; inline
-: CF_PENDATA          10 ; inline
-: CF_RIFF             11 ; inline
-: CF_WAVE             12 ; inline
-: CF_UNICODETEXT      13 ; inline
-: CF_ENHMETAFILE      14 ; inline
-: CF_HDROP            15 ; inline
-: CF_LOCALE           16 ; inline
-: CF_DIBV5            17 ; inline
-: CF_MAX              18 ; inline
-
-: CF_OWNERDISPLAY HEX: 0080 ; inline
-: CF_DSPTEXT HEX: 0081 ; inline
-: CF_DSPBITMAP HEX: 0082 ; inline
-: CF_DSPMETAFILEPICT HEX: 0083 ; inline
-: CF_DSPENHMETAFILE HEX: 008E ; inline
+CONSTANT: CF_TEXT             1
+CONSTANT: CF_BITMAP           2
+CONSTANT: CF_METAFILEPICT     3
+CONSTANT: CF_SYLK             4
+CONSTANT: CF_DIF              5
+CONSTANT: CF_TIFF             6
+CONSTANT: CF_OEMTEXT          7
+CONSTANT: CF_DIB              8
+CONSTANT: CF_PALETTE          9
+CONSTANT: CF_PENDATA          10
+CONSTANT: CF_RIFF             11
+CONSTANT: CF_WAVE             12
+CONSTANT: CF_UNICODETEXT      13
+CONSTANT: CF_ENHMETAFILE      14
+CONSTANT: CF_HDROP            15
+CONSTANT: CF_LOCALE           16
+CONSTANT: CF_DIBV5            17
+CONSTANT: CF_MAX              18
+
+CONSTANT: CF_OWNERDISPLAY HEX: 0080
+CONSTANT: CF_DSPTEXT HEX: 0081
+CONSTANT: CF_DSPBITMAP HEX: 0082
+CONSTANT: CF_DSPMETAFILEPICT HEX: 0083
+CONSTANT: CF_DSPENHMETAFILE HEX: 008E
 
 ! "Private" formats don't get GlobalFree()'d
-: CF_PRIVATEFIRST HEX: 200 ; inline
-: CF_PRIVATELAST HEX: 2FF ; inline
+CONSTANT: CF_PRIVATEFIRST HEX: 200
+CONSTANT: CF_PRIVATELAST HEX: 2FF
 
 ! "GDIOBJ" formats do get DeleteObject()'d
-: CF_GDIOBJFIRST HEX: 300 ; inline
-: CF_GDIOBJLAST HEX: 3FF ; inline
+CONSTANT: CF_GDIOBJFIRST HEX: 300
+CONSTANT: CF_GDIOBJLAST HEX: 3FF
 
 ! Virtual Keys, Standard Set
-: VK_LBUTTON        HEX: 01 ; inline
-: VK_RBUTTON        HEX: 02 ; inline
-: VK_CANCEL         HEX: 03 ; inline
-: VK_MBUTTON        HEX: 04 ; inline  ! NOT contiguous with L & RBUTTON
-: VK_XBUTTON1       HEX: 05 ; inline  ! NOT contiguous with L & RBUTTON
-: VK_XBUTTON2       HEX: 06 ; inline  ! NOT contiguous with L & RBUTTON
+CONSTANT: VK_LBUTTON        HEX: 01
+CONSTANT: VK_RBUTTON        HEX: 02
+CONSTANT: VK_CANCEL         HEX: 03
+CONSTANT: VK_MBUTTON        HEX: 04  ! NOT contiguous with L & RBUTTON
+CONSTANT: VK_XBUTTON1       HEX: 05  ! NOT contiguous with L & RBUTTON
+CONSTANT: VK_XBUTTON2       HEX: 06  ! NOT contiguous with L & RBUTTON
 ! 0x07 : unassigned
-: VK_BACK           HEX: 08 ; inline
-: VK_TAB            HEX: 09 ; inline
+CONSTANT: VK_BACK           HEX: 08
+CONSTANT: VK_TAB            HEX: 09
 ! 0x0A - 0x0B : reserved
 
-: VK_CLEAR          HEX: 0C ; inline
-: VK_RETURN         HEX: 0D ; inline
-
-: VK_SHIFT          HEX: 10 ; inline
-: VK_CONTROL        HEX: 11 ; inline
-: VK_MENU           HEX: 12 ; inline
-: VK_PAUSE          HEX: 13 ; inline
-: VK_CAPITAL        HEX: 14 ; inline
-
-: VK_KANA           HEX: 15 ; inline
-: VK_HANGEUL        HEX: 15 ; inline ! old name - here for compatibility
-: VK_HANGUL         HEX: 15 ; inline
-: VK_JUNJA          HEX: 17 ; inline
-: VK_FINAL          HEX: 18 ; inline
-: VK_HANJA          HEX: 19 ; inline
-: VK_KANJI          HEX: 19 ; inline
-
-: VK_ESCAPE         HEX: 1B ; inline
-
-: VK_CONVERT        HEX: 1C ; inline
-: VK_NONCONVERT     HEX: 1D ; inline
-: VK_ACCEPT         HEX: 1E ; inline
-: VK_MODECHANGE     HEX: 1F ; inline
-
-: VK_SPACE          HEX: 20 ; inline
-: VK_PRIOR          HEX: 21 ; inline
-: VK_NEXT           HEX: 22 ; inline
-: VK_END            HEX: 23 ; inline
-: VK_HOME           HEX: 24 ; inline
-: VK_LEFT           HEX: 25 ; inline
-: VK_UP             HEX: 26 ; inline
-: VK_RIGHT          HEX: 27 ; inline
-: VK_DOWN           HEX: 28 ; inline
-: VK_SELECT         HEX: 29 ; inline
-: VK_PRINT          HEX: 2A ; inline
-: VK_EXECUTE        HEX: 2B ; inline
-: VK_SNAPSHOT       HEX: 2C ; inline
-: VK_INSERT         HEX: 2D ; inline
-: VK_DELETE         HEX: 2E ; inline
-: VK_HELP           HEX: 2F ; inline
-
-: VK_0 CHAR: 0 ; inline
-: VK_1 CHAR: 1 ; inline
-: VK_2 CHAR: 2 ; inline
-: VK_3 CHAR: 3 ; inline
-: VK_4 CHAR: 4 ; inline
-: VK_5 CHAR: 5 ; inline
-: VK_6 CHAR: 6 ; inline
-: VK_7 CHAR: 7 ; inline
-: VK_8 CHAR: 8 ; inline
-: VK_9 CHAR: 9 ; inline
-
-: VK_A CHAR: A ; inline
-: VK_B CHAR: B ; inline
-: VK_C CHAR: C ; inline
-: VK_D CHAR: D ; inline
-: VK_E CHAR: E ; inline
-: VK_F CHAR: F ; inline
-: VK_G CHAR: G ; inline
-: VK_H CHAR: H ; inline
-: VK_I CHAR: I ; inline
-: VK_J CHAR: J ; inline
-: VK_K CHAR: K ; inline
-: VK_L CHAR: L ; inline
-: VK_M CHAR: M ; inline
-: VK_N CHAR: N ; inline
-: VK_O CHAR: O ; inline
-: VK_P CHAR: P ; inline
-: VK_Q CHAR: Q ; inline
-: VK_R CHAR: R ; inline
-: VK_S CHAR: S ; inline
-: VK_T CHAR: T ; inline
-: VK_U CHAR: U ; inline
-: VK_V CHAR: V ; inline
-: VK_W CHAR: W ; inline
-: VK_X CHAR: X ; inline
-: VK_Y CHAR: Y ; inline
-: VK_Z CHAR: Z ; inline
-
-: VK_LWIN           HEX: 5B ; inline
-: VK_RWIN           HEX: 5C ; inline
-: VK_APPS           HEX: 5D ; inline
+CONSTANT: VK_CLEAR          HEX: 0C
+CONSTANT: VK_RETURN         HEX: 0D
+
+CONSTANT: VK_SHIFT          HEX: 10
+CONSTANT: VK_CONTROL        HEX: 11
+CONSTANT: VK_MENU           HEX: 12
+CONSTANT: VK_PAUSE          HEX: 13
+CONSTANT: VK_CAPITAL        HEX: 14
+
+CONSTANT: VK_KANA           HEX: 15
+CONSTANT: VK_HANGEUL        HEX: 15 ! old name - here for compatibility
+CONSTANT: VK_HANGUL         HEX: 15
+CONSTANT: VK_JUNJA          HEX: 17
+CONSTANT: VK_FINAL          HEX: 18
+CONSTANT: VK_HANJA          HEX: 19
+CONSTANT: VK_KANJI          HEX: 19
+
+CONSTANT: VK_ESCAPE         HEX: 1B
+
+CONSTANT: VK_CONVERT        HEX: 1C
+CONSTANT: VK_NONCONVERT     HEX: 1D
+CONSTANT: VK_ACCEPT         HEX: 1E
+CONSTANT: VK_MODECHANGE     HEX: 1F
+
+CONSTANT: VK_SPACE          HEX: 20
+CONSTANT: VK_PRIOR          HEX: 21
+CONSTANT: VK_NEXT           HEX: 22
+CONSTANT: VK_END            HEX: 23
+CONSTANT: VK_HOME           HEX: 24
+CONSTANT: VK_LEFT           HEX: 25
+CONSTANT: VK_UP             HEX: 26
+CONSTANT: VK_RIGHT          HEX: 27
+CONSTANT: VK_DOWN           HEX: 28
+CONSTANT: VK_SELECT         HEX: 29
+CONSTANT: VK_PRINT          HEX: 2A
+CONSTANT: VK_EXECUTE        HEX: 2B
+CONSTANT: VK_SNAPSHOT       HEX: 2C
+CONSTANT: VK_INSERT         HEX: 2D
+CONSTANT: VK_DELETE         HEX: 2E
+CONSTANT: VK_HELP           HEX: 2F
+
+CONSTANT: VK_0 CHAR: 0
+CONSTANT: VK_1 CHAR: 1
+CONSTANT: VK_2 CHAR: 2
+CONSTANT: VK_3 CHAR: 3
+CONSTANT: VK_4 CHAR: 4
+CONSTANT: VK_5 CHAR: 5
+CONSTANT: VK_6 CHAR: 6
+CONSTANT: VK_7 CHAR: 7
+CONSTANT: VK_8 CHAR: 8
+CONSTANT: VK_9 CHAR: 9
+
+CONSTANT: VK_A CHAR: A
+CONSTANT: VK_B CHAR: B
+CONSTANT: VK_C CHAR: C
+CONSTANT: VK_D CHAR: D
+CONSTANT: VK_E CHAR: E
+CONSTANT: VK_F CHAR: F
+CONSTANT: VK_G CHAR: G
+CONSTANT: VK_H CHAR: H
+CONSTANT: VK_I CHAR: I
+CONSTANT: VK_J CHAR: J
+CONSTANT: VK_K CHAR: K
+CONSTANT: VK_L CHAR: L
+CONSTANT: VK_M CHAR: M
+CONSTANT: VK_N CHAR: N
+CONSTANT: VK_O CHAR: O
+CONSTANT: VK_P CHAR: P
+CONSTANT: VK_Q CHAR: Q
+CONSTANT: VK_R CHAR: R
+CONSTANT: VK_S CHAR: S
+CONSTANT: VK_T CHAR: T
+CONSTANT: VK_U CHAR: U
+CONSTANT: VK_V CHAR: V
+CONSTANT: VK_W CHAR: W
+CONSTANT: VK_X CHAR: X
+CONSTANT: VK_Y CHAR: Y
+CONSTANT: VK_Z CHAR: Z
+
+CONSTANT: VK_LWIN           HEX: 5B
+CONSTANT: VK_RWIN           HEX: 5C
+CONSTANT: VK_APPS           HEX: 5D
 
 ! 0x5E : reserved
 
-: VK_SLEEP          HEX: 5F ; inline
-
-: VK_NUMPAD0        HEX: 60 ; inline
-: VK_NUMPAD1        HEX: 61 ; inline
-: VK_NUMPAD2        HEX: 62 ; inline
-: VK_NUMPAD3        HEX: 63 ; inline
-: VK_NUMPAD4        HEX: 64 ; inline
-: VK_NUMPAD5        HEX: 65 ; inline
-: VK_NUMPAD6        HEX: 66 ; inline
-: VK_NUMPAD7        HEX: 67 ; inline
-: VK_NUMPAD8        HEX: 68 ; inline
-: VK_NUMPAD9        HEX: 69 ; inline
-: VK_MULTIPLY       HEX: 6A ; inline
-: VK_ADD            HEX: 6B ; inline
-: VK_SEPARATOR      HEX: 6C ; inline
-: VK_SUBTRACT       HEX: 6D ; inline
-: VK_DECIMAL        HEX: 6E ; inline
-: VK_DIVIDE         HEX: 6F ; inline
-: VK_F1             HEX: 70 ; inline
-: VK_F2             HEX: 71 ; inline
-: VK_F3             HEX: 72 ; inline
-: VK_F4             HEX: 73 ; inline
-: VK_F5             HEX: 74 ; inline
-: VK_F6             HEX: 75 ; inline
-: VK_F7             HEX: 76 ; inline
-: VK_F8             HEX: 77 ; inline
-: VK_F9             HEX: 78 ; inline
-: VK_F10            HEX: 79 ; inline
-: VK_F11            HEX: 7A ; inline
-: VK_F12            HEX: 7B ; inline
-: VK_F13            HEX: 7C ; inline
-: VK_F14            HEX: 7D ; inline
-: VK_F15            HEX: 7E ; inline
-: VK_F16            HEX: 7F ; inline
-: VK_F17            HEX: 80 ; inline
-: VK_F18            HEX: 81 ; inline
-: VK_F19            HEX: 82 ; inline
-: VK_F20            HEX: 83 ; inline
-: VK_F21            HEX: 84 ; inline
-: VK_F22            HEX: 85 ; inline
-: VK_F23            HEX: 86 ; inline
-: VK_F24            HEX: 87 ; inline
+CONSTANT: VK_SLEEP          HEX: 5F
+
+CONSTANT: VK_NUMPAD0        HEX: 60
+CONSTANT: VK_NUMPAD1        HEX: 61
+CONSTANT: VK_NUMPAD2        HEX: 62
+CONSTANT: VK_NUMPAD3        HEX: 63
+CONSTANT: VK_NUMPAD4        HEX: 64
+CONSTANT: VK_NUMPAD5        HEX: 65
+CONSTANT: VK_NUMPAD6        HEX: 66
+CONSTANT: VK_NUMPAD7        HEX: 67
+CONSTANT: VK_NUMPAD8        HEX: 68
+CONSTANT: VK_NUMPAD9        HEX: 69
+CONSTANT: VK_MULTIPLY       HEX: 6A
+CONSTANT: VK_ADD            HEX: 6B
+CONSTANT: VK_SEPARATOR      HEX: 6C
+CONSTANT: VK_SUBTRACT       HEX: 6D
+CONSTANT: VK_DECIMAL        HEX: 6E
+CONSTANT: VK_DIVIDE         HEX: 6F
+CONSTANT: VK_F1             HEX: 70
+CONSTANT: VK_F2             HEX: 71
+CONSTANT: VK_F3             HEX: 72
+CONSTANT: VK_F4             HEX: 73
+CONSTANT: VK_F5             HEX: 74
+CONSTANT: VK_F6             HEX: 75
+CONSTANT: VK_F7             HEX: 76
+CONSTANT: VK_F8             HEX: 77
+CONSTANT: VK_F9             HEX: 78
+CONSTANT: VK_F10            HEX: 79
+CONSTANT: VK_F11            HEX: 7A
+CONSTANT: VK_F12            HEX: 7B
+CONSTANT: VK_F13            HEX: 7C
+CONSTANT: VK_F14            HEX: 7D
+CONSTANT: VK_F15            HEX: 7E
+CONSTANT: VK_F16            HEX: 7F
+CONSTANT: VK_F17            HEX: 80
+CONSTANT: VK_F18            HEX: 81
+CONSTANT: VK_F19            HEX: 82
+CONSTANT: VK_F20            HEX: 83
+CONSTANT: VK_F21            HEX: 84
+CONSTANT: VK_F22            HEX: 85
+CONSTANT: VK_F23            HEX: 86
+CONSTANT: VK_F24            HEX: 87
 
 ! 0x88 - 0x8F : unassigned
 
-: VK_NUMLOCK        HEX: 90 ; inline
-: VK_SCROLL         HEX: 91 ; inline
+CONSTANT: VK_NUMLOCK        HEX: 90
+CONSTANT: VK_SCROLL         HEX: 91
 
 ! NEC PC-9800 kbd definitions
-: VK_OEM_NEC_EQUAL  HEX: 92 ; inline  ! '=' key on numpad
+CONSTANT: VK_OEM_NEC_EQUAL  HEX: 92  ! '=' key on numpad
 
 ! Fujitsu/OASYS kbd definitions
-: VK_OEM_FJ_JISHO   HEX: 92 ; inline  ! 'Dictionary' key
-: VK_OEM_FJ_MASSHOU HEX: 93 ; inline  ! 'Unregister word' key
-: VK_OEM_FJ_TOUROKU HEX: 94 ; inline  ! 'Register word' key
-: VK_OEM_FJ_LOYA    HEX: 95 ; inline  ! 'Left OYAYUBI' key
-: VK_OEM_FJ_ROYA    HEX: 96 ; inline  ! 'Right OYAYUBI' key
+CONSTANT: VK_OEM_FJ_JISHO   HEX: 92  ! 'Dictionary' key
+CONSTANT: VK_OEM_FJ_MASSHOU HEX: 93  ! 'Unregister word' key
+CONSTANT: VK_OEM_FJ_TOUROKU HEX: 94  ! 'Register word' key
+CONSTANT: VK_OEM_FJ_LOYA    HEX: 95  ! 'Left OYAYUBI' key
+CONSTANT: VK_OEM_FJ_ROYA    HEX: 96  ! 'Right OYAYUBI' key
 
 ! 0x97 - 0x9F : unassigned
 
 ! VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
 ! Used only as parameters to GetAsyncKeyState() and GetKeyState().
 ! No other API or message will distinguish left and right keys in this way.
-: VK_LSHIFT         HEX: A0 ; inline
-: VK_RSHIFT         HEX: A1 ; inline
-: VK_LCONTROL       HEX: A2 ; inline
-: VK_RCONTROL       HEX: A3 ; inline
-: VK_LMENU          HEX: A4 ; inline
-: VK_RMENU          HEX: A5 ; inline
-
-: VK_BROWSER_BACK        HEX: A6 ; inline
-: VK_BROWSER_FORWARD     HEX: A7 ; inline
-: VK_BROWSER_REFRESH     HEX: A8 ; inline
-: VK_BROWSER_STOP        HEX: A9 ; inline
-: VK_BROWSER_SEARCH      HEX: AA ; inline
-: VK_BROWSER_FAVORITES   HEX: AB ; inline
-: VK_BROWSER_HOME        HEX: AC ; inline
-
-: VK_VOLUME_MUTE         HEX: AD ; inline
-: VK_VOLUME_DOWN         HEX: AE ; inline
-: VK_VOLUME_UP           HEX: AF ; inline
-: VK_MEDIA_NEXT_TRACK    HEX: B0 ; inline
-: VK_MEDIA_PREV_TRACK    HEX: B1 ; inline
-: VK_MEDIA_STOP          HEX: B2 ; inline
-: VK_MEDIA_PLAY_PAUSE    HEX: B3 ; inline
-: VK_LAUNCH_MAIL         HEX: B4 ; inline
-: VK_LAUNCH_MEDIA_SELECT HEX: B5 ; inline
-: VK_LAUNCH_APP1         HEX: B6 ; inline
-: VK_LAUNCH_APP2         HEX: B7 ; inline
+CONSTANT: VK_LSHIFT         HEX: A0
+CONSTANT: VK_RSHIFT         HEX: A1
+CONSTANT: VK_LCONTROL       HEX: A2
+CONSTANT: VK_RCONTROL       HEX: A3
+CONSTANT: VK_LMENU          HEX: A4
+CONSTANT: VK_RMENU          HEX: A5
+
+CONSTANT: VK_BROWSER_BACK        HEX: A6
+CONSTANT: VK_BROWSER_FORWARD     HEX: A7
+CONSTANT: VK_BROWSER_REFRESH     HEX: A8
+CONSTANT: VK_BROWSER_STOP        HEX: A9
+CONSTANT: VK_BROWSER_SEARCH      HEX: AA
+CONSTANT: VK_BROWSER_FAVORITES   HEX: AB
+CONSTANT: VK_BROWSER_HOME        HEX: AC
+
+CONSTANT: VK_VOLUME_MUTE         HEX: AD
+CONSTANT: VK_VOLUME_DOWN         HEX: AE
+CONSTANT: VK_VOLUME_UP           HEX: AF
+CONSTANT: VK_MEDIA_NEXT_TRACK    HEX: B0
+CONSTANT: VK_MEDIA_PREV_TRACK    HEX: B1
+CONSTANT: VK_MEDIA_STOP          HEX: B2
+CONSTANT: VK_MEDIA_PLAY_PAUSE    HEX: B3
+CONSTANT: VK_LAUNCH_MAIL         HEX: B4
+CONSTANT: VK_LAUNCH_MEDIA_SELECT HEX: B5
+CONSTANT: VK_LAUNCH_APP1         HEX: B6
+CONSTANT: VK_LAUNCH_APP2         HEX: B7
 
 ! 0xB8 - 0xB9 : reserved
 
-: VK_OEM_1          HEX: BA ; inline  ! ';:' for US
-: VK_OEM_PLUS       HEX: BB ; inline  ! '+' any country
-: VK_OEM_COMMA      HEX: BC ; inline  ! ',' any country
-: VK_OEM_MINUS      HEX: BD ; inline  ! '-' any country
-: VK_OEM_PERIOD     HEX: BE ; inline  ! '.' any country
-: VK_OEM_2          HEX: BF ; inline  ! '/?' for US
-: VK_OEM_3          HEX: C0 ; inline  ! '`~' for US
+CONSTANT: VK_OEM_1          HEX: BA  ! ';:' for US
+CONSTANT: VK_OEM_PLUS       HEX: BB  ! '+' any country
+CONSTANT: VK_OEM_COMMA      HEX: BC  ! ',' any country
+CONSTANT: VK_OEM_MINUS      HEX: BD  ! '-' any country
+CONSTANT: VK_OEM_PERIOD     HEX: BE  ! '.' any country
+CONSTANT: VK_OEM_2          HEX: BF  ! '/?' for US
+CONSTANT: VK_OEM_3          HEX: C0  ! '`~' for US
 
 ! 0xC1 - 0xD7 : reserved
 
 ! 0xD8 - 0xDA : unassigned
 
-: VK_OEM_4          HEX: DB ; inline !  '[{' for US
-: VK_OEM_5          HEX: DC ; inline !  '\|' for US
-: VK_OEM_6          HEX: DD ; inline !  ']}' for US
-: VK_OEM_7          HEX: DE ; inline !  ''"' for US
-: VK_OEM_8          HEX: DF ; inline
+CONSTANT: VK_OEM_4          HEX: DB !  '[{' for US
+CONSTANT: VK_OEM_5          HEX: DC !  '\|' for US
+CONSTANT: VK_OEM_6          HEX: DD !  ']}' for US
+CONSTANT: VK_OEM_7          HEX: DE !  ''"' for US
+CONSTANT: VK_OEM_8          HEX: DF
 
 ! 0xE0 : reserved
 
 ! Various extended or enhanced keyboards
-: VK_OEM_AX         HEX: E1 ; inline !  'AX' key on Japanese AX kbd
-: VK_OEM_102        HEX: E2 ; inline !  "<>" or "\|" on RT 102-key kbd.
-: VK_ICO_HELP       HEX: E3 ; inline !  Help key on ICO
-: VK_ICO_00         HEX: E4 ; inline !  00 key on ICO
+CONSTANT: VK_OEM_AX         HEX: E1 !  'AX' key on Japanese AX kbd
+CONSTANT: VK_OEM_102        HEX: E2 !  "<>" or "\|" on RT 102-key kbd.
+CONSTANT: VK_ICO_HELP       HEX: E3 !  Help key on ICO
+CONSTANT: VK_ICO_00         HEX: E4 !  00 key on ICO
 
-: VK_PROCESSKEY     HEX: E5 ; inline
+CONSTANT: VK_PROCESSKEY     HEX: E5
 
-: VK_ICO_CLEAR      HEX: E6 ; inline
+CONSTANT: VK_ICO_CLEAR      HEX: E6
 
-: VK_PACKET         HEX: E7 ; inline
+CONSTANT: VK_PACKET         HEX: E7
 
 ! 0xE8 : unassigned
 
 ! Nokia/Ericsson definitions
-: VK_OEM_RESET      HEX: E9 ; inline
-: VK_OEM_JUMP       HEX: EA ; inline
-: VK_OEM_PA1        HEX: EB ; inline
-: VK_OEM_PA2        HEX: EC ; inline
-: VK_OEM_PA3        HEX: ED ; inline
-: VK_OEM_WSCTRL     HEX: EE ; inline
-: VK_OEM_CUSEL      HEX: EF ; inline
-: VK_OEM_ATTN       HEX: F0 ; inline
-: VK_OEM_FINISH     HEX: F1 ; inline
-: VK_OEM_COPY       HEX: F2 ; inline
-: VK_OEM_AUTO       HEX: F3 ; inline
-: VK_OEM_ENLW       HEX: F4 ; inline
-: VK_OEM_BACKTAB    HEX: F5 ; inline
-
-: VK_ATTN           HEX: F6 ; inline
-: VK_CRSEL          HEX: F7 ; inline
-: VK_EXSEL          HEX: F8 ; inline
-: VK_EREOF          HEX: F9 ; inline
-: VK_PLAY           HEX: FA ; inline
-: VK_ZOOM           HEX: FB ; inline
-: VK_NONAME         HEX: FC ; inline
-: VK_PA1            HEX: FD ; inline
-: VK_OEM_CLEAR      HEX: FE ; inline
+CONSTANT: VK_OEM_RESET      HEX: E9
+CONSTANT: VK_OEM_JUMP       HEX: EA
+CONSTANT: VK_OEM_PA1        HEX: EB
+CONSTANT: VK_OEM_PA2        HEX: EC
+CONSTANT: VK_OEM_PA3        HEX: ED
+CONSTANT: VK_OEM_WSCTRL     HEX: EE
+CONSTANT: VK_OEM_CUSEL      HEX: EF
+CONSTANT: VK_OEM_ATTN       HEX: F0
+CONSTANT: VK_OEM_FINISH     HEX: F1
+CONSTANT: VK_OEM_COPY       HEX: F2
+CONSTANT: VK_OEM_AUTO       HEX: F3
+CONSTANT: VK_OEM_ENLW       HEX: F4
+CONSTANT: VK_OEM_BACKTAB    HEX: F5
+
+CONSTANT: VK_ATTN           HEX: F6
+CONSTANT: VK_CRSEL          HEX: F7
+CONSTANT: VK_EXSEL          HEX: F8
+CONSTANT: VK_EREOF          HEX: F9
+CONSTANT: VK_PLAY           HEX: FA
+CONSTANT: VK_ZOOM           HEX: FB
+CONSTANT: VK_NONAME         HEX: FC
+CONSTANT: VK_PA1            HEX: FD
+CONSTANT: VK_OEM_CLEAR      HEX: FE
 ! 0xFF : reserved
 
 ! Key State Masks for Mouse Messages
-: MK_LBUTTON          HEX: 0001 ; inline
-: MK_RBUTTON          HEX: 0002 ; inline
-: MK_SHIFT            HEX: 0004 ; inline
-: MK_CONTROL          HEX: 0008 ; inline
-: MK_MBUTTON          HEX: 0010 ; inline
-: MK_XBUTTON1         HEX: 0020 ; inline
-: MK_XBUTTON2         HEX: 0040 ; inline
+CONSTANT: MK_LBUTTON          HEX: 0001
+CONSTANT: MK_RBUTTON          HEX: 0002
+CONSTANT: MK_SHIFT            HEX: 0004
+CONSTANT: MK_CONTROL          HEX: 0008
+CONSTANT: MK_MBUTTON          HEX: 0010
+CONSTANT: MK_XBUTTON1         HEX: 0020
+CONSTANT: MK_XBUTTON2         HEX: 0040
 
 ! Some fields are not defined for win64
 ! Window field offsets for GetWindowLong()
-: GWL_WNDPROC         -4 ; inline
-: GWL_HINSTANCE       -6 ; inline
-: GWL_HWNDPARENT      -8 ; inline
-: GWL_USERDATA        -21 ; inline
-: GWL_ID              -12 ; inline
+CONSTANT: GWL_WNDPROC         -4
+CONSTANT: GWL_HINSTANCE       -6
+CONSTANT: GWL_HWNDPARENT      -8
+CONSTANT: GWL_USERDATA        -21
+CONSTANT: GWL_ID              -12
 
-: GWL_STYLE           -16 ; inline
-: GWL_EXSTYLE         -20 ; inline
+CONSTANT: GWL_STYLE           -16
+CONSTANT: GWL_EXSTYLE         -20
 
-: GWLP_WNDPROC        -4 ; inline
-: GWLP_HINSTANCE      -6 ; inline
-: GWLP_HWNDPARENT     -8 ; inline
-: GWLP_USERDATA       -21 ; inline
-: GWLP_ID             -12 ; inline
+CONSTANT: GWLP_WNDPROC        -4
+CONSTANT: GWLP_HINSTANCE      -6
+CONSTANT: GWLP_HWNDPARENT     -8
+CONSTANT: GWLP_USERDATA       -21
+CONSTANT: GWLP_ID             -12
 
 ! Class field offsets for GetClassLong()
-: GCL_MENUNAME        -8 ; inline
-: GCL_HBRBACKGROUND   -10 ; inline
-: GCL_HCURSOR         -12 ; inline
-: GCL_HICON           -14 ; inline
-: GCL_HMODULE         -16 ; inline
-: GCL_WNDPROC         -24 ; inline
-: GCL_HICONSM         -34 ; inline
-: GCL_CBWNDEXTRA      -18 ; inline
-: GCL_CBCLSEXTRA      -20 ; inline
-: GCL_STYLE           -26 ; inline
-: GCW_ATOM            -32 ; inline
-
-: GCLP_MENUNAME       -8 ; inline
-: GCLP_HBRBACKGROUND  -10 ; inline
-: GCLP_HCURSOR        -12 ; inline
-: GCLP_HICON          -14 ; inline
-: GCLP_HMODULE        -16 ; inline
-: GCLP_WNDPROC        -24 ; inline
-: GCLP_HICONSM        -34 ; inline
-
-: MB_ICONASTERISK    HEX: 00000040 ; inline
-: MB_ICONEXCLAMATION HEX: 00000030 ; inline
-: MB_ICONHAND        HEX: 00000010 ; inline
-: MB_ICONQUESTION    HEX: 00000020 ; inline
-: MB_OK              HEX: 00000000 ; inline
+CONSTANT: GCL_MENUNAME        -8
+CONSTANT: GCL_HBRBACKGROUND   -10
+CONSTANT: GCL_HCURSOR         -12
+CONSTANT: GCL_HICON           -14
+CONSTANT: GCL_HMODULE         -16
+CONSTANT: GCL_WNDPROC         -24
+CONSTANT: GCL_HICONSM         -34
+CONSTANT: GCL_CBWNDEXTRA      -18
+CONSTANT: GCL_CBCLSEXTRA      -20
+CONSTANT: GCL_STYLE           -26
+CONSTANT: GCW_ATOM            -32
+
+CONSTANT: GCLP_MENUNAME       -8
+CONSTANT: GCLP_HBRBACKGROUND  -10
+CONSTANT: GCLP_HCURSOR        -12
+CONSTANT: GCLP_HICON          -14
+CONSTANT: GCLP_HMODULE        -16
+CONSTANT: GCLP_WNDPROC        -24
+CONSTANT: GCLP_HICONSM        -34
+
+CONSTANT: MB_ICONASTERISK    HEX: 00000040
+CONSTANT: MB_ICONEXCLAMATION HEX: 00000030
+CONSTANT: MB_ICONHAND        HEX: 00000010
+CONSTANT: MB_ICONQUESTION    HEX: 00000020
+CONSTANT: MB_OK              HEX: 00000000
 
 ALIAS: FVIRTKEY TRUE
-: FNOINVERT 2 ; inline
-: FSHIFT 4 ; inline
-: FCONTROL 8 ; inline
-: FALT 16 ; inline
-
-: MAPVK_VK_TO_VSC 0 ; inline
-: MAPVK_VSC_TO_VK 1 ; inline
-: MAPVK_VK_TO_CHAR 2 ; inline
-: MAPVK_VSC_TO_VK_EX 3 ; inline
-: MAPVK_VK_TO_VSC_EX 3 ; inline
-
-: TME_HOVER 1 ; inline
-: TME_LEAVE 2 ; inline
-: TME_NONCLIENT 16 ; inline
-: TME_QUERY HEX: 40000000 ; inline
-: TME_CANCEL HEX: 80000000 ; inline
-: HOVER_DEFAULT HEX: ffffffff ; inline
+CONSTANT: FNOINVERT 2
+CONSTANT: FSHIFT 4
+CONSTANT: FCONTROL 8
+CONSTANT: FALT 16
+
+CONSTANT: MAPVK_VK_TO_VSC 0
+CONSTANT: MAPVK_VSC_TO_VK 1
+CONSTANT: MAPVK_VK_TO_CHAR 2
+CONSTANT: MAPVK_VSC_TO_VK_EX 3
+CONSTANT: MAPVK_VK_TO_VSC_EX 3
+
+CONSTANT: TME_HOVER 1
+CONSTANT: TME_LEAVE 2
+CONSTANT: TME_NONCLIENT 16
+CONSTANT: TME_QUERY HEX: 40000000
+CONSTANT: TME_CANCEL HEX: 80000000
+CONSTANT: HOVER_DEFAULT HEX: ffffffff
 C-STRUCT: TRACKMOUSEEVENT
     { "DWORD" "cbSize" }
     { "DWORD" "dwFlags" }
@@ -528,15 +528,15 @@ C-STRUCT: TRACKMOUSEEVENT
     { "DWORD" "dwHoverTime" } ;
 TYPEDEF: TRACKMOUSEEVENT* LPTRACKMOUSEEVENT
 
-: DBT_DEVICEARRIVAL HEX: 8000 ; inline
-: DBT_DEVICEREMOVECOMPLETE HEX: 8004 ; inline
+CONSTANT: DBT_DEVICEARRIVAL HEX: 8000
+CONSTANT: DBT_DEVICEREMOVECOMPLETE HEX: 8004
 
-: DBT_DEVTYP_DEVICEINTERFACE 5 ; inline
+CONSTANT: DBT_DEVTYP_DEVICEINTERFACE 5
 
-: DEVICE_NOTIFY_WINDOW_HANDLE 0 ; inline
-: DEVICE_NOTIFY_SERVICE_HANDLE 1 ; inline
+CONSTANT: DEVICE_NOTIFY_WINDOW_HANDLE 0
+CONSTANT: DEVICE_NOTIFY_SERVICE_HANDLE 1
 
-: DEVICE_NOTIFY_ALL_INTERFACE_CLASSES 4 ; inline
+CONSTANT: DEVICE_NOTIFY_ALL_INTERFACE_CLASSES 4
 
 C-STRUCT: DEV_BROADCAST_HDR
     { "DWORD" "dbch_size" }
@@ -672,7 +672,6 @@ ALIAS: CreateWindowEx CreateWindowExW
 
 : CreateWindow ( a b c d e f g h i j k -- hwnd ) 0 12 -nrot CreateWindowEx ; inline
 
-
 ! FUNCTION: CreateWindowStationA
 ! FUNCTION: CreateWindowStationW
 ! FUNCTION: CsrBroadcastSystemMessageExW
index d2250d6f7e06024ad0135600fa08657565b4d597..44db355c99d5c137a6874d1521179148a00eb62a 100644 (file)
@@ -8,7 +8,7 @@ IN: windows
 
 : lo-word ( wparam -- lo ) <short> *short ; inline
 : hi-word ( wparam -- hi ) -16 shift lo-word ; inline
-: MAX_UNICODE_PATH 32768 ; inline
+CONSTANT: MAX_UNICODE_PATH 32768
 
 ! You must LocalFree the return value!
 FUNCTION: void* error_message ( DWORD id ) ;
old mode 100644 (file)
new mode 100755 (executable)
index 27069ed..06df74c
@@ -257,12 +257,11 @@ TYPEDEF: WSANAMESPACE_INFOW WSANAMESPACE_INFO
 TYPEDEF: WSANAMESPACE_INFO* PWSANAMESPACE_INFO
 TYPEDEF: WSANAMESPACE_INFO* LPWSANAMESPACE_INFO
 
-: FD_MAX_EVENTS 10 ;
+CONSTANT: FD_MAX_EVENTS 10
 
 C-STRUCT: WSANETWORKEVENTS
     { "long" "lNetworkEvents" }
-    ! { { "int" "FD_MAX_EVENTS" } "iErrorCode" } ;
-    { { "int" 10 } "iErrorCode" } ;
+    { { "int" FD_MAX_EVENTS } "iErrorCode" } ;
 TYPEDEF: WSANETWORKEVENTS* PWSANETWORKEVENTS
 TYPEDEF: WSANETWORKEVENTS* LPWSANETWORKEVENTS
 
diff --git a/basis/wrap/strings/summary.txt b/basis/wrap/strings/summary.txt
new file mode 100644 (file)
index 0000000..26c3509
--- /dev/null
@@ -0,0 +1 @@
+Word-wrapping strings
diff --git a/basis/wrap/words/summary.txt b/basis/wrap/words/summary.txt
new file mode 100644 (file)
index 0000000..901379e
--- /dev/null
@@ -0,0 +1 @@
+Word-wrapping words
index fcce09380fdd2deeb44b000b8900430e6a98d717..1fe825d6af042618f85a7a22a226a2e553dbd19d 100644 (file)
@@ -12,17 +12,17 @@ TYPEDEF: uchar KeyCode
 
 ! Reserved Resource and Constant Definitions
 
-: ParentRelative 1 ;
-: CopyFromParent 0 ;
-: PointerWindow 0 ;
-: InputFocus 1 ;
-: PointerRoot 1 ;
-: AnyPropertyType 0 ;
-: AnyKey 0 ;
-: AnyButton 0 ;
-: AllTemporary 0 ;
-: CurrentTime 0 ;
-: NoSymbol 0 ;
+CONSTANT: ParentRelative 1
+CONSTANT: CopyFromParent 0
+CONSTANT: PointerWindow 0
+CONSTANT: InputFocus 1
+CONSTANT: PointerRoot 1
+CONSTANT: AnyPropertyType 0
+CONSTANT: AnyKey 0
+CONSTANT: AnyButton 0
+CONSTANT: AllTemporary 0
+CONSTANT: CurrentTime 0
+CONSTANT: NoSymbol 0
 
 ! Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
 !   state in various key-, mouse-, and button-related events.
@@ -31,14 +31,14 @@ TYPEDEF: uchar KeyCode
 ! modifier names.  Used to build a SetModifierMapping request or
 ! to read a GetModifierMapping request.  These correspond to the
 ! masks defined above.
-: ShiftMapIndex         0 ;
-: LockMapIndex          1 ;
-: ControlMapIndex       2 ;
-: Mod1MapIndex          3 ;
-: Mod2MapIndex          4 ;
-: Mod3MapIndex          5 ;
-: Mod4MapIndex          6 ;
-: Mod5MapIndex          7 ;
+CONSTANT: ShiftMapIndex 0
+CONSTANT: LockMapIndex 1
+CONSTANT: ControlMapIndex 2
+CONSTANT: Mod1MapIndex 3
+CONSTANT: Mod2MapIndex 4
+CONSTANT: Mod3MapIndex 5
+CONSTANT: Mod4MapIndex 6
+CONSTANT: Mod5MapIndex 7
 
 
 ! button masks.  Used in same manner as Key masks above. Not to be confused
@@ -53,100 +53,100 @@ TYPEDEF: uchar KeyCode
 
 ! Notify modes
 
-: NotifyNormal          0 ;
-: NotifyGrab            1 ;
-: NotifyUngrab          2 ;
-: NotifyWhileGrabbed    3 ;
+CONSTANT: NotifyNormal 0
+CONSTANT: NotifyGrab 1
+CONSTANT: NotifyUngrab 2
+CONSTANT: NotifyWhileGrabbed 3
 
-: NotifyHint            1 ; ! for MotionNotify events
+CONSTANT: NotifyHint 1 ! for MotionNotify events
                        
 ! Notify detail
 
-: NotifyAncestor         0 ;
-: NotifyVirtual          1 ;
-: NotifyInferior         2 ;
-: NotifyNonlinear        3 ;
-: NotifyNonlinearVirtual 4 ;
-: NotifyPointer          5 ;
-: NotifyPointerRoot      6 ;
-: NotifyDetailNone       7 ;
+CONSTANT: NotifyAncestor 0
+CONSTANT: NotifyVirtual 1
+CONSTANT: NotifyInferior 2
+CONSTANT: NotifyNonlinear 3
+CONSTANT: NotifyNonlinearVirtual 4
+CONSTANT: NotifyPointer 5
+CONSTANT: NotifyPointerRoot 6
+CONSTANT: NotifyDetailNone 7
 
 ! Visibility notify
 
-: VisibilityUnobscured          0 ;
-: VisibilityPartiallyObscured   1 ;
-: VisibilityFullyObscured       2 ;
+CONSTANT: VisibilityUnobscured 0
+CONSTANT: VisibilityPartiallyObscured 1
+CONSTANT: VisibilityFullyObscured 2
 
 ! Circulation request
 
-: PlaceOnTop            0 ;
-: PlaceOnBottom         1 ;
+CONSTANT: PlaceOnTop 0
+CONSTANT: PlaceOnBottom 1
 
 ! protocol families
 
-: FamilyInternet        0 ;     ! IPv4
-: FamilyDECnet          1 ;
-: FamilyChaos           2 ;
-: FamilyInternet6       6 ;     ! IPv6
+CONSTANT: FamilyInternet 0     ! IPv4
+CONSTANT: FamilyDECnet 1
+CONSTANT: FamilyChaos 2
+CONSTANT: FamilyInternet6 6     ! IPv6
 
 ! authentication families not tied to a specific protocol
-: FamilyServerInterpreted 5 ;
+CONSTANT: FamilyServerInterpreted 5
 
 ! Property notification
 
-: PropertyNewValue      0 ;
-: PropertyDelete        1 ;
+CONSTANT: PropertyNewValue 0
+CONSTANT: PropertyDelete 1
 
 ! Color Map notification
 
-: ColormapUninstalled   0 ;
-: ColormapInstalled     1 ;
+CONSTANT: ColormapUninstalled 0
+CONSTANT: ColormapInstalled 1
 
 ! GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes
 
-: GrabModeSync          0 ;
-: GrabModeAsync         1 ;
+CONSTANT: GrabModeSync 0
+CONSTANT: GrabModeAsync 1
 
 ! GrabPointer, GrabKeyboard reply status
 
-: GrabSuccess           0 ;
-: AlreadyGrabbed        1 ;
-: GrabInvalidTime       2 ;
-: GrabNotViewable       3 ;
-: GrabFrozen            4 ;
+CONSTANT: GrabSuccess 0
+CONSTANT: AlreadyGrabbed 1
+CONSTANT: GrabInvalidTime 2
+CONSTANT: GrabNotViewable 3
+CONSTANT: GrabFrozen 4
 
 ! AllowEvents modes
 
-: AsyncPointer          0 ;
-: SyncPointer           1 ;
-: ReplayPointer         2 ;
-: AsyncKeyboard         3 ;
-: SyncKeyboard          4 ;
-: ReplayKeyboard        5 ;
-: AsyncBoth             6 ;
-: SyncBoth              7 ;
+CONSTANT: AsyncPointer 0
+CONSTANT: SyncPointer 1
+CONSTANT: ReplayPointer 2
+CONSTANT: AsyncKeyboard 3
+CONSTANT: SyncKeyboard 4
+CONSTANT: ReplayKeyboard 5
+CONSTANT: AsyncBoth 6
+CONSTANT: SyncBoth 7
 
 ! Used in SetInputFocus, GetInputFocus
 
 : RevertToNone         ( -- n ) None ;
 : RevertToPointerRoot  ( -- n ) PointerRoot ;
-: RevertToParent        2 ;
+CONSTANT: RevertToParent 2
 
 ! *****************************************************************
 ! * ERROR CODES 
 ! *****************************************************************
 
-: Success          0 ; ! everything's okay
-: BadRequest       1 ; ! bad request code
-: BadValue         2 ; ! int parameter out of range
-: BadWindow        3 ; ! parameter not a Window
-: BadPixmap        4 ; ! parameter not a Pixmap
-: BadAtom          5 ; ! parameter not an Atom
-: BadCursor        6 ; ! parameter not a Cursor
-: BadFont          7 ; ! parameter not a Font
-: BadMatch         8 ; ! parameter mismatch
-: BadDrawable      9 ; ! parameter not a Pixmap or Window
-: BadAccess       10 ; ! depending on context:
+CONSTANT: Success 0 ! everything's okay
+CONSTANT: BadRequest 1 ! bad request code
+CONSTANT: BadValue 2 ! int parameter out of range
+CONSTANT: BadWindow 3 ! parameter not a Window
+CONSTANT: BadPixmap 4 ! parameter not a Pixmap
+CONSTANT: BadAtom 5 ! parameter not an Atom
+CONSTANT: BadCursor 6 ! parameter not a Cursor
+CONSTANT: BadFont 7 ! parameter not a Font
+CONSTANT: BadMatch 8 ! parameter mismatch
+CONSTANT: BadDrawable 9 ! parameter not a Pixmap or Window
+CONSTANT: BadAccess 10 ! depending on context:
                        !         - key/button already grabbed
                        !         - attempt to free an illegal 
                        !           cmap entry 
@@ -154,16 +154,16 @@ TYPEDEF: uchar KeyCode
                        !           color map entry.
                        !        - attempt to modify the access control
                        !           list from other than the local host.
-: BadAlloc          11 ; ! insufficient resources
-: BadColor          12 ; ! no such colormap
-: BadGC             13 ; ! parameter not a GC
-: BadIDChoice       14 ; ! choice not in range or already used
-: BadName           15 ; ! font or color name doesn't exist
-: BadLength         16 ; ! Request length incorrect
-: BadImplementation 17 ; ! server is defective
+CONSTANT: BadAlloc 11 ! insufficient resources
+CONSTANT: BadColor 12 ! no such colormap
+CONSTANT: BadGC 13 ! parameter not a GC
+CONSTANT: BadIDChoice 14 ! choice not in range or already used
+CONSTANT: BadName 15 ! font or color name doesn't exist
+CONSTANT: BadLength 16 ! Request length incorrect
+CONSTANT: BadImplementation 17 ! server is defective
 
-: FirstExtensionError   128 ;
-: LastExtensionError    255 ;
+CONSTANT: FirstExtensionError 128
+CONSTANT: LastExtensionError 255
 
 ! *****************************************************************
 ! * WINDOW DEFINITIONS 
@@ -172,44 +172,44 @@ TYPEDEF: uchar KeyCode
 ! Window classes used by CreateWindow
 ! Note that CopyFromParent is already defined as 0 above
 
-: InputOutput           1 ;
-: InputOnly             2 ;
+CONSTANT: InputOutput 1
+CONSTANT: InputOnly 2
 
 ! Used in CreateWindow for backing-store hint
 
-: NotUseful               0 ;
-: WhenMapped              1 ;
-: Always                  2 ;
+CONSTANT: NotUseful 0
+CONSTANT: WhenMapped 1
+CONSTANT: Always 2
 
 ! Used in ChangeSaveSet
 
-: SetModeInsert           0 ;
-: SetModeDelete           1 ;
+CONSTANT: SetModeInsert 0
+CONSTANT: SetModeDelete 1
 
 ! Used in ChangeCloseDownMode
 
-: DestroyAll              0 ;
-: RetainPermanent         1 ;
-: RetainTemporary         2 ;
+CONSTANT: DestroyAll 0
+CONSTANT: RetainPermanent 1
+CONSTANT: RetainTemporary 2
 
 ! Window stacking method (in configureWindow)
 
-: Above                   0 ;
-: Below                   1 ;
-: TopIf                   2 ;
-: BottomIf                3 ;
-: Opposite                4 ;
+CONSTANT: Above 0
+CONSTANT: Below 1
+CONSTANT: TopIf 2
+CONSTANT: BottomIf 3
+CONSTANT: Opposite 4
 
 ! Circulation direction
 
-: RaiseLowest             0 ;
-: LowerHighest            1 ;
+CONSTANT: RaiseLowest 0
+CONSTANT: LowerHighest 1
 
 ! Property modes
 
-: PropModeReplace         0 ;
-: PropModePrepend         1 ;
-: PropModeAppend          2 ;
+CONSTANT: PropModeReplace 0
+CONSTANT: PropModePrepend 1
+CONSTANT: PropModeAppend 2
 
 ! *****************************************************************
 ! * GRAPHICS DEFINITIONS
@@ -217,62 +217,62 @@ TYPEDEF: uchar KeyCode
 
 ! LineStyle
 
-: LineSolid             0 ;
-: LineOnOffDash         1 ;
-: LineDoubleDash        2 ;
+CONSTANT: LineSolid 0
+CONSTANT: LineOnOffDash 1
+CONSTANT: LineDoubleDash 2
 
 ! capStyle
 
-: CapNotLast            0 ;
-: CapButt               1 ;
-: CapRound              2 ;
-: CapProjecting         3 ;
+CONSTANT: CapNotLast 0
+CONSTANT: CapButt 1
+CONSTANT: CapRound 2
+CONSTANT: CapProjecting 3
 
 ! joinStyle
 
-: JoinMiter             0 ;
-: JoinRound             1 ;
-: JoinBevel             2 ;
+CONSTANT: JoinMiter 0
+CONSTANT: JoinRound 1
+CONSTANT: JoinBevel 2
 
 ! fillStyle
 
-: FillSolid             0 ;
-: FillTiled             1 ;
-: FillStippled          2 ;
-: FillOpaqueStippled    3 ;
+CONSTANT: FillSolid 0
+CONSTANT: FillTiled 1
+CONSTANT: FillStippled 2
+CONSTANT: FillOpaqueStippled 3
 
 ! fillRule
 
-: EvenOddRule           0 ;
-: WindingRule           1 ;
+CONSTANT: EvenOddRule 0
+CONSTANT: WindingRule 1
 
 ! subwindow mode
 
-: ClipByChildren        0 ;
-: IncludeInferiors      1 ;
+CONSTANT: ClipByChildren 0
+CONSTANT: IncludeInferiors 1
 
 ! SetClipRectangles ordering
 
-: Unsorted              0 ;
-: YSorted               1 ;
-: YXSorted              2 ;
-: YXBanded              3 ;
+CONSTANT: Unsorted 0
+CONSTANT: YSorted 1
+CONSTANT: YXSorted 2
+CONSTANT: YXBanded 3
 
 ! CoordinateMode for drawing routines
 
-: CoordModeOrigin   0 ; ! relative to the origin
-: CoordModePrevious 1 ; ! relative to previous point
+CONSTANT: CoordModeOrigin 0 ! relative to the origin
+CONSTANT: CoordModePrevious 1 ! relative to previous point
 
 ! Polygon shapes
 
-: Complex       0 ; ! paths may intersect
-: Nonconvex     1 ; ! no paths intersect, but not convex
-: Convex        2 ; ! wholly convex
+CONSTANT: Complex 0 ! paths may intersect
+CONSTANT: Nonconvex 1 ! no paths intersect, but not convex
+CONSTANT: Convex 2 ! wholly convex
 
 ! Arc modes for PolyFillArc
 
-: ArcChord    0 ; ! join endpoints of arc
-: ArcPieSlice 1 ; ! join endpoints to center of arc
+CONSTANT: ArcChord 0 ! join endpoints of arc
+CONSTANT: ArcPieSlice 1 ! join endpoints to center of arc
 
 ! *****************************************************************
 ! * FONTS 
@@ -280,10 +280,10 @@ TYPEDEF: uchar KeyCode
 
 ! used in QueryFont -- draw direction
 
-: FontLeftToRight               0 ;
-: FontRightToLeft               1 ;
+CONSTANT: FontLeftToRight 0
+CONSTANT: FontRightToLeft 1
 
-: FontChange            255 ;
+CONSTANT: FontChange 255
 
 ! *****************************************************************
 ! *  IMAGING 
@@ -291,9 +291,9 @@ TYPEDEF: uchar KeyCode
 
 ! ImageFormat -- PutImage, GetImage
 
-: XYBitmap              0 ; ! depth 1, XYFormat
-: XYPixmap              1 ; ! depth == drawable depth
-: ZPixmap               2 ; ! depth == drawable depth
+CONSTANT: XYBitmap 0 ! depth 1, XYFormat
+CONSTANT: XYPixmap 1 ! depth == drawable depth
+CONSTANT: ZPixmap 2 ! depth == drawable depth
 
 ! *****************************************************************
 ! *  COLOR MAP STUFF 
@@ -301,8 +301,8 @@ TYPEDEF: uchar KeyCode
 
 ! For CreateColormap
 
-: AllocNone             0 ; ! create map with no entries
-: AllocAll              1 ; ! allocate entire map writeable
+CONSTANT: AllocNone 0 ! create map with no entries
+CONSTANT: AllocAll 1 ! allocate entire map writeable
 
 
 ! Flags used in StoreNamedColor, StoreColors
@@ -317,20 +317,20 @@ TYPEDEF: uchar KeyCode
 
 ! QueryBestSize Class
 
-: CursorShape           0 ; ! largest size that can be displayed
-: TileShape             1 ; ! size tiled fastest
-: StippleShape          2 ; ! size stippled fastest
+CONSTANT: CursorShape 0 ! largest size that can be displayed
+CONSTANT: TileShape 1 ! size tiled fastest
+CONSTANT: StippleShape 2 ! size stippled fastest
 
 ! ***************************************************************** 
 ! * KEYBOARD/POINTER STUFF
 ! *****************************************************************
 
-: AutoRepeatModeOff     0 ;
-: AutoRepeatModeOn      1 ;
-: AutoRepeatModeDefault 2 ;
+CONSTANT: AutoRepeatModeOff 0
+CONSTANT: AutoRepeatModeOn 1
+CONSTANT: AutoRepeatModeDefault 2
 
-: LedModeOff            0 ;
-: LedModeOn             1 ;
+CONSTANT: LedModeOff 0
+CONSTANT: LedModeOn 1
 
 ! masks for ChangeKeyboardControl
 
@@ -343,33 +343,33 @@ TYPEDEF: uchar KeyCode
 : KBKey                ( -- n ) 6 2^ ;
 : KBAutoRepeatMode     ( -- n ) 7 2^ ;
 
-: MappingSuccess        0 ;
-: MappingBusy           1 ;
-: MappingFailed         2 ;
+CONSTANT: MappingSuccess 0
+CONSTANT: MappingBusy 1
+CONSTANT: MappingFailed 2
 
-: MappingModifier               0 ;
-: MappingKeyboard               1 ;
-: MappingPointer                2 ;
+CONSTANT: MappingModifier 0
+CONSTANT: MappingKeyboard 1
+CONSTANT: MappingPointer 2
 
 ! *****************************************************************
 ! * SCREEN SAVER STUFF 
 ! *****************************************************************
 
-: DontPreferBlanking    0 ;
-: PreferBlanking        1 ;
-: DefaultBlanking       2 ;
+CONSTANT: DontPreferBlanking 0
+CONSTANT: PreferBlanking 1
+CONSTANT: DefaultBlanking 2
 
-: DisableScreenSaver    0 ;
-: DisableScreenInterval 0 ;
+CONSTANT: DisableScreenSaver 0
+CONSTANT: DisableScreenInterval 0
 
-: DontAllowExposures    0 ;
-: AllowExposures        1 ;
-: DefaultExposures      2 ;
+CONSTANT: DontAllowExposures 0
+CONSTANT: AllowExposures 1
+CONSTANT: DefaultExposures 2
 
 ! for ForceScreenSaver
 
-: ScreenSaverReset 0 ;
-: ScreenSaverActive 1 ;
+CONSTANT: ScreenSaverReset 0
+CONSTANT: ScreenSaverActive 1
 
 ! *****************************************************************
 ! * HOSTS AND CONNECTIONS
@@ -377,30 +377,30 @@ TYPEDEF: uchar KeyCode
 
 ! for ChangeHosts
 
-: HostInsert            0 ;
-: HostDelete            1 ;
+CONSTANT: HostInsert 0
+CONSTANT: HostDelete 1
 
 ! for ChangeAccessControl
 
-: EnableAccess          1 ;
-: DisableAccess         0 ;
+CONSTANT: EnableAccess 1
+CONSTANT: DisableAccess 0
 
 ! Display classes  used in opening the connection 
 ! Note that the statically allocated ones are even numbered and the
 ! dynamically changeable ones are odd numbered
 
-: StaticGray            0 ;
-: GrayScale             1 ;
-: StaticColor           2 ;
-: PseudoColor           3 ;
-: TrueColor             4 ;
-: DirectColor           5 ;
+CONSTANT: StaticGray 0
+CONSTANT: GrayScale 1
+CONSTANT: StaticColor 2
+CONSTANT: PseudoColor 3
+CONSTANT: TrueColor 4
+CONSTANT: DirectColor 5
 
 
 ! Byte order  used in imageByteOrder and bitmapBitOrder
 
-: LSBFirst              0 ;
-: MSBFirst              1 ;
+CONSTANT: LSBFirst 0
+CONSTANT: MSBFirst 1
 
 ! *****************************************************************
 ! * EXTENDED WINDOW MANAGER HINTS
index 11473d6e83e6e84558c75ff7a46ee2e5cf87f638..e6001d3e592e4e73b1139e644c884d40bcf2c624 100644 (file)
@@ -9,23 +9,23 @@ IN: x11.glx
 LIBRARY: glx
 
 ! Visual Config Attributes (glXGetConfig, glXGetFBConfigAttrib)
-: GLX_USE_GL            1  ; ! support GLX rendering
-: GLX_BUFFER_SIZE       2  ; ! depth of the color buffer
-: GLX_LEVEL             3  ; ! level in plane stacking
-: GLX_RGBA              4  ; ! true if RGBA mode
-: GLX_DOUBLEBUFFER      5  ; ! double buffering supported
-: GLX_STEREO            6  ; ! stereo buffering supported
-: GLX_AUX_BUFFERS       7  ; ! number of aux buffers
-: GLX_RED_SIZE          8  ; ! number of red component bits
-: GLX_GREEN_SIZE        9  ; ! number of green component bits
-: GLX_BLUE_SIZE         10 ; ! number of blue component bits
-: GLX_ALPHA_SIZE        11 ; ! number of alpha component bits
-: GLX_DEPTH_SIZE        12 ; ! number of depth bits
-: GLX_STENCIL_SIZE      13 ; ! number of stencil bits
-: GLX_ACCUM_RED_SIZE    14 ; ! number of red accum bits
-: GLX_ACCUM_GREEN_SIZE  15 ; ! number of green accum bits
-: GLX_ACCUM_BLUE_SIZE   16 ; ! number of blue accum bits
-: GLX_ACCUM_ALPHA_SIZE  17 ; ! number of alpha accum bits
+CONSTANT: GLX_USE_GL 1 ! support GLX rendering
+CONSTANT: GLX_BUFFER_SIZE 2 ! depth of the color buffer
+CONSTANT: GLX_LEVEL 3 ! level in plane stacking
+CONSTANT: GLX_RGBA 4 ! true if RGBA mode
+CONSTANT: GLX_DOUBLEBUFFER 5 ! double buffering supported
+CONSTANT: GLX_STEREO 6 ! stereo buffering supported
+CONSTANT: GLX_AUX_BUFFERS 7 ! number of aux buffers
+CONSTANT: GLX_RED_SIZE 8 ! number of red component bits
+CONSTANT: GLX_GREEN_SIZE 9 ! number of green component bits
+CONSTANT: GLX_BLUE_SIZE 10 ! number of blue component bits
+CONSTANT: GLX_ALPHA_SIZE 11 ! number of alpha component bits
+CONSTANT: GLX_DEPTH_SIZE 12 ! number of depth bits
+CONSTANT: GLX_STENCIL_SIZE 13 ! number of stencil bits
+CONSTANT: GLX_ACCUM_RED_SIZE 14 ! number of red accum bits
+CONSTANT: GLX_ACCUM_GREEN_SIZE 15 ! number of green accum bits
+CONSTANT: GLX_ACCUM_BLUE_SIZE 16 ! number of blue accum bits
+CONSTANT: GLX_ACCUM_ALPHA_SIZE 17 ! number of alpha accum bits
 
 TYPEDEF: XID GLXContextID
 TYPEDEF: XID GLXPixmap
index 534e47ac3706925c318aa48a52d73b746c879d20..e06872fa83456402e0f74de3f33638911106f268 100644 (file)
@@ -34,7 +34,7 @@ SYMBOL: xim
     XNResourceClass over 0 XCreateIC
     [ "XCreateIC() failed" throw ] unless* ;
 
-: buf-size 100 ;
+CONSTANT: buf-size 100
 
 SYMBOL: keybuf
 SYMBOL: keysym
index f86c24b845eca6f06008f708da1197253e53c48f..3394de87b271cd9bdd9f4b24f9503281477f0c73 100644 (file)
@@ -131,19 +131,19 @@ C-STRUCT: XSetWindowAttributes
         { "Colormap" "colormap" }
         { "Cursor" "cursor" } ;
 
-: UnmapGravity          0 ; inline
-
-: ForgetGravity         0 ; inline
-: NorthWestGravity      1 ; inline
-: NorthGravity          2 ; inline
-: NorthEastGravity      3 ; inline
-: WestGravity           4 ; inline
-: CenterGravity         5 ; inline
-: EastGravity           6 ; inline
-: SouthWestGravity      7 ; inline
-: SouthGravity          8 ; inline
-: SouthEastGravity      9 ; inline
-: StaticGravity         10 ; inline
+CONSTANT: UnmapGravity          0
+
+CONSTANT: ForgetGravity         0
+CONSTANT: NorthWestGravity      1
+CONSTANT: NorthGravity          2
+CONSTANT: NorthEastGravity      3
+CONSTANT: WestGravity           4
+CONSTANT: CenterGravity         5
+CONSTANT: EastGravity           6
+CONSTANT: SouthWestGravity      7
+CONSTANT: SouthGravity          8
+CONSTANT: SouthEastGravity      9
+CONSTANT: StaticGravity         10
 
 ! 3.3 - Creating Windows
 
@@ -238,9 +238,9 @@ C-STRUCT: XWindowAttributes
 
 FUNCTION: Status XGetWindowAttributes ( Display* display, Window w, XWindowAttributes* attr ) ;
 
-: IsUnmapped            0 ; inline
-: IsUnviewable          1 ; inline
-: IsViewable            2 ; inline
+CONSTANT: IsUnmapped            0
+CONSTANT: IsUnviewable          1
+CONSTANT: IsViewable            2
 
 FUNCTION: Status XGetGeometry (
   Display* display,
@@ -336,22 +336,22 @@ FUNCTION: Colormap XCreateColormap ( Display* display, Window w, Visual* visual,
 : GCDashList          ( -- n ) 21 2^ ; inline
 : GCArcMode           ( -- n ) 22 2^ ; inline
 
-: GXclear               HEX: 0 ; inline
-: GXand                 HEX: 1 ; inline
-: GXandReverse          HEX: 2 ; inline
-: GXcopy                HEX: 3 ; inline
-: GXandInverted         HEX: 4 ; inline
-: GXnoop                HEX: 5 ; inline
-: GXxor                 HEX: 6 ; inline
-: GXor                  HEX: 7 ; inline
-: GXnor                 HEX: 8 ; inline
-: GXequiv               HEX: 9 ; inline
-: GXinvert              HEX: a ; inline
-: GXorReverse           HEX: b ; inline
-: GXcopyInverted        HEX: c ; inline
-: GXorInverted          HEX: d ; inline
-: GXnand                HEX: e ; inline
-: GXset                 HEX: f ; inline
+CONSTANT: GXclear               HEX: 0
+CONSTANT: GXand                 HEX: 1
+CONSTANT: GXandReverse          HEX: 2
+CONSTANT: GXcopy                HEX: 3
+CONSTANT: GXandInverted         HEX: 4
+CONSTANT: GXnoop                HEX: 5
+CONSTANT: GXxor                 HEX: 6
+CONSTANT: GXor                  HEX: 7
+CONSTANT: GXnor                 HEX: 8
+CONSTANT: GXequiv               HEX: 9
+CONSTANT: GXinvert              HEX: a
+CONSTANT: GXorReverse           HEX: b
+CONSTANT: GXcopyInverted        HEX: c
+CONSTANT: GXorInverted          HEX: d
+CONSTANT: GXnand                HEX: e
+CONSTANT: GXset                 HEX: f
 
 C-STRUCT: XGCValues
         { "int" "function" }
@@ -447,10 +447,10 @@ FUNCTION: Status XDrawString (
 
 ! 8.7 - Transferring Images between Client and Server
 
-: XYBitmap 0 ; inline
-: XYPixmap 1 ; inline
-: ZPixmap  2 ; inline
-: AllPlanes -1 ; inline
+CONSTANT: XYBitmap 0
+CONSTANT: XYPixmap 1
+CONSTANT: ZPixmap  2
+CONSTANT: AllPlanes -1
 
 C-STRUCT: XImage-funcs
     { "void*" "create_image" }
@@ -532,40 +532,40 @@ FUNCTION: Status XKillClient ( Display* display, XID resource ) ;
 : ColormapChangeMask       ( -- n ) 23 2^ ; inline
 : OwnerGrabButtonMask      ( -- n ) 24 2^ ; inline
 
-: KeyPress              2 ; inline
-: KeyRelease            3 ; inline
-: ButtonPress           4 ; inline
-: ButtonRelease         5 ; inline
-: MotionNotify          6 ; inline
-: EnterNotify           7 ; inline
-: LeaveNotify           8 ; inline
-: FocusIn                       9 ; inline
-: FocusOut              10 ; inline
-: KeymapNotify          11 ; inline
-: Expose                        12 ; inline
-: GraphicsExpose                13 ; inline
-: NoExpose              14 ; inline
-: VisibilityNotify      15 ; inline
-: CreateNotify          16 ; inline
-: DestroyNotify         17 ; inline
-: UnmapNotify           18 ; inline
-: MapNotify             19 ; inline
-: MapRequest            20 ; inline
-: ReparentNotify                21 ; inline
-: ConfigureNotify               22 ; inline
-: ConfigureRequest      23 ; inline
-: GravityNotify         24 ; inline
-: ResizeRequest         25 ; inline
-: CirculateNotify               26 ; inline
-: CirculateRequest      27 ; inline
-: PropertyNotify                28 ; inline
-: SelectionClear                29 ; inline
-: SelectionRequest      30 ; inline
-: SelectionNotify               31 ; inline
-: ColormapNotify                32 ; inline
-: ClientMessage         33 ; inline
-: MappingNotify         34 ; inline
-: LASTEvent             35 ; inline
+CONSTANT: KeyPress              2
+CONSTANT: KeyRelease            3
+CONSTANT: ButtonPress           4
+CONSTANT: ButtonRelease         5
+CONSTANT: MotionNotify          6
+CONSTANT: EnterNotify           7
+CONSTANT: LeaveNotify           8
+CONSTANT: FocusIn                       9
+CONSTANT: FocusOut              10
+CONSTANT: KeymapNotify          11
+CONSTANT: Expose                        12
+CONSTANT: GraphicsExpose                13
+CONSTANT: NoExpose              14
+CONSTANT: VisibilityNotify      15
+CONSTANT: CreateNotify          16
+CONSTANT: DestroyNotify         17
+CONSTANT: UnmapNotify           18
+CONSTANT: MapNotify             19
+CONSTANT: MapRequest            20
+CONSTANT: ReparentNotify                21
+CONSTANT: ConfigureNotify               22
+CONSTANT: ConfigureRequest      23
+CONSTANT: GravityNotify         24
+CONSTANT: ResizeRequest         25
+CONSTANT: CirculateNotify               26
+CONSTANT: CirculateRequest      27
+CONSTANT: PropertyNotify                28
+CONSTANT: SelectionClear                29
+CONSTANT: SelectionRequest      30
+CONSTANT: SelectionNotify               31
+CONSTANT: ColormapNotify                32
+CONSTANT: ClientMessage         33
+CONSTANT: MappingNotify         34
+CONSTANT: LASTEvent             35
 
 C-STRUCT: XAnyEvent
         { "int" "type" }
@@ -578,11 +578,11 @@ C-STRUCT: XAnyEvent
 
 ! 10.5 Keyboard and Pointer Events
 
-: Button1 1 ; inline
-: Button2 2 ; inline
-: Button3 3 ; inline
-: Button4 4 ; inline
-: Button5 5 ; inline
+CONSTANT: Button1 1
+CONSTANT: Button2 2
+CONSTANT: Button3 3
+CONSTANT: Button4 4
+CONSTANT: Button5 5
 
 : Button1Mask ( -- n ) 1 8  shift ; inline
 : Button2Mask ( -- n ) 1 9  shift ; inline
@@ -1074,9 +1074,9 @@ FUNCTION: Status XMaskEvent ( Display* display, long event_mask, XEvent* event_r
 
 ! 11.3 - Event Queue Management
 
-: QueuedAlready 0 ; inline
-: QueuedAfterReading 1 ; inline
-: QueuedAfterFlush 2 ; inline
+CONSTANT: QueuedAlready 0
+CONSTANT: QueuedAfterReading 1
+CONSTANT: QueuedAfterFlush 2
 
 FUNCTION: int XEventsQueued ( Display* display, int mode ) ;
 FUNCTION: int XPending ( Display* display ) ;
@@ -1093,7 +1093,7 @@ FUNCTION: int XSetErrorHandler ( void* handler ) ;
 ! 12 - Input Device Functions
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: None 0 ; inline
+CONSTANT: None 0
 
 FUNCTION: int XGrabPointer (
   Display* display,
@@ -1199,17 +1199,17 @@ FUNCTION: int XLookupString (
 
 ! 16.7 Determining the Appropriate Visual Type
 
-: VisualNoMask                  HEX: 0 ; inline
-: VisualIDMask                  HEX: 1 ; inline
-: VisualScreenMask              HEX: 2 ; inline
-: VisualDepthMask               HEX: 4 ; inline
-: VisualClassMask               HEX: 8 ; inline
-: VisualRedMaskMask             HEX: 10 ; inline
-: VisualGreenMaskMask           HEX: 20 ; inline
-: VisualBlueMaskMask            HEX: 40 ; inline
-: VisualColormapSizeMask        HEX: 80 ; inline
-: VisualBitsPerRGBMask          HEX: 100 ; inline
-: VisualAllMask                 HEX: 1FF ; inline
+CONSTANT: VisualNoMask                  HEX: 0
+CONSTANT: VisualIDMask                  HEX: 1
+CONSTANT: VisualScreenMask              HEX: 2
+CONSTANT: VisualDepthMask               HEX: 4
+CONSTANT: VisualClassMask               HEX: 8
+CONSTANT: VisualRedMaskMask             HEX: 10
+CONSTANT: VisualGreenMaskMask           HEX: 20
+CONSTANT: VisualBlueMaskMask            HEX: 40
+CONSTANT: VisualColormapSizeMask        HEX: 80
+CONSTANT: VisualBitsPerRGBMask          HEX: 100
+CONSTANT: VisualAllMask                 HEX: 1FF
 
 C-STRUCT: XVisualInfo
         { "Visual*" "visual" }
@@ -1239,76 +1239,76 @@ FUNCTION: Status XSetStandardProperties (
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: XA_PRIMARY  1 ; inline
-: XA_SECONDARY 2 ; inline
-: XA_ARC 3 ; inline
-: XA_ATOM 4 ; inline
-: XA_BITMAP 5 ; inline
-: XA_CARDINAL 6 ; inline
-: XA_COLORMAP 7 ; inline
-: XA_CURSOR 8 ; inline
-: XA_CUT_BUFFER0 9 ; inline
-: XA_CUT_BUFFER1 10 ; inline
-: XA_CUT_BUFFER2 11 ; inline
-: XA_CUT_BUFFER3 12 ; inline
-: XA_CUT_BUFFER4 13 ; inline
-: XA_CUT_BUFFER5 14 ; inline
-: XA_CUT_BUFFER6 15 ; inline
-: XA_CUT_BUFFER7 16 ; inline
-: XA_DRAWABLE 17 ; inline
-: XA_FONT 18 ; inline
-: XA_INTEGER 19 ; inline
-: XA_PIXMAP 20 ; inline
-: XA_POINT 21 ; inline
-: XA_RECTANGLE 22 ; inline
-: XA_RESOURCE_MANAGER 23 ; inline
-: XA_RGB_COLOR_MAP 24 ; inline
-: XA_RGB_BEST_MAP 25 ; inline
-: XA_RGB_BLUE_MAP 26 ; inline
-: XA_RGB_DEFAULT_MAP 27 ; inline
-: XA_RGB_GRAY_MAP 28 ; inline
-: XA_RGB_GREEN_MAP 29 ; inline
-: XA_RGB_RED_MAP 30 ; inline
-: XA_STRING 31 ; inline
-: XA_VISUALID 32 ; inline
-: XA_WINDOW 33 ; inline
-: XA_WM_COMMAND 34 ; inline
-: XA_WM_HINTS 35 ; inline
-: XA_WM_CLIENT_MACHINE 36 ; inline
-: XA_WM_ICON_NAME 37 ; inline
-: XA_WM_ICON_SIZE 38 ; inline
-: XA_WM_NAME 39 ; inline
-: XA_WM_NORMAL_HINTS 40 ; inline
-: XA_WM_SIZE_HINTS 41 ; inline
-: XA_WM_ZOOM_HINTS 42 ; inline
-: XA_MIN_SPACE 43 ; inline
-: XA_NORM_SPACE 44 ; inline
-: XA_MAX_SPACE 45 ; inline
-: XA_END_SPACE 46 ; inline
-: XA_SUPERSCRIPT_X 47 ; inline
-: XA_SUPERSCRIPT_Y 48 ; inline
-: XA_SUBSCRIPT_X 49 ; inline
-: XA_SUBSCRIPT_Y 50 ; inline
-: XA_UNDERLINE_POSITION 51 ; inline
-: XA_UNDERLINE_THICKNESS 52 ; inline
-: XA_STRIKEOUT_ASCENT 53 ; inline
-: XA_STRIKEOUT_DESCENT 54 ; inline
-: XA_ITALIC_ANGLE 55 ; inline
-: XA_X_HEIGHT 56 ; inline
-: XA_QUAD_WIDTH 57 ; inline
-: XA_WEIGHT 58 ; inline
-: XA_POINT_SIZE 59 ; inline
-: XA_RESOLUTION 60 ; inline
-: XA_COPYRIGHT 61 ; inline
-: XA_NOTICE 62 ; inline
-: XA_FONT_NAME 63 ; inline
-: XA_FAMILY_NAME 64 ; inline
-: XA_FULL_NAME 65 ; inline
-: XA_CAP_HEIGHT 66 ; inline
-: XA_WM_CLASS 67 ; inline
-: XA_WM_TRANSIENT_FOR 68 ; inline
-
-: XA_LAST_PREDEFINED 68 ; inline
+CONSTANT: XA_PRIMARY  1
+CONSTANT: XA_SECONDARY 2
+CONSTANT: XA_ARC 3
+CONSTANT: XA_ATOM 4
+CONSTANT: XA_BITMAP 5
+CONSTANT: XA_CARDINAL 6
+CONSTANT: XA_COLORMAP 7
+CONSTANT: XA_CURSOR 8
+CONSTANT: XA_CUT_BUFFER0 9
+CONSTANT: XA_CUT_BUFFER1 10
+CONSTANT: XA_CUT_BUFFER2 11
+CONSTANT: XA_CUT_BUFFER3 12
+CONSTANT: XA_CUT_BUFFER4 13
+CONSTANT: XA_CUT_BUFFER5 14
+CONSTANT: XA_CUT_BUFFER6 15
+CONSTANT: XA_CUT_BUFFER7 16
+CONSTANT: XA_DRAWABLE 17
+CONSTANT: XA_FONT 18
+CONSTANT: XA_INTEGER 19
+CONSTANT: XA_PIXMAP 20
+CONSTANT: XA_POINT 21
+CONSTANT: XA_RECTANGLE 22
+CONSTANT: XA_RESOURCE_MANAGER 23
+CONSTANT: XA_RGB_COLOR_MAP 24
+CONSTANT: XA_RGB_BEST_MAP 25
+CONSTANT: XA_RGB_BLUE_MAP 26
+CONSTANT: XA_RGB_DEFAULT_MAP 27
+CONSTANT: XA_RGB_GRAY_MAP 28
+CONSTANT: XA_RGB_GREEN_MAP 29
+CONSTANT: XA_RGB_RED_MAP 30
+CONSTANT: XA_STRING 31
+CONSTANT: XA_VISUALID 32
+CONSTANT: XA_WINDOW 33
+CONSTANT: XA_WM_COMMAND 34
+CONSTANT: XA_WM_HINTS 35
+CONSTANT: XA_WM_CLIENT_MACHINE 36
+CONSTANT: XA_WM_ICON_NAME 37
+CONSTANT: XA_WM_ICON_SIZE 38
+CONSTANT: XA_WM_NAME 39
+CONSTANT: XA_WM_NORMAL_HINTS 40
+CONSTANT: XA_WM_SIZE_HINTS 41
+CONSTANT: XA_WM_ZOOM_HINTS 42
+CONSTANT: XA_MIN_SPACE 43
+CONSTANT: XA_NORM_SPACE 44
+CONSTANT: XA_MAX_SPACE 45
+CONSTANT: XA_END_SPACE 46
+CONSTANT: XA_SUPERSCRIPT_X 47
+CONSTANT: XA_SUPERSCRIPT_Y 48
+CONSTANT: XA_SUBSCRIPT_X 49
+CONSTANT: XA_SUBSCRIPT_Y 50
+CONSTANT: XA_UNDERLINE_POSITION 51
+CONSTANT: XA_UNDERLINE_THICKNESS 52
+CONSTANT: XA_STRIKEOUT_ASCENT 53
+CONSTANT: XA_STRIKEOUT_DESCENT 54
+CONSTANT: XA_ITALIC_ANGLE 55
+CONSTANT: XA_X_HEIGHT 56
+CONSTANT: XA_QUAD_WIDTH 57
+CONSTANT: XA_WEIGHT 58
+CONSTANT: XA_POINT_SIZE 59
+CONSTANT: XA_RESOLUTION 60
+CONSTANT: XA_COPYRIGHT 61
+CONSTANT: XA_NOTICE 62
+CONSTANT: XA_FONT_NAME 63
+CONSTANT: XA_FAMILY_NAME 64
+CONSTANT: XA_FULL_NAME 65
+CONSTANT: XA_CAP_HEIGHT 66
+CONSTANT: XA_WM_CLASS 67
+CONSTANT: XA_WM_TRANSIENT_FOR 68
+
+CONSTANT: XA_LAST_PREDEFINED 68
     
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! The rest of the stuff is not from the book.
@@ -1321,65 +1321,65 @@ FUNCTION: int XBell ( Display* display, int percent ) ;
 
 ! !!! INPUT METHODS
 
-: XIMPreeditArea      HEX: 0001 ; inline
-: XIMPreeditCallbacks HEX: 0002 ; inline
-: XIMPreeditPosition  HEX: 0004 ; inline
-: XIMPreeditNothing   HEX: 0008 ; inline
-: XIMPreeditNone      HEX: 0010 ; inline
-: XIMStatusArea       HEX: 0100 ; inline
-: XIMStatusCallbacks  HEX: 0200 ; inline
-: XIMStatusNothing    HEX: 0400 ; inline
-: XIMStatusNone       HEX: 0800 ; inline
-
-: XNVaNestedList "XNVaNestedList" ;
-: XNQueryInputStyle "queryInputStyle" ;
-: XNClientWindow "clientWindow" ;
-: XNInputStyle "inputStyle" ;
-: XNFocusWindow "focusWindow" ;
-: XNResourceName "resourceName" ;
-: XNResourceClass "resourceClass" ;
-: XNGeometryCallback "geometryCallback" ;
-: XNDestroyCallback "destroyCallback" ;
-: XNFilterEvents "filterEvents" ;
-: XNPreeditStartCallback "preeditStartCallback" ;
-: XNPreeditDoneCallback "preeditDoneCallback" ;
-: XNPreeditDrawCallback "preeditDrawCallback" ;
-: XNPreeditCaretCallback "preeditCaretCallback" ;
-: XNPreeditStateNotifyCallback "preeditStateNotifyCallback" ;
-: XNPreeditAttributes "preeditAttributes" ;
-: XNStatusStartCallback "statusStartCallback" ;
-: XNStatusDoneCallback "statusDoneCallback" ;
-: XNStatusDrawCallback "statusDrawCallback" ;
-: XNStatusAttributes "statusAttributes" ;
-: XNArea "area" ;
-: XNAreaNeeded "areaNeeded" ;
-: XNSpotLocation "spotLocation" ;
-: XNColormap "colorMap" ;
-: XNStdColormap "stdColorMap" ;
-: XNForeground "foreground" ;
-: XNBackground "background" ;
-: XNBackgroundPixmap "backgroundPixmap" ;
-: XNFontSet "fontSet" ;
-: XNLineSpace "lineSpace" ;
-: XNCursor "cursor" ;
-
-: XNQueryIMValuesList "queryIMValuesList" ;
-: XNQueryICValuesList "queryICValuesList" ;
-: XNVisiblePosition "visiblePosition" ;
-: XNR6PreeditCallback "r6PreeditCallback" ;
-: XNStringConversionCallback "stringConversionCallback" ;
-: XNStringConversion "stringConversion" ;
-: XNResetState "resetState" ;
-: XNHotKey "hotKey" ;
-: XNHotKeyState "hotKeyState" ;
-: XNPreeditState "preeditState" ;
-: XNSeparatorofNestedList "separatorofNestedList" ;
-
-: XBufferOverflow -1 ;
-: XLookupNone      1 ;
-: XLookupChars     2 ;
-: XLookupKeySym    3 ;
-: XLookupBoth      4 ;
+CONSTANT: XIMPreeditArea      HEX: 0001
+CONSTANT: XIMPreeditCallbacks HEX: 0002
+CONSTANT: XIMPreeditPosition  HEX: 0004
+CONSTANT: XIMPreeditNothing   HEX: 0008
+CONSTANT: XIMPreeditNone      HEX: 0010
+CONSTANT: XIMStatusArea       HEX: 0100
+CONSTANT: XIMStatusCallbacks  HEX: 0200
+CONSTANT: XIMStatusNothing    HEX: 0400
+CONSTANT: XIMStatusNone       HEX: 0800
+
+CONSTANT: XNVaNestedList "XNVaNestedList"
+CONSTANT: XNQueryInputStyle "queryInputStyle"
+CONSTANT: XNClientWindow "clientWindow"
+CONSTANT: XNInputStyle "inputStyle"
+CONSTANT: XNFocusWindow "focusWindow"
+CONSTANT: XNResourceName "resourceName"
+CONSTANT: XNResourceClass "resourceClass"
+CONSTANT: XNGeometryCallback "geometryCallback"
+CONSTANT: XNDestroyCallback "destroyCallback"
+CONSTANT: XNFilterEvents "filterEvents"
+CONSTANT: XNPreeditStartCallback "preeditStartCallback"
+CONSTANT: XNPreeditDoneCallback "preeditDoneCallback"
+CONSTANT: XNPreeditDrawCallback "preeditDrawCallback"
+CONSTANT: XNPreeditCaretCallback "preeditCaretCallback"
+CONSTANT: XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
+CONSTANT: XNPreeditAttributes "preeditAttributes"
+CONSTANT: XNStatusStartCallback "statusStartCallback"
+CONSTANT: XNStatusDoneCallback "statusDoneCallback"
+CONSTANT: XNStatusDrawCallback "statusDrawCallback"
+CONSTANT: XNStatusAttributes "statusAttributes"
+CONSTANT: XNArea "area"
+CONSTANT: XNAreaNeeded "areaNeeded"
+CONSTANT: XNSpotLocation "spotLocation"
+CONSTANT: XNColormap "colorMap"
+CONSTANT: XNStdColormap "stdColorMap"
+CONSTANT: XNForeground "foreground"
+CONSTANT: XNBackground "background"
+CONSTANT: XNBackgroundPixmap "backgroundPixmap"
+CONSTANT: XNFontSet "fontSet"
+CONSTANT: XNLineSpace "lineSpace"
+CONSTANT: XNCursor "cursor"
+
+CONSTANT: XNQueryIMValuesList "queryIMValuesList"
+CONSTANT: XNQueryICValuesList "queryICValuesList"
+CONSTANT: XNVisiblePosition "visiblePosition"
+CONSTANT: XNR6PreeditCallback "r6PreeditCallback"
+CONSTANT: XNStringConversionCallback "stringConversionCallback"
+CONSTANT: XNStringConversion "stringConversion"
+CONSTANT: XNResetState "resetState"
+CONSTANT: XNHotKey "hotKey"
+CONSTANT: XNHotKeyState "hotKeyState"
+CONSTANT: XNPreeditState "preeditState"
+CONSTANT: XNSeparatorofNestedList "separatorofNestedList"
+
+CONSTANT: XBufferOverflow -1
+CONSTANT: XLookupNone      1
+CONSTANT: XLookupChars     2
+CONSTANT: XLookupKeySym    3
+CONSTANT: XLookupBoth      4
 
 FUNCTION: Bool XFilterEvent ( XEvent* event, Window w ) ;
 
@@ -1400,12 +1400,12 @@ FUNCTION: int XwcLookupString ( XIC ic, XKeyPressedEvent* event, ulong* buffer_r
 FUNCTION: int Xutf8LookupString ( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, Status* status_return ) ;
 
 ! !!! category of setlocale
-: LC_ALL      0 ; inline
-: LC_COLLATE  1 ; inline
-: LC_CTYPE    2 ; inline
-: LC_MONETARY 3 ; inline
-: LC_NUMERIC  4 ; inline
-: LC_TIME     5 ; inline
+CONSTANT: LC_ALL      0
+CONSTANT: LC_COLLATE  1
+CONSTANT: LC_CTYPE    2
+CONSTANT: LC_MONETARY 3
+CONSTANT: LC_NUMERIC  4
+CONSTANT: LC_TIME     5
 
 FUNCTION: char* setlocale ( int category, char* name ) ;
 
index 3e768b1b88e5833461b85f0325d8a0f439960fd1..7eac725052b38e8aeddf4ad15ad96bf9854a5485 100644 (file)
@@ -4,20 +4,20 @@ USING: namespaces make kernel assocs sequences fry values
 io.files io.encodings.binary xml.state ;
 IN: xml.entities
 
-: entities-out
+CONSTANT: entities-out
     H{
         { CHAR: < "&lt;"   }
         { CHAR: > "&gt;"   }
         { CHAR: & "&amp;"  }
-    } ;
+    }
 
-: quoted-entities-out
+CONSTANT: quoted-entities-out
     H{
         { CHAR: & "&amp;"  }
         { CHAR: ' "&apos;" }
         { CHAR: " "&quot;" }
         { CHAR: < "&lt;"   }
-    } ;
+    }
 
 : escape-string-by ( str table -- escaped )
     #! Convert <, >, &, ' and " to HTML entities.
@@ -29,14 +29,14 @@ IN: xml.entities
 : escape-quoted-string ( str -- newstr )
     quoted-entities-out escape-string-by ;
 
-: entities
+CONSTANT: entities
     H{
         { "lt"    CHAR: <  }
         { "gt"    CHAR: >  }
         { "amp"   CHAR: &  }
         { "apos"  CHAR: '  }
         { "quot"  CHAR: "  }
-    } ;
+    }
 
 : with-entities ( entities quot -- )
     [ swap extra-entities set call ] with-scope ; inline
index f1e52319f198ff88d5cf599813ebea661fd50f34..04c0b66063f311d8745b3f0b18823d178817c06d 100644 (file)
@@ -11,7 +11,7 @@ VALUE: html-entities
 
 : get-html ( -- table )
     { "lat1" "special" "symbol" } [
-        "resource:basis/xml/entities/html/xhtml-"
+        "vocab:xml/entities/html/xhtml-"
         swap ".ent" 3append read-entities-file
     ] map first3 assoc-union assoc-union ;
 
diff --git a/basis/xml/entities/html/summary.txt b/basis/xml/entities/html/summary.txt
new file mode 100644 (file)
index 0000000..16ea3a8
--- /dev/null
@@ -0,0 +1 @@
+Standard HTML entities
index 304b38f2bda6a2915ee647f4f80db1e4a38b82b4..35111f5a54473cfb2ae9bcb43b9aa670e38db86a 100644 (file)
@@ -290,7 +290,7 @@ M: quoteless-attr summary
 
 TUPLE: attr-w/< < xml-error-at ;
 
-: attr-w/< ( value -- * )
+: attr-w/< ( -- * )
     \ attr-w/< xml-error-at throw ;
 
 M: attr-w/< summary
@@ -299,7 +299,7 @@ M: attr-w/< summary
 
 TUPLE: text-w/]]> < xml-error-at ;
 
-: text-w/]]> ( text -- * )
+: text-w/]]> ( -- * )
     \ text-w/]]> xml-error-at throw ;
 
 M: text-w/]]> summary
index aec3e40a52d1799e558b64140b2c17705106d91c..2f1d73f9ca8087840b2cc3640dc985bbc9c2fabf 100644 (file)
@@ -1,15 +1,15 @@
 USING: xml xml.data xml.traversal tools.test accessors kernel
 io.encodings.8-bit ;
 
-[ "\u000131" ] [ "resource:basis/xml/tests/latin5.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/latin1.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/spaces.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/utf8.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/utf16.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/utf16be.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/utf16le.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/utf16be-bom.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/utf16le-bom.xml" file>xml children>string ] unit-test
-[ "\u0000e9" ] [ "resource:basis/xml/tests/prologless.xml" file>xml children>string ] unit-test
-[ "e" ] [ "resource:basis/xml/tests/ascii.xml" file>xml children>string ] unit-test
-[ "\u0000e9" "x" ] [ "resource:basis/xml/tests/unitag.xml" file>xml [ name>> main>> ] [ children>string ] bi ] unit-test
+[ "\u000131" ] [ "vocab:xml/tests/latin5.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/latin1.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/spaces.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/utf8.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/utf16.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/utf16be.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/utf16le.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/utf16be-bom.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/utf16le-bom.xml" file>xml children>string ] unit-test
+[ "\u0000e9" ] [ "vocab:xml/tests/prologless.xml" file>xml children>string ] unit-test
+[ "e" ] [ "vocab:xml/tests/ascii.xml" file>xml children>string ] unit-test
+[ "\u0000e9" "x" ] [ "vocab:xml/tests/unitag.xml" file>xml [ name>> main>> ] [ children>string ] bi ] unit-test
index 1160af62bc191158c1f06acb4a04ef0ca06207d1..e9a38ae96b1ec5580efaeb9b3751fe8f0648f527 100644 (file)
@@ -4,6 +4,6 @@ IN: xml.tests
 USING: xml xml.writer io.files io.encodings.utf8 tools.test kernel ;
 
 [ t ] [
-    "resource:basis/xml/tests/funny-dtd.xml" utf8 file-contents string>xml
+    "vocab:xml/tests/funny-dtd.xml" utf8 file-contents string>xml
     dup xml>string string>xml =
 ] unit-test
index 3d1ac2379e0fd18446a0e5e8b349991593267739..464002b0605ffa3192091be8abfb03ff7f6063de 100644 (file)
@@ -10,6 +10,6 @@ IN: xml.tests
     [ assemble-data ] map ;
 
 [ "http://www.foxnews.com/oreilly/" ] [
-    "resource:basis/xml/tests/soap.xml" file>xml
+    "vocab:xml/tests/soap.xml" file>xml
     parse-result first first
 ] unit-test
index 03721327368bb15d31336a1fd2afa050ffae722f..818a28c892896584e9385da9083fd6e524b06d7d 100644 (file)
@@ -13,11 +13,11 @@ sequences.deep accessors io.streams.string ;
 
 SYMBOL: xml-file
 [ ] [
-    "resource:basis/xml/tests/test.xml"
+    "vocab:xml/tests/test.xml"
     [ file>xml ] with-html-entities xml-file set
 ] unit-test
 [ t ] [
-    "resource:basis/xml/tests/test.xml" binary file-contents
+    "vocab:xml/tests/test.xml" binary file-contents
     [ bytes>xml ] with-html-entities xml-file get =
 ] unit-test
 [ "1.0" ] [ xml-file get prolog>> version>> ] unit-test
index 80472fc788806cb5d5a371eac309cba95653e091..2ab9ff98dd7b8ff0e2abbdeca263c0df9d703544 100644 (file)
@@ -17,7 +17,7 @@ TUPLE: xml-test id uri sections description type ;
 : parse-tests ( xml -- tests )
     "TEST" tags-named [ >xml-test ] map ;
 
-: base "resource:basis/xml/tests/xmltest/" ;
+: base "vocab:xml/tests/xmltest/" ;
 
 MACRO: drop-output ( quot -- newquot )
     dup infer out>> '[ @ _ ndrop ] ;
index 4408655d9c9db144c590ebab366e1337af8af79c..ae223bf82f8d6b3a17ce89eea920e23ed4be9222 100644 (file)
@@ -4,5 +4,5 @@ USING: xml xml.data kernel tools.test ;
 IN: xml.tests
 
 [ t ] [
-    "resource:basis/xmode/xmode.dtd" file>dtd dtd?
+    "vocab:xmode/xmode.dtd" file>dtd dtd?
 ] unit-test
index 4e3af0af5613998deb548a265993a7f86881521c..7a935d31a424b6619f9219a5302c30fe29784d92 100644 (file)
@@ -25,7 +25,7 @@ TAGS>
     ] keep ;
 
 MEMO: modes ( -- modes )
-    "resource:basis/xmode/modes/catalog"
+    "vocab:xmode/modes/catalog"
     file>xml parse-modes-tag ;
 
 MEMO: mode-names ( -- modes )
@@ -37,8 +37,7 @@ MEMO: mode-names ( -- modes )
 MEMO: (load-mode) ( name -- rule-sets )
     modes at [
         file>>
-        "resource:basis/xmode/modes/" prepend
-        utf8 <file-reader> parse-mode
+        "vocab:xmode/modes/" prepend parse-mode
     ] [
         "text" (load-mode)
     ] if* ;
diff --git a/basis/xmode/code2html/summary.txt b/basis/xmode/code2html/summary.txt
new file mode 100644 (file)
index 0000000..f5e88d0
--- /dev/null
@@ -0,0 +1 @@
+Syntax highlighting code as HTML
index 70466913a09b8213eba7ba9a09c000b8df5801c9..ef1defc4da55f7ce27962fe6833152a8d46878f3 100644 (file)
@@ -84,5 +84,5 @@ TAGS>
         [ merge-rule-set-props ] with each
     ] when* ;
 
-: parse-mode ( stream -- rule-sets )
-    read-xml parse-mode-tag ;
+: parse-mode ( filename -- rule-sets )
+    file>xml parse-mode-tag ;
diff --git a/basis/xmode/marker/summary.txt b/basis/xmode/marker/summary.txt
new file mode 100644 (file)
index 0000000..379906c
--- /dev/null
@@ -0,0 +1 @@
+Tokenizing lines of text with a syntax mode
index 45238ca2b18bcf1e0688b52f21c88f9b1211873a..1339430cf8d06a036660b0dafca66e0e7732a407 100644 (file)
@@ -47,6 +47,6 @@ TAGS>
         "PUBLIC"
     }
 ] [
-    "resource:basis/xmode/utilities/test.xml"
+    "vocab:xmode/utilities/test.xml"
     file>xml parse-company-tag
 ] unit-test
index 39fed147cfa760dabf71b2323c46c264134eb7ff..f5dc62a67d8b6d99f0920867b4a3938dab071b39 100644 (file)
@@ -1,11 +1,18 @@
 USING: help.markup help.syntax
-kernel kernel.private prettyprint sequences.private ;
+kernel kernel.private prettyprint sequences.private sequences ;
 IN: arrays
 
+ARTICLE: "arrays-unsafe" "Unsafe array operations"
+"These two words are used internally by the Factor implementation. User code should never need to call them; instead use " { $link nth } " and " { $link set-nth } "."
+{ $subsection array-nth }
+{ $subsection set-array-nth } ;
+
 ARTICLE: "arrays" "Arrays"
-"Arrays are fixed-size mutable sequences (" { $link "sequence-protocol" } "). The literal syntax is covered in " { $link "syntax-arrays" } ". Resizable arrays also exist and are called vectors; see " { $link "vectors" } "."
+"The " { $vocab-link "arrays" } " vocabulary implements fixed-size mutable sequences which support the " { $link "sequence-protocol" } "."
+$nl
+"The " { $vocab-link "arrays" } " vocabulary only includes words for creating new arrays. To access and modify array elements, use " { $link "sequences" } " in the " { $vocab-link "sequences" } " vocabulary."
 $nl
-"Array words are in the " { $vocab-link "arrays" } " vocabulary. Unsafe implementation words are in the " { $vocab-link "sequences.private" } " vocabulary."
+"Array literal syntax is documented in " { $link "syntax-arrays" } ". Resizable arrays also exist and are known as " { $link "vectors" } "."
 $nl
 "Arrays form a class of objects:"
 { $subsection array }
@@ -18,11 +25,10 @@ $nl
 { $subsection 2array }
 { $subsection 3array }
 { $subsection 4array }
-"Arrays can be accessed without bounds checks in a pointer unsafe way."
-{ $subsection array-nth }
-{ $subsection set-array-nth }
 "The class of two-element arrays:"
-{ $subsection pair } ;
+{ $subsection pair }
+"Arrays can be accessed without bounds checks in a pointer unsafe way."
+{ $subsection "arrays-unsafe" } ;
 
 ABOUT: "arrays"
 
index e5c43f3ed68ef954a98905f9afa7dc0f302d90c9..9576a41b7b919dd2ef0d13eecfc205afa0de57f0 100755 (executable)
@@ -58,6 +58,7 @@ ARTICLE: "assocs-lookup" "Lookup and querying of assocs"
 "Utility operations built up from the " { $link "assocs-protocol" } ":"
 { $subsection key? }
 { $subsection at }
+{ $subsection ?at }
 { $subsection assoc-empty? }
 { $subsection keys }
 { $subsection values }
@@ -188,12 +189,16 @@ HELP: key?
 { $values { "key" object } { "assoc" assoc } { "?" "a boolean" } }
 { $description "Tests if an assoc contains a key." } ;
 
-{ at at* key? } related-words
+{ at at* key? ?at } related-words
 
 HELP: at
 { $values { "key" "an object" } { "assoc" assoc } { "value/f" "the value associated to the key, or " { $link f } " if the key is not present in the assoc" } }
 { $description "Looks up the value associated with a key. This word makes no distinction between a missing value and a value set to " { $link f } "; if the difference is important, use " { $link at* } "." } ;
 
+HELP: ?at
+{ $values { "key" "an object" } { "assoc" assoc } { "value/key" "the value associated to the key, or the key if the key is not present in the assoc" } { "?" "a boolean" } }
+{ $description "Looks up the value associated with a key. If the key was not present, an error can be thrown without extra stack shuffling. This word handles assocs that store " { $link f } "." } ;
+
 HELP: assoc-each
 { $values { "assoc" assoc } { "quot" { $quotation "( key value -- )" } } }
 { $description "Applies a quotation to each entry in the assoc." }
index 5617888148ede69c4928ff7e98a58bf1d25d434b..fc74df6d452efc8458e55f4c75b282666cbf77d6 100644 (file)
@@ -138,4 +138,7 @@ unit-test
         { "c" [ 3 ] }
         { "d" [ 4 ] }
     } [ nip first even? ] assoc-partition
-] unit-test
\ No newline at end of file
+] unit-test
+
+[ 1 f ] [ 1 H{ } ?at ] unit-test
+[ 2 t ] [ 1 H{ { 1 2 } } ?at ] unit-test
index e46bb7abb669ce0e983b474e6a64b1d07cc9f5df..fdaa02e6c42cd4e8815cdc3181271f0de49f63d3 100755 (executable)
@@ -19,6 +19,9 @@ GENERIC: >alist ( assoc -- newassoc )
 
 M: assoc assoc-like drop ;
 
+: ?at ( key assoc -- value/key ? )
+    dupd at* [ [ nip ] [ drop ] if ] keep ; inline
+
 <PRIVATE
 
 : (assoc-each) ( assoc quot -- seq quot' )
@@ -36,7 +39,7 @@ M: assoc assoc-like drop ;
     [ first = ] with find swap ; inline
 
 : substituter ( assoc -- quot )
-    [ dupd at* [ nip ] [ drop ] if ] curry ; inline
+    [ ?at drop ] curry ; inline
 
 : with-assoc ( assoc quot: ( value key -- assoc ) -- quot: ( key value -- ) )
     curry [ swap ] prepose ; inline
@@ -80,7 +83,7 @@ PRIVATE>
     at* drop ; inline
 
 : at-default ( key assoc -- value/key )
-    2dup at* [ 2nip ] [ 2drop ] if ; inline
+    ?at drop ; inline
 
 M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
     [ dup assoc-size ] dip new-assoc
index f1e8b8b65e14d662eb5a1e02d75d1b12da5ddd5c..9e064cf99c2fdc0c8e0e86b9ab38a2be82416c3b 100644 (file)
@@ -16,9 +16,9 @@ crossref off
 
 H{ } clone sub-primitives set
 
-"resource:core/bootstrap/syntax.factor" parse-file
+"vocab:bootstrap/syntax.factor" parse-file
 
-"resource:basis/cpu/" architecture get {
+"vocab:cpu/" architecture get {
     { "x86.32" "x86/32" }
     { "winnt-x86.64" "x86/64/winnt" }
     { "unix-x86.64" "x86/64/unix" }
@@ -27,7 +27,7 @@ H{ } clone sub-primitives set
     { "arm" "arm" }
 } at "/bootstrap.factor" 3append parse-file
 
-"resource:core/bootstrap/layouts/layouts.factor" parse-file
+"vocab:bootstrap/layouts/layouts.factor" parse-file
 
 ! Now we have ( syntax-quot arch-quot layouts-quot ) on the stack
 
@@ -538,4 +538,4 @@ tuple
 [ [ first2 ] dip make-primitive ] each-index
 
 ! Bump build number
-"build" "kernel" create build 1+ 1quotation define
+"build" "kernel" create build 1+ [ ] curry (( -- n )) define-declared
index 9a40796bda48600dd80497d6a691bf5c080a9f8e..1da2dfee59c36bd363479685456c124c0f40a35e 100644 (file)
@@ -9,7 +9,7 @@ IN: bootstrap.stage1
 
 "Bootstrap stage 1..." print flush
 
-"resource:core/bootstrap/primitives.factor" run-file
+"vocab:bootstrap/primitives.factor" run-file
 
 load-help? off
 { "resource:core" } vocab-roots set
@@ -40,7 +40,7 @@ load-help? off
     "bootstrap.layouts" require
 
     [
-        "resource:basis/bootstrap/stage2.factor"
+        "vocab:bootstrap/stage2.factor"
         dup exists? [
             run-file
         ] [
index d373a96f39244c8d8881650849d76e7eacbb2c83..7ea2964411370fa1c321115ba3effcdafce3ad9b 100644 (file)
@@ -5,9 +5,9 @@ words io io.binary io.files io.streams.string quotations
 definitions checksums ;
 IN: checksums.crc32
 
-: crc32-polynomial HEX: edb88320 ; inline
+CONSTANT: crc32-polynomial HEX: edb88320
 
-: crc32-table V{ } ; inline
+CONSTANT: crc32-table V{ }
 
 256 [
     8 [
diff --git a/core/classes/algebra/summary.txt b/core/classes/algebra/summary.txt
new file mode 100644 (file)
index 0000000..d33d3b9
--- /dev/null
@@ -0,0 +1 @@
+Set-theoretic operations on classes
diff --git a/core/classes/builtin/summary.txt b/core/classes/builtin/summary.txt
new file mode 100644 (file)
index 0000000..cb77cbf
--- /dev/null
@@ -0,0 +1 @@
+Built-in classes
diff --git a/core/classes/intersection/summary.txt b/core/classes/intersection/summary.txt
new file mode 100644 (file)
index 0000000..a2ecf2c
--- /dev/null
@@ -0,0 +1 @@
+Intersection classes
diff --git a/core/classes/parser/summary.txt b/core/classes/parser/summary.txt
new file mode 100644 (file)
index 0000000..cd36855
--- /dev/null
@@ -0,0 +1 @@
+Utilities for class-defining parsing words
diff --git a/core/classes/singleton/summary.txt b/core/classes/singleton/summary.txt
new file mode 100644 (file)
index 0000000..273fbcb
--- /dev/null
@@ -0,0 +1 @@
+Singleton classes
diff --git a/core/classes/tuple/parser/summary.txt b/core/classes/tuple/parser/summary.txt
new file mode 100644 (file)
index 0000000..765ccec
--- /dev/null
@@ -0,0 +1 @@
+Utilities for tuple-defining parsing words
index 4dbb64316bc248de8df19496fced6e7cb370dc0c..7ef244eefc08a634d10608e6f694ad5b99cca9ac 100644 (file)
@@ -1 +1 @@
-Object system implementation
+Tuple classes
index 0469f3564aaeb466d01ac4dc89b5afcebda17b52..32cab6590446182decc73d11e81472cd75c3d39e 100644 (file)
@@ -22,7 +22,7 @@ ARTICLE: "slot-class-declaration" "Slot class declarations"
 ARTICLE: "slot-class-coercion" "Coercive slot declarations"
 "If the class of a slot is declared to be one of " { $link fixnum } " or " { $link float } ", then rather than testing values with the class predicate, writer words coerce values to the relevant type with " { $link >fixnum } " or " { $link >float } ". This may still result in error, but permits a wider range of values than a class predicate test. It also results in a possible loss of precision; for example, storing a large integer into a " { $link fixnum } " slot will silently overflow and discard high bits, and storing a ratio into a " { $link float } " slot may lose precision if the ratio is one which cannot be represented exactly with floating-point."
 $nl
-"This feature is mostly intended as an optimization for low-level code designed to avoid integer overflow, or where floating point precision is sufficient. Most code needs to work transparently with large integers, and thus hsould avoid the coercion behavior by using " { $link integer } " and " { $link real } " in place of " { $link fixnum } " and " { $link float } "." ;
+"This feature is mostly intended as an optimization for low-level code designed to avoid integer overflow, or where floating point precision is sufficient. Most code needs to work transparently with large integers, and thus should avoid the coercion behavior by using " { $link integer } " and " { $link real } " in place of " { $link fixnum } " and " { $link float } "." ;
 
 ARTICLE: "tuple-declarations" "Tuple slot declarations"
 "The slot specifier syntax of the " { $link POSTPONE: TUPLE: } " parsing word understands the following slot attributes:"
index beb50f1162ac7a69626d92bbbcbffa8a0a042622..1ee3a4e3ed9c15b981625c2b9d4f6f391f4609e9 100644 (file)
@@ -176,8 +176,8 @@ IN: combinators.tests
 
 [ "an array" ] [ { 1 2 3 } case-test-3 ] unit-test
 
-: case-const-1 1 ;
-: case-const-2 2 ; inline
+CONSTANT: case-const-1 1
+CONSTANT: case-const-2 2
 
 ! Compiled
 : case-test-4 ( obj -- str )
index 9346bba6b9dc62e784daf420904fc5ac4fb824b9..2a995e8a6972a71df4e565a8aedf4c8d16e2b0a4 100644 (file)
@@ -1 +1 @@
-Complex conditionals (cond, case) and support words for quotation construction
+Complex conditionals (cond, case) and generalized dataflow combinators (cleave, spread)
index f5ecf5add149967f18fd8c63ecd9b06766d90d42..8368afeb19ca47ed9bbb3eb1708ea0ac4236d990 100644 (file)
@@ -3,9 +3,16 @@ USING: help.markup help.syntax vocabs.loader words io
 quotations words.symbol ;
 
 ARTICLE: "compiler-errors" "Compiler warnings and errors"
-"The compiler saves " { $link "inference-errors" } " in a global variable:"
-{ $subsection compiler-errors }
-"These notifications can be viewed later:"
+"After loading a vocabulary, you might see messages like:"
+{ $code
+    ":errors - print 2 compiler errors."
+    ":warnings - print 50 compiler warnings."
+}
+"These warnings arise from the compiler's stack effect checker. Warnings are non-fatal conditions -- not all code has a static stack effect, so you try to minimize warnings but understand that in many cases they cannot be eliminated. Errors indicate programming mistakes, such as erroneous stack effect declarations."
+$nl
+"The precise warning and error conditions are documented in " { $link "inference-errors" } "."
+$nl
+"Words to view warnings and errors:"
 { $subsection :errors }
 { $subsection :warnings }
 { $subsection :linkage }
index 09baf9101828ac51219d0178337a0efffb758c03..46d3dbc33f59220f1702a5e357c69320784b06e8 100644 (file)
@@ -67,7 +67,3 @@ HELP: modify-code-heap ( alist -- )
 HELP: compile
 { $values { "words" "a sequence of words" } }
 { $description "Compiles a set of words." } ;
-
-HELP: compile-call
-{ $values { "quot" "a quotation" } }
-{ $description "Compiles and runs a quotation." } ;
index ac3e99e24cf262014e299d6e22ce003cddaf7a09..0577f8b83cd15515245bd6d891d2ab076cafc0f5 100644 (file)
@@ -172,9 +172,6 @@ SYMBOL: remake-generics-hook
         ] [ ] cleanup
     ] with-scope ; inline
 
-: compile-call ( quot -- )
-    [ define-temp ] with-compilation-unit execute ;
-
 : default-recompile-hook ( words -- alist )
     [ f ] { } map>assoc ;
 
index c7056856b601c70143af297b64977cb689fdf61a..37418b85f5adc672319e45338a94d380e8f6991b 100644 (file)
@@ -92,10 +92,10 @@ C: <continuation> continuation
 
 PRIVATE>
 
-: continue-with ( obj continuation -- )
+: continue-with ( obj continuation -- )
     [ (continue-with) ] 2 (throw) ;
 
-: continue ( continuation -- )
+: continue ( continuation -- )
     f swap continue-with ;
 
 SYMBOL: return-continuation
@@ -103,7 +103,7 @@ SYMBOL: return-continuation
 : with-return ( quot -- )
     [ [ return-continuation set ] prepose callcc0 ] with-scope ; inline
 
-: return ( -- )
+: return ( -- )
     return-continuation get continue ;
 
 : with-datastack ( stack quot -- newstack )
@@ -173,7 +173,7 @@ TUPLE: restart name obj continuation ;
 
 C: <restart> restart
 
-: restart ( restart -- )
+: restart ( restart -- )
     [ obj>> ] [ continuation>> ] bi continue-with ;
 
 M: object compute-restarts drop { } ;
index 8a06653eb8af49430dfece15ecb7b67b4a17a63e..a9f9634d469ff50fe1dfdd3cfa2b3b79bc382fdd 100644 (file)
@@ -44,9 +44,9 @@ M: effect effect>string ( effect -- string )
 
 GENERIC: stack-effect ( word -- effect/f )
 
-M: word stack-effect
-    { "declared-effect" "inferred-effect" }
-    swap props>> [ at ] curry map [ ] find nip ;
+M: word stack-effect "declared-effect" word-prop ;
+
+M: deferred stack-effect call-next-method (( -- * )) or ;
 
 M: effect clone
     [ in>> clone ] [ out>> clone ] bi <effect> ;
diff --git a/core/effects/parser/summary.txt b/core/effects/parser/summary.txt
new file mode 100644 (file)
index 0000000..c0e236c
--- /dev/null
@@ -0,0 +1 @@
+Parsing stack effect declarations
diff --git a/core/generic/parser/summary.txt b/core/generic/parser/summary.txt
new file mode 100644 (file)
index 0000000..7b7b51c
--- /dev/null
@@ -0,0 +1 @@
+Utilities for generic word and method defining parsing words
diff --git a/core/generic/standard/engines/predicate/summary.txt b/core/generic/standard/engines/predicate/summary.txt
new file mode 100644 (file)
index 0000000..47fee09
--- /dev/null
@@ -0,0 +1 @@
+Chained-conditional dispatch strategy
diff --git a/core/generic/standard/engines/summary.txt b/core/generic/standard/engines/summary.txt
new file mode 100644 (file)
index 0000000..2091907
--- /dev/null
@@ -0,0 +1 @@
+Generic word dispatch strategy implementation
diff --git a/core/generic/standard/engines/tag/summary.txt b/core/generic/standard/engines/tag/summary.txt
new file mode 100644 (file)
index 0000000..3eea4b1
--- /dev/null
@@ -0,0 +1 @@
+Jump table keyed by pointer tag dispatch strategy
diff --git a/core/generic/standard/engines/tuple/summary.txt b/core/generic/standard/engines/tuple/summary.txt
new file mode 100644 (file)
index 0000000..cb18ac5
--- /dev/null
@@ -0,0 +1 @@
+Tuple class dispatch strategy
index 9ace1a01f4f63efb02abf938fd43aa106f4f3fda..f9fe3a6e9e347a8473e252746fee2dd9dd65b0e0 100644 (file)
@@ -50,16 +50,16 @@ ERROR: no-method object generic ;
     convert-hi-tag-methods
     <lo-tag-dispatch-engine> ;
 
+: mangle-method ( method -- quot )
+    1quotation generic get extra-values \ drop <repetition>
+    prepend [ ] like ;
+
 : find-default ( methods -- quot )
     #! Side-effects methods.
     object bootstrap-word swap delete-at* [
-        drop generic get "default-method" word-prop 1quotation
+        drop generic get "default-method" word-prop mangle-method
     ] unless ;
 
-: mangle-method ( method generic -- quot )
-    [ 1quotation ] [ extra-values \ drop <repetition> ] bi*
-    prepend [ ] like ;
-
 : <standard-engine> ( word -- engine )
     object bootstrap-word assumed set {
         [ generic set ]
@@ -67,7 +67,7 @@ ERROR: no-method object generic ;
         [ V{ } clone "engines" set-word-prop ]
         [
             "methods" word-prop
-            [ generic get mangle-method ] assoc-map
+            [ mangle-method ] assoc-map
             [ find-default default set ]
             [ <big-dispatch-engine> ]
             bi
index 7cc8333c12656cac001fd5cdc949feb7dba3b77b..5a19cce351dab92e79976874bb60c5af8d89efd8 100644 (file)
@@ -17,9 +17,7 @@ $nl
 ARTICLE: "hashtables" "Hashtables"
 "A hashtable provides efficient (expected constant time) lookup and storage of key/value pairs. Keys are compared for equality, and a hashing function is used to reduce the number of comparisons made. The literal syntax is covered in " { $link "syntax-hashtables" } "."
 $nl
-"Hashtable words are in the " { $vocab-link "hashtables" } " vocabulary. Unsafe implementation words are in the " { $vocab-link "hashtables.private" } " vocabulary."
-$nl
-"Hashtables implement the " { $link "assocs-protocol" } "."
+"Words for constructing hashtables are in the " { $vocab-link "hashtables" } " vocabulary. Hashtables implement the " { $link "assocs-protocol" } ", and all " { $link "assocs" } " can be used on them; there are no hashtable-specific words to access and modify keys, because associative mapping operations are generic and work with all associative mappings."
 $nl
 "Hashtables are a class of objects."
 { $subsection hashtable }
index 509757c68aae3639d9dbc0c9cdefbc048af71f12..e13e05bf403a4e312ed70dc94648b6072c62fa47 100644 (file)
@@ -1,4 +1,4 @@
-USING: help.markup help.syntax io quotations ;
+USING: help.markup help.syntax io quotations math ;
 IN: io.encodings
 
 HELP: <encoder>
@@ -71,6 +71,9 @@ HELP: with-encoded-output
 { $description "Creates a new encoder with the given encoding descriptor and calls the quotation using this encoder. The original encoder object is restored after the quotation returns and the stream is kept open for future output operations." } ;
 
 HELP: replacement-char
+{ $values
+    { "value" integer }
+}
 { $description "A code point that replaces input that could not be decoded. The presence of this character in the decoded data usually signifies an error." } ;
 
 ARTICLE: "encodings-descriptors" "Encoding descriptors"
index ea74490858d6bbe61ed612c543127bdf0a0fd0a0..fa8832deab5958f26dcd229007d0e3f206e749de 100644 (file)
@@ -4,34 +4,34 @@ namespaces accessors io.encodings ;
 IN: io.streams.encodings.tests
 
 [ { } ]
-[ "resource:core/io/test/empty-file.txt" ascii <file-reader> lines ]
+[ "vocab:io/test/empty-file.txt" ascii file-lines ]
 unit-test
 
-: lines-test ( stream -- line1 line2 )
-    [ readln readln ] with-input-stream ;
+: lines-test ( file encoding -- line1 line2 )
+    [ readln readln ] with-file-reader ;
 
 [
     "This is a line."
     "This is another line."
 ] [
-    "resource:core/io/test/windows-eol.txt"
-    ascii <file-reader> lines-test
+    "vocab:io/test/windows-eol.txt"
+    ascii lines-test
 ] unit-test
 
 [
     "This is a line."
     "This is another line."
 ] [
-    "resource:core/io/test/mac-os-eol.txt"
-    ascii <file-reader> lines-test
+    "vocab:io/test/mac-os-eol.txt"
+    ascii lines-test
 ] unit-test
 
 [
     "This is a line."
     "This is another line."
 ] [
-    "resource:core/io/test/unix-eol.txt"
-    ascii <file-reader> lines-test
+    "vocab:io/test/unix-eol.txt"
+    ascii lines-test
 ] unit-test
 
 [
index 94d211547870bc76918336d5a5c48b1af54b5188..e8735afa6aac8feb4c102d8b78f328e0c3b7e278 100644 (file)
@@ -14,7 +14,7 @@ GENERIC: encode-char ( char stream encoding -- )
 
 GENERIC: <decoder> ( stream encoding -- newstream )
 
-: replacement-char HEX: fffd ; inline
+CONSTANT: replacement-char HEX: fffd
 
 TUPLE: decoder stream code cr ;
 
diff --git a/core/io/encodings/utf8/tags.txt b/core/io/encodings/utf8/tags.txt
deleted file mode 100644 (file)
index 8e27be7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-text
index 152d1bb85d228b65953df779f182979ed72693a1..ce15a6977324774dcb629660bf4f3324690acba4 100644 (file)
@@ -14,15 +14,15 @@ IN: io.files.tests
 [
     "This is a line.\rThis is another line.\r"
 ] [
-    "resource:core/io/test/mac-os-eol.txt" latin1 <file-reader>
-    [ 500 read ] with-input-stream
+    "vocab:io/test/mac-os-eol.txt" latin1
+    [ 500 read ] with-file-reader
 ] unit-test
 
 [
     255
 ] [
-    "resource:core/io/test/binary.txt" latin1 <file-reader>
-    [ read1 ] with-input-stream >fixnum
+    "vocab:io/test/binary.txt" latin1
+    [ read1 ] with-file-reader >fixnum
 ] unit-test
 
 [ ] [
@@ -39,11 +39,11 @@ IN: io.files.tests
 ] [
     [
         "separator-test.txt" temp-file
-        latin1 <file-reader> [
+        latin1 [
             "J" read-until 2array ,
             "i" read-until 2array ,
             "X" read-until 2array ,
-        ] with-input-stream
+        ] with-file-reader
     ] { } make
 ] unit-test
 
index cf6b935215bc1493b20167f76a0cacd44a0bc1ab..f0cbd33114db657fdb6310686546e77cf8c3a41f 100644 (file)
@@ -2,7 +2,7 @@ USING: io parser tools.test words ;
 IN: io.tests
 
 [ f ] [
-    "resource:core/io/test/no-trailing-eol.factor" run-file
+    "vocab:io/test/no-trailing-eol.factor" run-file
     "foo" "io.tests" lookup
 ] unit-test
 
index a4f261391a131289a29d56a6f0bbb7e39b50574d..f5ad6e533b317754b6b23b2b23a1a05ea58c2ea5 100644 (file)
@@ -1,4 +1,5 @@
-USING: help.markup help.syntax io.backend io.files strings ;
+USING: help.markup help.syntax io.backend io.files strings
+sequences ;
 IN: io.pathnames
 
 HELP: path-separator?
@@ -22,6 +23,10 @@ HELP: file-name
     { $example "USING: io.pathnames prettyprint ;" "\"/usr/libexec/awk/\" file-name ." "\"awk\"" }
 } ;
 
+HELP: path-components
+{ $values { "path" "a pathnames string" } { "seq" sequence } }
+{ $description "Splits a pathname on the " { $link path-separator } " into its its component strings." } ;
+
 HELP: append-path
 { $values { "str1" "a string" } { "str2" "a string" } { "str" "a string" } }
 { $description "Appends " { $snippet "str1" } " and " { $snippet "str2" } " to form a pathname." } ;
@@ -57,6 +62,10 @@ HELP: normalize-path
 { $values { "str" "a pathname string" } { "newstr" "a new pathname string" } }
 { $description "Called by words such as " { $link <file-reader> } " and " { $link <file-writer> } " to prepare a pathname before passing it to underlying code." } ;
 
+HELP: canonicalize-path
+{ $values { "path" "a pathname string" } { "path'" "a new pathname string" } }
+{ $description "Returns an canonical name for a path. The canonical name is an absolute path containing no symlinks." } ;
+
 HELP: <pathname>
 { $values { "string" "a pathname string" } { "pathname" pathname } }
 { $description "Creates a new " { $link pathname } "." } ;
@@ -74,9 +83,12 @@ ARTICLE: "io.pathnames" "Pathname manipulation"
 { $subsection POSTPONE: P" }
 "Pathname manipulation:"
 { $subsection normalize-path }
+{ $subsection canonicalize-path }
 { $subsection parent-directory }
 { $subsection file-name }
 { $subsection last-path-separator }
+{ $subsection path-components }
+{ $subsection prepend-path }
 { $subsection append-path }
 "Pathname presentations:"
 { $subsection pathname }
index 41498fa15a3cfbaffbd553bc6fe1d8ae57ccadfe..c3e419e60d9e8547d9779ae879e3bd0cf12cf3d2 100644 (file)
@@ -66,3 +66,7 @@ IN: io.pathnames.tests
 ] with-scope
 
 [ t ] [ cwd "misc" resource-path [ ] with-directory cwd = ] unit-test
+
+! Regression test for bug in file-extension
+[ f ] [ "/funny.directory/file-with-no-extension" file-extension ] unit-test
+[ "" ] [ "/funny.directory/file-with-no-extension." file-extension ] unit-test
index 1673e730830ba3d30596d14afe8b764540f93e1a..eba3e6a19fdb41425a34abb561abc508fbe95d56 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2004, 2008 Slava Pestov, Doug Coleman.
+! Copyright (C) 2004, 2009 Slava Pestov, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors combinators io.backend kernel math math.order
 namespaces sequences splitting strings system ;
@@ -71,10 +71,17 @@ PRIVATE>
         [ f ]
     } cond ;
 
+: special-path? ( path -- rest ? )
+    {
+        { [ "resource:" ?head ] [ t ] }
+        { [ "vocab:" ?head ] [ t ] }
+        [ f ]
+    } cond ;
+
 : absolute-path? ( path -- ? )
     {
         { [ dup empty? ] [ f ] }
-        { [ dup "resource:" head? ] [ t ] }
+        { [ dup special-path? nip ] [ t ] }
         { [ os windows? ] [ windows-absolute-path? ] }
         { [ dup first path-separator? ] [ t ] }
         [ f ]
@@ -107,16 +114,25 @@ PRIVATE>
     dup root-directory? [
         trim-tail-separators
         dup last-path-separator [ 1+ tail ] [
-            drop "resource:" ?head [ file-name ] when
+            drop special-path? [ file-name ] when
         ] if
     ] unless ;
 
 : file-extension ( filename -- extension )
-    "." split1-last nip ;
+    file-name "." split1-last nip ;
+
+: path-components ( path -- seq )
+    normalize-path path-separator split harvest ;
+
+HOOK: canonicalize-path os ( path -- path' )
+
+M: object canonicalize-path normalize-path ;
 
 : resource-path ( path -- newpath )
     "resource-path" get prepend-path ;
 
+GENERIC: vocab-path ( path -- newpath )
+
 GENERIC: (normalize-path) ( path -- path' )
 
 M: string (normalize-path)
@@ -124,7 +140,12 @@ M: string (normalize-path)
         trim-head-separators resource-path
         (normalize-path)
     ] [
-        current-directory get prepend-path
+        "vocab:" ?head [
+            trim-head-separators vocab-path
+            (normalize-path)
+        ] [
+            current-directory get prepend-path
+        ] if
     ] if ;
 
 M: object normalize-path ( path -- path' )
diff --git a/core/io/streams/null/null-tests.factor b/core/io/streams/null/null-tests.factor
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/core/io/streams/null/summary.txt b/core/io/streams/null/summary.txt
new file mode 100644 (file)
index 0000000..68a403b
--- /dev/null
@@ -0,0 +1 @@
+Dummy implementation of stream protocol
index 5a649120a02962625aac1d4bbc1a842c15a9c6e1..6bd3e9b094cd1489176021ecd970993c141dba9e 100644 (file)
@@ -91,6 +91,8 @@ unit-test
 [ f ] [ BIN: -1101 >bignum 3 bit? ] unit-test
 [ t ] [ BIN: -1101 >bignum 4 bit? ] unit-test
 
+[ t ] [ 1067811677921310779 >bignum 59 bit? ] unit-test
+
 [ 2 ] [ 0 next-power-of-2 ] unit-test
 [ 2 ] [ 1 next-power-of-2 ] unit-test
 [ 2 ] [ 2 next-power-of-2 ] unit-test
diff --git a/core/math/order/summary.txt b/core/math/order/summary.txt
new file mode 100644 (file)
index 0000000..3781910
--- /dev/null
@@ -0,0 +1 @@
+Generic protocol for totally-ordered objects
index 2870be9a4f5a798337b34448c3e644f8ce66fe46..3fcf48941340b62a3231d214e86c980ae99cdde9 100644 (file)
@@ -402,7 +402,7 @@ IN: parser.tests
     [ t ] [ "foo" "parser.tests" lookup symbol? ] unit-test
 ] times
 
-[ "resource:core/parser/test/assert-depth.factor" run-file ]
+[ "vocab:parser/test/assert-depth.factor" run-file ]
 [ got>> { 1 2 3 } sequence= ]
 must-fail-with
 
index f5a06b8beb822c38c8f923dab526562065a92718..43168f47a86f359f27831741b97647fb9280d6c8 100644 (file)
@@ -3,11 +3,9 @@ help.syntax kernel vectors ;
 IN: sbufs
 
 ARTICLE: "sbufs" "String buffers"
-"A string buffer is a resizable mutable sequence of characters. The literal syntax is covered in " { $link "syntax-sbufs" } "."
+"The " { $vocab-link "sbufs" } " vocabulary implements resizable mutable sequence of characters. The literal syntax is covered in " { $link "syntax-sbufs" } "."
 $nl
-"String buffers can be used to construct new strings by accumilating substrings and characters, however usually they are only used indirectly, since the sequence construction words are more convenient to use in most cases (see " { $link "namespaces-make" } ")."
-$nl
-"String buffer words are found in the " { $vocab-link "sbufs" } " vocabulary."
+"String buffers implement the " { $link "sequence-protocol" } " and thus all " { $link "sequences" } " can be used with them. String buffers can be used to construct new strings by accumilating substrings and characters, however usually they are only used indirectly, since the sequence construction words are more convenient to use in most cases (see " { $link "namespaces-make" } ")."
 $nl
 "String buffers form a class of objects:"
 { $subsection sbuf }
index 6ca782a2025d5cbaf419d6a28d9980e46875b9f5..c12761ab38cdbe01feb1c359a1c2284946f66a59 100755 (executable)
@@ -247,12 +247,12 @@ HELP: array-capacity
 HELP: array-nth
 { $values { "n" "a non-negative fixnum" } { "array" "an array" }  { "elt" object } }
 { $description "Low-level array element accessor." }
-{ $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory." } ;
+{ $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory. User code must use " { $link nth } " instead." } ;
 
 HELP: set-array-nth
 { $values { "elt" object } { "n" "a non-negative fixnum" } { "array" "an array" }  }
 { $description "Low-level array element mutator." }
-{ $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory." } ;
+{ $warning "This word is in the " { $vocab-link "sequences.private" } " vocabulary because it is unsafe. It does not check types or array bounds, and improper use can corrupt memory. User code must use " { $link set-nth } " instead." } ;
 
 HELP: collect
 { $values { "n" "a non-negative integer" } { "quot" { $quotation "( n -- value )" } } { "into" "a sequence of length at least " { $snippet "n" } } }
index 42d711b32ba66957d114e76b2aedcc5a59c9c58a..3ab2d731fe756759e305e10a908d1674eb291abf 100644 (file)
@@ -1 +1,2 @@
 collections
+text
diff --git a/core/strings/parser/summary.txt b/core/strings/parser/summary.txt
new file mode 100644 (file)
index 0000000..b479758
--- /dev/null
@@ -0,0 +1 @@
+Parsing strings
index 9a1671b12633285ecd2cf403a8de231a385e0b71..c5ca2b129f7f1befe266373d39b2af35fd9cc3a9 100644 (file)
@@ -1,32 +1,25 @@
 USING: arrays byte-arrays help.markup help.syntax
 kernel kernel.private strings.private sequences vectors
-sbufs math ;
+sbufs math tools.vocabs.browser ;
 IN: strings
 
 ARTICLE: "strings" "Strings"
-"A string is a fixed-size mutable sequence of Unicode 5.1 code points."
+"The " { $vocab-link "strings" } " vocabulary implements fixed-size mutable sequences of of Unicode 5.1 code points."
 $nl
-"Characters are not a first-class type; they are simply represented as integers between 0 and 16777216 (2^24). Only characters up to 2097152 (2^21) have a defined meaning in Unicode."
+"Code points, or characters as they're informally known, are not a first-class type; they are simply represented as integers in the range 0 and 16,777,216 (2^24), inclusive. Only characters up to 2,097,152 (2^21) have a defined meaning in Unicode."
 $nl
 "String literal syntax is covered in " { $link "syntax-strings" } "."
 $nl
-"String words are found in the " { $vocab-link "strings" } " vocabulary."
+"Since strings implement the " { $link "sequence-protocol" } ", basic string manipulation can be performed with " { $link "sequences" } " in the " { $vocab-link "sequences" } " vocabulary. More text processing functionality can be found in vocabularies carrying the " { $link T{ vocab-tag { name "text" } } } " tag."
 $nl
 "Strings form a class:"
 { $subsection string }
 { $subsection string? }
-"Creating strings:"
+"Creating new strings:"
 { $subsection >string }
 { $subsection <string> }
 "Creating a string from a single character:"
-{ $subsection 1string }
-"Since strings are sequences, basic string manipulation can be performed using sequence operations (" { $link "sequences" } "). More advanced functionality can be found in other vocabularies, including but not limited to:"
-{ $list
-    { { $link "ascii" } " - ASCII algorithms for interoperability with legacy applications" }
-    { { $link "unicode" } " - Unicode algorithms for modern multilingual applications" }
-    { { $vocab-link "regexp" } " - regular expressions" }
-    { { $vocab-link "peg" } " - parser expression grammars" }
-} ;
+{ $subsection 1string } ;
 
 ABOUT: "strings"
 
index 414f0cac74599eb86f5be56ab47ff4ee5566bfc2..58bf255369ead050c6143efb53fd301afda175ac 100644 (file)
@@ -1 +1 @@
-OS and CPU queries, environment variables, paths
+OS and CPU queries and other system-level tasks
index 2af130049856d3011067d57dd64c4d841eff2926..fe40a27182b9d1649f0f29aee98ecfc44cc93350 100644 (file)
@@ -4,17 +4,23 @@ vectors.private combinators ;
 IN: vectors
 
 ARTICLE: "vectors" "Vectors"
-"A vector is a resizable mutable sequence of objects. The literal syntax is covered in " { $link "syntax-vectors" } ". Vector words are found in the " { $vocab-link "vectors" } " vocabulary."
+"The " { $vocab-link "vectors" } " vocabulary implements resizable mutable sequence which support the " { $link "sequence-protocol" } "."
 $nl
-"Vectors form a class:"
+"The " { $vocab-link "vectors" } " vocabulary only includes words for creating new vectors. To access and modify vector elements, use " { $link "sequences" } " in the " { $vocab-link "sequences" } " vocabulary."
+$nl
+"Vector literal syntax is documented in " { $link "syntax-vectors" } "."
+$nl
+"Vectors are intended to be used with " { $link "sequences-destructive" } ". Code that does not modify sequences in-place can use fixed-size arrays without loss of generality; see " { $link "arrays" } "."
+$nl
+"Vectors form a class of objects:"
 { $subsection vector }
 { $subsection vector? }
-"Creating vectors:"
+"Creating new vectors:"
 { $subsection >vector }
 { $subsection <vector> }
 "Creating a vector from a single element:"
 { $subsection 1vector }
-"If you don't care about initial capacity, a more elegant way to create a new vector is to write:"
+"If you don't care about initial capacity, an elegant way to create a new vector is to write:"
 { $code "V{ } clone" } ;
 
 ABOUT: "vectors"
index ce3b5ea024154940291a1fa8b636ae4731c96ec6..527da053fbbaf0b91dab00f61afcd58e252d8ce9 100644 (file)
@@ -34,13 +34,20 @@ $nl
 { $subsection "vocabs.roots" }
 "Vocabulary names map directly to source files. A vocabulary named " { $snippet "foo.bar" } " must be defined in a " { $snippet "bar" } " directory nested inside a " { $snippet "foo" } " directory of a vocabulary root. Any level of vocabulary nesting is permitted."
 $nl
-"The vocabulary directory - " { $snippet "bar" } " in our example - can contain the following files; the first is required while the rest are optional:"
+"The vocabulary directory - " { $snippet "bar" } " in our example - contains a source file:"
+{ $list
+  { { $snippet "foo/bar/bar.factor" } " - the source file, must define words in the " { $snippet "foo.bar" } " vocabulary with an " { $snippet "IN: foo.bar" } " form" }
+}
+"Two other Factor source files, storing documentation and tests, respectively, are optional:"
 { $list
-    { { $snippet "foo/bar/bar.factor" } " - the source file, defines words in the " { $snippet "foo.bar" } " vocabulary" }
     { { $snippet "foo/bar/bar-docs.factor" } " - documentation, see " { $link "writing-help" } }
     { { $snippet "foo/bar/bar-tests.factor" } " - unit tests, see " { $link "tools.test" } }
+}
+"Finally, three text files can contain meta-data:"
+{ $list
+    { { $snippet "foo/bar/authors.txt" } " - a series of lines, with one author name per line. These are listed under " { $link "vocab-authors" } }
     { { $snippet "foo/bar/summary.txt" } " - a one-line description" }
-    { { $snippet "foo/bar/tags.txt" } " - a whitespace-separated list of tags which classify the vocabulary" }
+    { { $snippet "foo/bar/tags.txt" } " - a whitespace-separated list of tags which classify the vocabulary. Consult " { $link "vocab-tags" } " for a list of existing tags you can re-use" }
 }
 "While " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } " load vocabularies which have not been loaded before adding them to the search path, it is also possible to load a vocabulary without adding it to the search path:"
 { $subsection require }
index 48e8737fd25f0edbddfbec2e051d86c3347da400..00c4df92a63ab88e07a07c9cc24a60920691cb89 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Eduardo Cavazos, Slava Pestov.
+! Copyright (C) 2007, 2009 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: namespaces make sequences io io.files io.pathnames kernel
 assocs words vocabs definitions parser continuations hashtables
@@ -18,33 +18,33 @@ V{
 : add-vocab-root ( root -- )
     vocab-roots get adjoin ;
 
-: vocab-dir ( vocab -- dir )
-    vocab-name { { CHAR: . CHAR: / } } substitute ;
-
-: vocab-dir+ ( vocab str/f -- path )
-    [ vocab-name "." split ] dip
-    [ [ dup peek ] dip append suffix ] when*
-    "/" join ;
-
-: vocab-dir? ( root name -- ? )
-    over
-    [ ".factor" vocab-dir+ append-path exists? ]
-    [ 2drop f ]
-    if ;
-
 SYMBOL: root-cache
 
-H{ } clone root-cache set-global
+root-cache [ H{ } clone ] initialize
+
+ERROR: not-found-in-roots path ;
 
 <PRIVATE
 
-: (find-vocab-root) ( name -- path/f )
-    vocab-roots get swap [ vocab-dir? ] curry find nip ;
+: find-root-for ( path -- path/f )
+    vocab-roots get [ prepend-path exists? ] with find nip ;
+
+M: string vocab-path ( string -- path/f )
+    dup find-root-for [ prepend-path ] [ not-found-in-roots ] if* ;
 
 PRIVATE>
 
+: vocab-dir ( vocab -- dir )
+    vocab-name { { CHAR: . CHAR: / } } substitute ;
+
+: vocab-dir+ ( vocab str/f -- path )
+    [ vocab-name "." split ] dip
+    [ [ dup peek ] dip append suffix ] when*
+    "/" join ;
+
 : find-vocab-root ( vocab -- path/f )
-    vocab-name dup root-cache get at [ ] [ (find-vocab-root) ] ?if ;
+    vocab-name dup root-cache get at
+    [ ] [ ".factor" vocab-dir+ find-root-for ] ?if ;
 
 : vocab-append-path ( vocab path -- newpath )
     swap find-vocab-root dup [ prepend-path ] [ 2drop f ] if ;
@@ -104,14 +104,14 @@ SYMBOL: blacklist
 : add-to-blacklist ( error vocab -- )
     vocab-name blacklist get dup [ set-at ] [ 3drop ] if ;
 
-GENERIC: (load-vocab) ( name -- )
+GENERIC: (load-vocab) ( name -- vocab )
 
 M: vocab (load-vocab)
     [
         dup source-loaded?>> +parsing+ eq? [
             dup source-loaded?>> [ dup load-source ] unless
             dup docs-loaded?>> [ dup load-docs ] unless
-        ] unless drop
+        ] unless
     ] [ [ swap add-to-blacklist ] keep rethrow ] recover ;
 
 M: vocab-link (load-vocab)
@@ -120,22 +120,15 @@ M: vocab-link (load-vocab)
 M: string (load-vocab)
     create-vocab (load-vocab) ;
 
-[
-    [
-        dup vocab-name blacklist get at* [ rethrow ] [
-            drop dup find-vocab-root
-            [ [ (load-vocab) ] with-compiler-errors ]
-            [ dup vocab [ drop ] [ no-vocab ] if ]
-            if
-        ] if
-    ] with-compiler-errors
-] load-vocab-hook set-global
-
 PRIVATE>
 
-: vocab-where ( vocab -- loc )
-    vocab-source-path dup [ 1 2array ] when ;
-
-M: vocab where vocab-where ;
+[
+    dup vocab-name blacklist get at* [ rethrow ] [
+        drop dup find-vocab-root
+        [ [ (load-vocab) ] with-compiler-errors ]
+        [ dup vocab [ ] [ no-vocab ] ?if ]
+        if
+    ] if
+] load-vocab-hook set-global
 
-M: vocab-link where vocab-where ;
+M: vocab-spec where vocab-source-path dup [ 1 2array ] when ;
diff --git a/core/vocabs/parser/summary.txt b/core/vocabs/parser/summary.txt
new file mode 100644 (file)
index 0000000..2741539
--- /dev/null
@@ -0,0 +1 @@
+Utilities for parsing and defining words
index fb9ce5467239a21e5d2672832bfc176e63846ce0..977eac2b35950846616337b3e498324813484a50 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Eduardo Cavazos, Slava Pestov.
+! Copyright (C) 2007, 2009 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs strings kernel sorting namespaces
 sequences definitions ;
@@ -21,18 +21,26 @@ SYMBOL: +done+
         swap >>name
         H{ } clone >>words ;
 
-GENERIC: vocab-name ( vocab-spec -- name )
+TUPLE: vocab-link name ;
 
-GENERIC: vocab ( vocab-spec -- vocab )
+C: <vocab-link> vocab-link
 
-M: vocab vocab ;
+UNION: vocab-spec vocab vocab-link ;
 
-M: object vocab ( name -- vocab ) vocab-name dictionary get at ;
+GENERIC: vocab-name ( vocab-spec -- name )
 
 M: vocab vocab-name name>> ;
 
+M: vocab-link vocab-name name>> ;
+
 M: string vocab-name ;
 
+GENERIC: vocab ( vocab-spec -- vocab )
+
+M: vocab vocab ;
+
+M: object vocab ( name -- vocab ) vocab-name dictionary get at ;
+
 GENERIC: vocab-words ( vocab-spec -- words )
 
 M: vocab vocab-words words>> ;
@@ -62,11 +70,6 @@ M: f vocab-main ;
 
 ERROR: no-vocab name ;
 
-SYMBOL: load-vocab-hook ! ( name -- )
-
-: load-vocab ( name -- vocab )
-    dup load-vocab-hook get call vocab ;
-
 : vocabs ( -- seq )
     dictionary get keys natural-sort ;
 
@@ -88,17 +91,6 @@ SYMBOL: load-vocab-hook ! ( name -- )
 : child-vocabs ( vocab -- seq )
     vocab-name vocabs [ child-vocab? ] with filter ;
 
-TUPLE: vocab-link name ;
-
-: <vocab-link> ( name -- vocab-link )
-    vocab-link boa ;
-
-M: vocab-link hashcode* name>> hashcode* ;
-
-M: vocab-link vocab-name name>> ;
-
-UNION: vocab-spec vocab vocab-link ;
-
 GENERIC: >vocab-link ( name -- vocab )
 
 M: vocab-spec >vocab-link ;
@@ -110,3 +102,7 @@ M: string >vocab-link dup vocab [ ] [ <vocab-link> ] ?if ;
     vocab-name dictionary get delete-at ;
 
 M: vocab-spec forget* forget-vocab ;
+
+SYMBOL: load-vocab-hook ! ( name -- vocab )
+
+: load-vocab ( name -- vocab ) load-vocab-hook get call ;
\ No newline at end of file
diff --git a/core/words/constant/summary.txt b/core/words/constant/summary.txt
new file mode 100644 (file)
index 0000000..42aa832
--- /dev/null
@@ -0,0 +1 @@
+Implementation of constant words
diff --git a/core/words/symbol/summary.txt b/core/words/symbol/summary.txt
new file mode 100644 (file)
index 0000000..890cbde
--- /dev/null
@@ -0,0 +1 @@
+Implementation of symbol words
index 4dfa2d49bcd947e316f2890a4d21a05813318332..f5990c295e5f19b1662d7bf44564d1f2c78f2771 100644 (file)
@@ -288,12 +288,12 @@ HELP: define-declared
 { $side-effects "word" } ;
 
 HELP: define-temp
-{ $values { "quot" quotation } { "word" word } }
+{ $values { "quot" quotation } { "effect" effect } { "word" word } }
 { $description "Creates an uninterned word that will call " { $snippet "quot" } " when executed." }
 { $notes
     "The following phrases are equivalent:"
     { $code "[ 2 2 + . ] call" }
-    { $code "[ 2 2 + . ] define-temp execute" }
+    { $code "[ 2 2 + . ] (( -- )) define-temp execute" }
     "This word must be called from inside " { $link with-compilation-unit } "."
 } ;
 
index 86486640316d2e39abaf7c80ff73779fce26c3f4..43a391e46a1968701b0583d0256f3598bfd96fcd 100755 (executable)
@@ -134,7 +134,7 @@ compiled-generic-crossref [ H{ } clone ] initialize
 
 SYMBOL: visited
 
-: reset-on-redefine { "inferred-effect" "cannot-infer" } ; inline
+CONSTANT: reset-on-redefine { "inferred-effect" "cannot-infer" }
 
 : (redefined) ( word -- )
     dup visited get key? [ drop ] [
@@ -212,8 +212,8 @@ M: word subwords drop f ;
 : gensym ( -- word )
     "( gensym )" f <word> ;
 
-: define-temp ( quot -- word )
-    [ gensym dup ] dip define ;
+: define-temp ( quot effect -- word )
+    [ gensym dup ] 2dip define-declared ;
 
 : reveal ( word -- )
     dup [ name>> ] [ vocabulary>> ] bi dup vocab-words
index f842d5f4cb4a2ea32a985eb125e6d888b1a5329e..f22ca001f47e91a10ef7c8007d1f6a498d776cc3 100644 (file)
@@ -7,7 +7,7 @@ arrays words quotations accessors math.parser backtrack assocs ;
 
 IN: 24-game
 SYMBOL: commands
-: nop ;
+: nop ( -- ) ;
 : do-something ( a b -- c ) { + - * } amb-execute ;
 : maybe-swap ( a b -- a b ) { nop swap } amb-execute ;
 : some-rots ( a b c -- a b c )
index 0121dce32bae629cb03f824f1b1c810f83d9a69c..5b540e7a7f5d2321173c65c21600a5ce65be4665 100755 (executable)
@@ -1,4 +1,4 @@
-! Copyright (C) 2008 Your name.
+! Copyright (C) 2008 Jeff Bigot.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays help.markup help.syntax kernel sequences ;
 IN: adsoda.combinators
index c340554119e4020ccda9d349888cfd62e6b2ebbc..1bece9d4fbd5698e5c947da2cdfd71aee28fa8fb 100644 (file)
@@ -1,6 +1,6 @@
 USING: accessors arrays combinators definitions generalizations
 help help.markup help.topics kernel sequences sorting vocabs
-words ;
+words combinators.smart ;
 IN: annotations
 
 <PRIVATE
@@ -9,6 +9,40 @@ IN: annotations
 : comment-usage.-word ( base -- word ) "s." append "annotations" lookup ; 
 PRIVATE>
 
+: $annotation ( element -- )
+    first
+    [ "!" " your comment here" surround 1array $syntax ]
+    [ [ "Treats the rest of the line after the exclamation point as a code annotation that can be looked up with the " \ $link ] dip comment-usage.-word 2array " word." 3array $description ]
+    [ ": foo ( x y z -- w )\n    !" " --w-ó()ò-w-- kilroy was here\n    + * ;" surround 1array $code ]
+    tri ;
+
+: <$annotation> ( word -- element )
+    \ $annotation swap 2array 1array ;
+
+: $annotation-usage. ( element -- )
+    first
+    [ "Displays a list of words, help articles, and vocabularies that contain " \ $link ] dip comment-word 2array " annotations." 3array $description ;
+
+: <$annotation-usage.> ( word -- element )
+    \ $annotation-usage. swap 2array 1array ;
+
+: $annotation-usage ( element -- )
+    first [
+        [ "Returns a list of words, help articles, and vocabularies that contain " ] dip
+        [
+            comment-word <$link>
+            " annotations. For a more user-friendly display, use the "
+        ] [
+            comment-usage.-word <$link>
+            " word."
+        ] bi
+    ] output>array $description ;
+
+: <$annotation-usage> ( word -- element )
+    [ { $values { "usages" sequence } } ] dip
+    \ $annotation-usage swap 2array
+    2array ;
+
 "Code annotations"
 {
     "The " { $vocab-link "annotations" } " vocabulary provides syntax for comment-like annotations that can be looked up with Factor's " { $link usage } " mechanism."
@@ -26,17 +60,9 @@ annotation-tags natural-sort
 
 annotation-tags [
     {
-        [ [ \ $syntax ] dip "!" " your comment here" surround 2array ]
-        [ [ \ $description "Treats the rest of the line after the exclamation point as a code annotation that can be looked up with the " \ $link ] dip comment-usage.-word 2array " word." 4array ]
-        [ [ \ $unchecked-example ] dip ": foo ( x y z -- w )\n    !" " --w-ó()ò-w-- kilroy was here\n    + * ;" surround 2array 3array ]
-        [ comment-word set-word-help ]
-
-        [ [ \ $description "Displays a list of words, help articles, and vocabularies that contain " \ $link ] dip comment-word 2array " annotations." 4array 1array ]
-        [ comment-usage.-word set-word-help ]
-
-        [ [ { $values { "usages" sequence } } \ $description "Returns a list of words, help articles, and vocabularies that contain " \ $link ] dip [ comment-word 2array " annotations. For a more user-friendly display, use the " \ $link ] [ comment-usage.-word 2array " word." 6 narray 2array ] bi ]
-        [ comment-usage-word set-word-help ]
-
+        [ [ <$annotation> ] [ comment-word set-word-help ] bi ]
+        [ [ <$annotation-usage> ] [ comment-usage-word set-word-help ] bi ]
+        [ [ <$annotation-usage.> ] [ comment-usage.-word set-word-help ] bi ]
         [ [ comment-word ] [ comment-usage-word ] [ comment-usage.-word ] tri 3array related-words ]
     } cleave
 ] each
index 8e93b140bf88cd989b91af9b9cbea5cfbd32bcae..449c9dcbd0d85475930cadec8e3a88b9cee7fd5a 100644 (file)
@@ -3,9 +3,9 @@
 
 IN: asn1.ldap
 
-: SearchScope_BaseObject      0 ; inline
-: SearchScope_SingleLevel     1 ; inline
-: SearchScope_WholeSubtree    2 ; inline
+CONSTANT: SearchScope_BaseObject      0
+CONSTANT: SearchScope_SingleLevel     1
+CONSTANT: SearchScope_WholeSubtree    2
 
 : asn-syntax ( -- hashtable )
     H{
index df67872b1143ac8afc75cc2aa81356bcd94382c2..0ae7d792dd8dd27035d225df3d83cd80ca19a355 100755 (executable)
@@ -10,7 +10,7 @@ IN: benchmark.backtrack
 ! placing them on the stack, and applying the operations
 ! +, -, * and rot as many times as we wish.
 
-: nop ;
+: nop ( -- ) ;
 
 : do-something ( a b -- c )
     { + - * } amb-execute ;
@@ -42,7 +42,7 @@ MEMO: 24-from-4 ( a b c d -- ? )
         ] sigma
     ] sigma ;
 
-: words { 24-from-1 24-from-2 24-from-3 24-from-4 } ;
+CONSTANT: words { 24-from-1 24-from-2 24-from-3 24-from-4 }
 
 : backtrack-benchmark ( -- )
     words [ reset-memoized ] each
index 8e3918656a42c14614c62c6cedef05a4e0845515..21ff7fbbef048c2da6bce9988ade3b8806e49405 100644 (file)
@@ -23,7 +23,7 @@ M: tree-node item-check
 
 M: f item-check drop 0 ;
 
-: min-depth 4 ; inline
+CONSTANT: min-depth 4
 
 : stretch-tree ( max-depth -- )
     1 + 0 over bottom-up-tree item-check
index 2fea4eb1f198062a23bf50dc5c995f7fa002e0df..03d1585574bc5b23165c313d181d8a03547177f6 100755 (executable)
@@ -3,7 +3,7 @@ IN: benchmark.crc32
 
 : crc32-file ( -- )
     10 [
-        "resource:basis/mime/multipart/multipart-tests.factor"
+        "vocab:mime/multipart/multipart-tests.factor"
         crc32 checksum-file drop
     ] times ;
 
index 32d35349202f52c98c8744208103ca8395839379..2ae5ada8a1ca5afe9bdcce1e7b8384e419613219 100755 (executable)
@@ -4,22 +4,20 @@ sequences.private benchmark.reverse-complement hints io.encodings.ascii
 byte-arrays specialized-arrays.double ;
 IN: benchmark.fasta
 
-: IM 139968 ; inline
-: IA 3877 ; inline
-: IC 29573 ; inline
-: initial-seed 42 ; inline
-: line-length 60 ; inline
-
-USE: math.private
+CONSTANT: IM 139968
+CONSTANT: IA 3877
+CONSTANT: IC 29573
+CONSTANT: initial-seed 42
+CONSTANT: line-length 60
 
 : random ( seed -- n seed )
     >float IA * IC + IM mod [ IM /f ] keep ; inline
 
 HINTS: random fixnum ;
 
-: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA" ; inline
+CONSTANT: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
 
-: IUB
+CONSTANT: IUB
     {
         { CHAR: a 0.27 }
         { CHAR: c 0.12 }
@@ -37,15 +35,15 @@ HINTS: random fixnum ;
         { CHAR: V 0.02 }
         { CHAR: W 0.02 }
         { CHAR: Y 0.02 }
-    } ; inline
+    }
 
-: homo-sapiens
+CONSTANT: homo-sapiens
     {
         { CHAR: a 0.3029549426680 }
         { CHAR: c 0.1979883004921 }
         { CHAR: g 0.1975473066391 }
         { CHAR: t 0.3015094502008 }
-    } ; inline
+    }
 
 : make-cumulative ( freq -- chars floats )
     dup keys >byte-array
index edc848a0caabde94b9f3959382070980d670af05..9e0f2472e27c4c8563cb51d95c0287ab20bf070b 100644 (file)
@@ -7,8 +7,8 @@ IN: benchmark.mandel.colors
 : scale-rgb ( rgba -- n )
     [ red>> scale ] [ green>> scale ] [ blue>> scale ] tri 3byte-array ;
 
-: sat 0.85 ; inline
-: val 0.85 ; inline
+CONSTANT: sat 0.85
+CONSTANT: val 0.85
 
 : <color-map> ( nb-cols -- map )
     dup [
index c40d3c1f2d009863cad01c9139705ee5207b22c3..8a19180d733563fbfa5a06d8a82fee4b0a8dc893 100644 (file)
@@ -1,8 +1,8 @@
 IN: benchmark.mandel.params
 
-: max-color       360   ; inline
-: zoom-fact       0.8   ; inline
-: width           640   ; inline
-: height          480   ; inline
-: max-iterations  40    ; inline
-: center         -0.65  ; inline
+CONSTANT: max-color       360  
+CONSTANT: zoom-fact       0.8  
+CONSTANT: width           640  
+CONSTANT: height          480  
+CONSTANT: max-iterations  40   
+CONSTANT: center         -0.65 
index 24578ec677a799c8760155ddb921967ed50de0c7..5030cb69041bcc6a8a6db58386c5d590448fe6b2 100644 (file)
@@ -2,6 +2,6 @@ USING: checksums checksums.md5 io.files kernel ;
 IN: benchmark.md5
 
 : md5-file ( -- )
-    "resource:basis/mime/multipart/multipart-tests.factor" md5 checksum-file drop ;
+    "vocab:mime/multipart/multipart-tests.factor" md5 checksum-file drop ;
 
 MAIN: md5-file
index 37c4fc43c5a8cc5892b760b881832f10572e6356..f72ceb46297301bfe24e933a6d0f89e11b2491c6 100644 (file)
@@ -6,7 +6,7 @@ sequences hints arrays ;
 IN: benchmark.nbody
 
 : solar-mass ( -- x ) 4 pi sq * ; inline
-: days-per-year 365.24 ; inline
+CONSTANT: days-per-year 365.24
 
 TUPLE: body
 { location double-array }
index c16e47846efb16c13f719e8e49d3b1ea4ad850e3..a4df1fe04dd992a706ce11e684571c419247205a 100755 (executable)
@@ -8,21 +8,22 @@ hints ;
 IN: benchmark.raytracer
 
 ! parameters
-: light
-    #! Normalized { -1 -3 2 }.
+
+! Normalized { -1 -3 2 }.
+CONSTANT: light
     double-array{
         -0.2672612419124244
         -0.8017837257372732
         0.5345224838248488
-    } ; inline
+    }
 
-: oversampling 4 ; inline
+CONSTANT: oversampling 4
 
-: levels 3 ; inline
+CONSTANT: levels 3
 
-: size 200 ; inline
+CONSTANT: size 200
 
-: delta 1.4901161193847656E-8 ; inline
+CONSTANT: delta 1.4901161193847656E-8
 
 TUPLE: ray { orig double-array read-only } { dir double-array read-only } ;
 
@@ -88,7 +89,7 @@ TUPLE: group < sphere { objs array read-only } ;
 M: group intersect-scene ( hit ray group -- hit )
     [ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ;
 
-: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. } ; inline
+CONSTANT: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. }
 
 : initial-intersect ( ray scene -- hit )
     [ initial-hit ] 2dip intersect-scene ; inline
index 585368e836b2190d68d9d4feea5d48dfb386e7a6..8e19ba9a8fd8e2d8c26f93eab19db4ed5fa00b31 100644 (file)
@@ -2,6 +2,6 @@ USING: checksums checksums.sha1 io.files kernel ;
 IN: benchmark.sha1
 
 : sha1-file ( -- )
-    "resource:basis/mime/multipart/multipart-tests.factor" sha1 checksum-file drop ;
+    "vocab:mime/multipart/multipart-tests.factor" sha1 checksum-file drop ;
 
 MAIN: sha1-file
index 20c905156bbe313fa8846a62b0ac7720156ae00d..d6e4f29b86e2175d5c27705819d3d4743a082955 100755 (executable)
@@ -10,7 +10,7 @@ SYMBOL: counter
 SYMBOL: port-promise
 SYMBOL: server
 
-: number-of-requests 1000 ;
+CONSTANT: number-of-requests 1000
 
 : server-addr ( -- addr )
     "127.0.0.1" port-promise get ?promise <inet4> ;
index a32a98a13308e0d2a0aa0f30ba47026e562c379f..0450331ddfbfc56754804c0ff6d8c5a0a700cec4 100644 (file)
@@ -5,8 +5,8 @@ sequences xml ;
 IN: benchmark.xml
 
 : xml-benchmark ( -- )
-    "resource:basis/xmode/modes/" [
-        [ utf8 <file-reader> read-xml drop ] each
+    "vocab:xmode/modes/" [
+        [ file>xml drop ] each
     ] with-directory-files ;
 
 MAIN: xml-benchmark
index cec6702ce06238959f60514e0b65d68227a8a988..da744e1d530193c468f596b44a38345e366a0a90 100644 (file)
@@ -6,68 +6,80 @@
 !  http://cairographics.org/samples/text/
 
 
-USING: cairo.ffi math math.constants byte-arrays kernel ui ui.render
-           ui.gadgets opengl.gl accessors ;
+USING: cairo.ffi math math.constants byte-arrays kernel ui
+ui.render combinators ui.gadgets opengl.gl accessors
+namespaces opengl ;
 
 IN: cairo-demo
 
-
 : make-image-array ( -- array )
-  384 256 4 * * <byte-array> ;
+    384 256 4 * * <byte-array> ;
 
 : convert-array-to-surface ( array -- cairo_surface_t )
-  CAIRO_FORMAT_ARGB32 384 256 over 4 *
-  cairo_image_surface_create_for_data ;
-
+    CAIRO_FORMAT_ARGB32 384 256 over 4 *
+    cairo_image_surface_create_for_data ;
 
 TUPLE: cairo-demo-gadget < gadget image-array cairo-t ;
 
 M: cairo-demo-gadget draw-gadget* ( gadget -- )
-    0 0 glRasterPos2i
-    1.0 -1.0 glPixelZoom
-    [ 384 256 GL_RGBA GL_UNSIGNED_BYTE ] dip
-    image-array>> glDrawPixels ;
+    origin get [
+        0 0 glRasterPos2i
+        1.0 -1.0 glPixelZoom
+        [ 384 256 GL_RGBA GL_UNSIGNED_BYTE ] dip
+        image-array>> glDrawPixels
+    ] with-translation ;
 
 : create-surface ( gadget -- cairo_surface_t )
     make-image-array [ swap (>>image-array) ] keep
     convert-array-to-surface ;
 
 : init-cairo ( gadget -- cairo_t )
-   create-surface cairo_create ;
+    create-surface cairo_create ;
+
+M: cairo-demo-gadget pref-dim* drop { 384 256 } ;
+
+ERROR: no-cairo-t ;
 
-M: cairo-demo-gadget pref-dim* drop { 384 256 0 } ;
+<PRIVATE
 
 : draw-hello-world ( gadget -- )
-  cairo-t>>
-  dup "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_BOLD cairo_select_font_face
-  dup 90.0 cairo_set_font_size
-  dup 10.0 135.0 cairo_move_to
-  dup "Hello" cairo_show_text
-  dup 70.0 165.0 cairo_move_to
-  dup "World" cairo_text_path
-  dup 0.5 0.5 1 cairo_set_source_rgb
-  dup cairo_fill_preserve
-  dup 0 0 0 cairo_set_source_rgb
-  dup 2.56 cairo_set_line_width
-  dup cairo_stroke
-  dup 1 0.2 0.2 0.6 cairo_set_source_rgba
-  dup 10.0 135.0 5.12 0 pi 2 * cairo_arc
-  dup cairo_close_path
-  dup 70.0 165.0 5.12 0 pi 2 * cairo_arc
-  cairo_fill ;
+    cairo-t>> [ no-cairo-t ] unless*
+    {
+        [
+            "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_BOLD
+            cairo_select_font_face
+        ]
+        [ 90.0 cairo_set_font_size ]
+        [ 10.0 135.0 cairo_move_to ]
+        [ "Hello" cairo_show_text ]
+        [ 70.0 165.0 cairo_move_to ]
+        [ "World" cairo_text_path ]
+        [ 0.5 0.5 1 cairo_set_source_rgb ]
+        [ cairo_fill_preserve ]
+        [ 0 0 0 cairo_set_source_rgb ]
+        [ 2.56 cairo_set_line_width ]
+        [ cairo_stroke ]
+        [ 1 0.2 0.2 0.6 cairo_set_source_rgba ]
+        [ 10.0 135.0 5.12 0 pi 2 * cairo_arc ]
+        [ cairo_close_path ]
+        [ 70.0 165.0 5.12 0 pi 2 * cairo_arc ]
+        [ cairo_fill ]
+    } cleave ;
+
+PRIVATE>
 
 M: cairo-demo-gadget graft* ( gadget -- )
-  dup dup init-cairo swap (>>cairo-t) draw-hello-world ;
+    dup dup init-cairo swap (>>cairo-t) draw-hello-world ;
 
 M: cairo-demo-gadget ungraft* ( gadget -- )
-   cairo-t>> cairo_destroy ;
+    cairo-t>> cairo_destroy ;
 
 : <cairo-demo-gadget> ( -- gadget )
-  cairo-demo-gadget new-gadget ;
+    cairo-demo-gadget new-gadget ;
 
 : run ( -- )
-  [
+    [
         <cairo-demo-gadget> "Hello World from Factor!" open-window
-  ] with-ui ;
+    ] with-ui ;
 
 MAIN: run
index cacfc5971a002367f1fa3e4c9e0d0986e3721ee7..0807420266dd2ace7573f7688c7306907fe40452 100644 (file)
@@ -4,7 +4,7 @@ USING: arrays kernel math memoize sequences math.bitwise
 locals ;
 IN: crypto.aes
 
-: AES_BLOCK_SIZE 16 ; inline
+CONSTANT: AES_BLOCK_SIZE 16
 
 : sbox ( -- array )
 {
index e292981876dcd60a9ad6d882183da8398432e436..286a313fda10376b80d77f717b572ab35beebe0f 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel base64 checksums.md5 sequences checksums
-locals prettyprint math math.bitwise grouping io combinators
+locals prettyprint math math.bits grouping io combinators
 fry make combinators.short-circuit math.functions splitting ;
 IN: crypto.passwd-md5
 
@@ -22,8 +22,8 @@ PRIVATE>
                 password length
                 [ 16 / ceiling swap <repetition> concat ] keep
                 head-slice append
-                password [ length ] [ first ] bi
-                '[ [ CHAR: \0 _ ? , ] each-bit ] "" make append
+                password [ length make-bits ] [ first ] bi
+                '[ CHAR: \0 _ ? ] "" map-as append
                 md5 checksum-bytes ] |
         1000 [
             "" swap
index b1eb90754768795da8b18fc4b72d8938121b2bd6..373dd9637c7c811da2a80217218ccad830bc9090 100644 (file)
@@ -18,7 +18,7 @@ C: <rsa> rsa
 
 <PRIVATE
 
-: public-key 65537 ; inline
+CONSTANT: public-key 65537
 
 : rsa-primes ( numbits -- p q )
     2/ 2 unique-primes first2 ;
index f11b26333be1a8f55937b9dd1121cb6a9be89a35..3e466b4781aa6ef1ad798c7192e9f44284391736 100644 (file)
@@ -10,9 +10,9 @@ IN: curses
 SYMBOL: curses-windows
 SYMBOL: current-window
 
-: ERR -1 ; inline
-: FALSE 0 ; inline
-: TRUE 1 ; inline
+CONSTANT: ERR -1
+CONSTANT: FALSE 0
+CONSTANT: TRUE 1
 : >BOOLEAN ( n -- TRUE/FALSE ) >boolean TRUE FALSE ? ; inline
 
 ERROR: duplicate-window window ;
index 8d4a7ddb4bf6a139d097b8c5ad5301ca1590c9f7..b1c481a5769c5333b3ce462ae47c3994f162a250 100644 (file)
@@ -18,7 +18,7 @@ TYPEDEF: chtype attr_t
 TYPEDEF: short NCURSES_SIZE_T
 TYPEDEF: ushort wchar_t
 
-: CCHARW_MAX  5 ; inline
+CONSTANT: CCHARW_MAX  5
 
 C-STRUCT: cchar_t
     { "attr_t" "attr" }
diff --git a/extra/fuel/fuel-tests.factor b/extra/fuel/fuel-tests.factor
deleted file mode 100644 (file)
index 74bc5d4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-! Copyright (C) 2008 Your name.
-! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test fuel ;
-IN: fuel.tests
index 2bf8f1b98d36df37ec124185f2a1592b7c68412e..403708e880884ced3fda8304b37edbc4356312d5 100644 (file)
@@ -99,6 +99,8 @@ PRIVATE>
 
 : fuel-vocab-help ( name -- ) (fuel-vocab-help) fuel-eval-set-result ;
 
+: fuel-word-synopsis ( word usings -- ) (fuel-word-synopsis) fuel-eval-set-result ;
+
 : fuel-vocab-summary ( name -- )
     (fuel-vocab-summary) fuel-eval-set-result ;
 
index 55183734b37ce14132a385b568cb8e2f3f4c7dd2..64d77566b5458fd22bde7a76f4eb04742e7cd7b8 100644 (file)
@@ -90,6 +90,12 @@ PRIVATE>
 : (fuel-word-help) ( name -- elem )
     fuel-find-word [ [ auto-use? on (fuel-word-element) ] with-scope ] [ f ] if* ;
 
+: (fuel-word-synopsis) ( word usings -- str/f )
+    [
+        [ vocab ] filter interactive-vocabs [ append ] change
+        fuel-find-word [ synopsis ] [ f ] if*
+    ] with-scope ;
+
 : (fuel-word-see) ( word -- elem )
     [ name>> \ article swap ]
     [ [ see ] with-string-writer \ $code swap 2array ] bi 3array ; inline
index 259fa446af1a63c9349491067df80b205e0260bb..ccba90fb6f603bcc6b27467c37d308287292d3a2 100644 (file)
@@ -8,7 +8,7 @@ help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 IN: galois-talk
 
-: galois-slides
+CONSTANT: galois-slides
 {
     { $slide "Factor!"
         { $url "http://factorcode.org" }
@@ -305,7 +305,7 @@ IN: galois-talk
         "Factor has many cool things that I didn't talk about"
         "Questions?"
     }
-} ;
+}
 
 : galois-talk ( -- ) galois-slides slides-window ;
 
index 26f2c40464502f1576fa3bb32c8845ab6b4b1f45..254ed61ab0516543c9abe32ee88a5ac409cd6516 100755 (executable)
@@ -21,33 +21,33 @@ iokit-game-input-backend game-input-backend set-global
         [ &CFRelease NSFastEnumeration>vector ] [ f ] if*
     ] with-destructors ;
 
-: game-devices-matching-seq
+CONSTANT: game-devices-matching-seq
     {
         H{ { "DeviceUsage" 4 } { "DeviceUsagePage" 1 } } ! joysticks
         H{ { "DeviceUsage" 5 } { "DeviceUsagePage" 1 } } ! gamepads
         H{ { "DeviceUsage" 6 } { "DeviceUsagePage" 1 } } ! keyboards
-    } ; inline
-
-: buttons-matching-hash
-    H{ { "UsagePage" 9 } { "Type" 2 } } ; inline
-: keys-matching-hash
-    H{ { "UsagePage" 7 } { "Type" 2 } } ; inline
-: x-axis-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 30 } { "Type" 1 } } ; inline
-: y-axis-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 31 } { "Type" 1 } } ; inline
-: z-axis-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 32 } { "Type" 1 } } ; inline
-: rx-axis-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 33 } { "Type" 1 } } ; inline
-: ry-axis-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 34 } { "Type" 1 } } ; inline
-: rz-axis-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 35 } { "Type" 1 } } ; inline
-: slider-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 36 } { "Type" 1 } } ; inline
-: hat-switch-matching-hash
-    H{ { "UsagePage" 1 } { "Usage" HEX: 39 } { "Type" 1 } } ; inline
+    }
+
+CONSTANT: buttons-matching-hash
+    H{ { "UsagePage" 9 } { "Type" 2 } }
+CONSTANT: keys-matching-hash
+    H{ { "UsagePage" 7 } { "Type" 2 } }
+CONSTANT: x-axis-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 30 } { "Type" 1 } }
+CONSTANT: y-axis-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 31 } { "Type" 1 } }
+CONSTANT: z-axis-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 32 } { "Type" 1 } }
+CONSTANT: rx-axis-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 33 } { "Type" 1 } }
+CONSTANT: ry-axis-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 34 } { "Type" 1 } }
+CONSTANT: rz-axis-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 35 } { "Type" 1 } }
+CONSTANT: slider-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 36 } { "Type" 1 } }
+CONSTANT: hat-switch-matching-hash
+    H{ { "UsagePage" 1 } { "Usage" HEX: 39 } { "Type" 1 } }
 
 : device-elements-matching ( device matching-hash -- vector )
     [
@@ -121,12 +121,12 @@ iokit-game-input-backend game-input-backend set-global
 : hat-switch? ( {usage-page,usage} -- ? )
     { 1 HEX: 39 } = ; inline
 
-: pov-values
+CONSTANT: pov-values
     {
         pov-up pov-up-right pov-right pov-down-right
         pov-down pov-down-left pov-left pov-up-left
         pov-neutral
-    } ; inline
+    }
 
 : button-value ( value -- f/(0,1] )
     IOHIDValueGetIntegerValue dup zero? [ drop f ] when ;
index 7b0e39ee9b94b178a484511c3a677516dd3219f0..3303a51c6fd5106944104ade2f0dbccc8a5105cf 100644 (file)
 IN: game-input.scancodes
 
-: key-undefined HEX: 0000 ; inline
-: key-error-roll-over HEX: 0001 ; inline
-: key-error-post-fail HEX: 0002 ; inline
-: key-error-undefined HEX: 0003 ; inline
-: key-a HEX: 0004 ; inline
-: key-b HEX: 0005 ; inline
-: key-c HEX: 0006 ; inline
-: key-d HEX: 0007 ; inline
-: key-e HEX: 0008 ; inline
-: key-f HEX: 0009 ; inline
-: key-g HEX: 000a ; inline
-: key-h HEX: 000b ; inline
-: key-i HEX: 000c ; inline
-: key-j HEX: 000d ; inline
-: key-k HEX: 000e ; inline
-: key-l HEX: 000f ; inline
-: key-m HEX: 0010 ; inline
-: key-n HEX: 0011 ; inline
-: key-o HEX: 0012 ; inline
-: key-p HEX: 0013 ; inline
-: key-q HEX: 0014 ; inline
-: key-r HEX: 0015 ; inline
-: key-s HEX: 0016 ; inline
-: key-t HEX: 0017 ; inline
-: key-u HEX: 0018 ; inline
-: key-v HEX: 0019 ; inline
-: key-w HEX: 001a ; inline
-: key-x HEX: 001b ; inline
-: key-y HEX: 001c ; inline
-: key-z HEX: 001d ; inline
-: key-1 HEX: 001e ; inline
-: key-2 HEX: 001f ; inline
-: key-3 HEX: 0020 ; inline
-: key-4 HEX: 0021 ; inline
-: key-5 HEX: 0022 ; inline
-: key-6 HEX: 0023 ; inline
-: key-7 HEX: 0024 ; inline
-: key-8 HEX: 0025 ; inline
-: key-9 HEX: 0026 ; inline
-: key-0 HEX: 0027 ; inline
-: key-return HEX: 0028 ; inline
-: key-escape HEX: 0029 ; inline
-: key-backspace HEX: 002a ; inline
-: key-tab HEX: 002b ; inline
-: key-space HEX: 002c ; inline
-: key-- HEX: 002d ; inline
-: key-= HEX: 002e ; inline
-: key-[ HEX: 002f ; inline
-: key-] HEX: 0030 ; inline
-: key-\ HEX: 0031 ; inline
-: key-#-non-us HEX: 0032 ; inline
-: key-; HEX: 0033 ; inline
-: key-' HEX: 0034 ; inline
-: key-` HEX: 0035 ; inline
-: key-, HEX: 0036 ; inline
-: key-. HEX: 0037 ; inline
-: key-/ HEX: 0038 ; inline
-: key-caps-lock HEX: 0039 ; inline
-: key-f1 HEX: 003a ; inline
-: key-f2 HEX: 003b ; inline
-: key-f3 HEX: 003c ; inline
-: key-f4 HEX: 003d ; inline
-: key-f5 HEX: 003e ; inline
-: key-f6 HEX: 003f ; inline
-: key-f7 HEX: 0040 ; inline
-: key-f8 HEX: 0041 ; inline
-: key-f9 HEX: 0042 ; inline
-: key-f10 HEX: 0043 ; inline
-: key-f11 HEX: 0044 ; inline
-: key-f12 HEX: 0045 ; inline
-: key-print-screen HEX: 0046 ; inline
-: key-scroll-lock HEX: 0047 ; inline
-: key-pause HEX: 0048 ; inline
-: key-insert HEX: 0049 ; inline
-: key-home HEX: 004a ; inline
-: key-page-up HEX: 004b ; inline
-: key-delete HEX: 004c ; inline
-: key-end HEX: 004d ; inline
-: key-page-down HEX: 004e ; inline
-: key-right-arrow HEX: 004f ; inline
-: key-left-arrow HEX: 0050 ; inline
-: key-down-arrow HEX: 0051 ; inline
-: key-up-arrow HEX: 0052 ; inline
-: key-keypad-numlock HEX: 0053 ; inline
-: key-keypad-/ HEX: 0054 ; inline
-: key-keypad-* HEX: 0055 ; inline
-: key-keypad-- HEX: 0056 ; inline
-: key-keypad-+ HEX: 0057 ; inline
-: key-keypad-enter HEX: 0058 ; inline
-: key-keypad-1 HEX: 0059 ; inline
-: key-keypad-2 HEX: 005a ; inline
-: key-keypad-3 HEX: 005b ; inline
-: key-keypad-4 HEX: 005c ; inline
-: key-keypad-5 HEX: 005d ; inline
-: key-keypad-6 HEX: 005e ; inline
-: key-keypad-7 HEX: 005f ; inline
-: key-keypad-8 HEX: 0060 ; inline
-: key-keypad-9 HEX: 0061 ; inline
-: key-keypad-0 HEX: 0062 ; inline
-: key-keypad-. HEX: 0063 ; inline
-: key-\-non-us HEX: 0064 ; inline
-: key-application HEX: 0065 ; inline
-: key-power HEX: 0066 ; inline
-: key-keypad-= HEX: 0067 ; inline
-: key-f13 HEX: 0068 ; inline
-: key-f14 HEX: 0069 ; inline
-: key-f15 HEX: 006a ; inline
-: key-f16 HEX: 006b ; inline
-: key-f17 HEX: 006c ; inline
-: key-f18 HEX: 006d ; inline
-: key-f19 HEX: 006e ; inline
-: key-f20 HEX: 006f ; inline
-: key-f21 HEX: 0070 ; inline
-: key-f22 HEX: 0071 ; inline
-: key-f23 HEX: 0072 ; inline
-: key-f24 HEX: 0073 ; inline
-: key-execute HEX: 0074 ; inline
-: key-help HEX: 0075 ; inline
-: key-menu HEX: 0076 ; inline
-: key-select HEX: 0077 ; inline
-: key-stop HEX: 0078 ; inline
-: key-again HEX: 0079 ; inline
-: key-undo HEX: 007a ; inline
-: key-cut HEX: 007b ; inline
-: key-copy HEX: 007c ; inline
-: key-paste HEX: 007d ; inline
-: key-find HEX: 007e ; inline
-: key-mute HEX: 007f ; inline
-: key-volume-up HEX: 0080 ; inline
-: key-volume-down HEX: 0081 ; inline
-: key-locking-caps-lock HEX: 0082 ; inline
-: key-locking-num-lock HEX: 0083 ; inline
-: key-locking-scroll-lock HEX: 0084 ; inline
-: key-keypad-, HEX: 0085 ; inline
-: key-keypad-=-as-400 HEX: 0086 ; inline
-: key-international-1 HEX: 0087 ; inline
-: key-international-2 HEX: 0088 ; inline
-: key-international-3 HEX: 0089 ; inline
-: key-international-4 HEX: 008a ; inline
-: key-international-5 HEX: 008b ; inline
-: key-international-6 HEX: 008c ; inline
-: key-international-7 HEX: 008d ; inline
-: key-international-8 HEX: 008e ; inline
-: key-international-9 HEX: 008f ; inline
-: key-lang-1 HEX: 0090 ; inline
-: key-lang-2 HEX: 0091 ; inline
-: key-lang-3 HEX: 0092 ; inline
-: key-lang-4 HEX: 0093 ; inline
-: key-lang-5 HEX: 0094 ; inline
-: key-lang-6 HEX: 0095 ; inline
-: key-lang-7 HEX: 0096 ; inline
-: key-lang-8 HEX: 0097 ; inline
-: key-lang-9 HEX: 0098 ; inline
-: key-alternate-erase HEX: 0099 ; inline
-: key-sysreq HEX: 009a ; inline
-: key-cancel HEX: 009b ; inline
-: key-clear HEX: 009c ; inline
-: key-prior HEX: 009d ; inline
-: key-enter HEX: 009e ; inline
-: key-separator HEX: 009f ; inline
-: key-out HEX: 00a0 ; inline
-: key-oper HEX: 00a1 ; inline
-: key-clear-again HEX: 00a2 ; inline
-: key-crsel-props HEX: 00a3 ; inline
-: key-exsel HEX: 00a4 ; inline
-: key-left-control HEX: 00e0 ; inline
-: key-left-shift HEX: 00e1 ; inline
-: key-left-alt HEX: 00e2 ; inline
-: key-left-gui HEX: 00e3 ; inline
-: key-right-control HEX: 00e4 ; inline
-: key-right-shift HEX: 00e5 ; inline
-: key-right-alt HEX: 00e6 ; inline
-: key-right-gui HEX: 00e7 ; inline
+CONSTANT: key-undefined HEX: 0000
+CONSTANT: key-error-roll-over HEX: 0001
+CONSTANT: key-error-post-fail HEX: 0002
+CONSTANT: key-error-undefined HEX: 0003
+CONSTANT: key-a HEX: 0004
+CONSTANT: key-b HEX: 0005
+CONSTANT: key-c HEX: 0006
+CONSTANT: key-d HEX: 0007
+CONSTANT: key-e HEX: 0008
+CONSTANT: key-f HEX: 0009
+CONSTANT: key-g HEX: 000a
+CONSTANT: key-h HEX: 000b
+CONSTANT: key-i HEX: 000c
+CONSTANT: key-j HEX: 000d
+CONSTANT: key-k HEX: 000e
+CONSTANT: key-l HEX: 000f
+CONSTANT: key-m HEX: 0010
+CONSTANT: key-n HEX: 0011
+CONSTANT: key-o HEX: 0012
+CONSTANT: key-p HEX: 0013
+CONSTANT: key-q HEX: 0014
+CONSTANT: key-r HEX: 0015
+CONSTANT: key-s HEX: 0016
+CONSTANT: key-t HEX: 0017
+CONSTANT: key-u HEX: 0018
+CONSTANT: key-v HEX: 0019
+CONSTANT: key-w HEX: 001a
+CONSTANT: key-x HEX: 001b
+CONSTANT: key-y HEX: 001c
+CONSTANT: key-z HEX: 001d
+CONSTANT: key-1 HEX: 001e
+CONSTANT: key-2 HEX: 001f
+CONSTANT: key-3 HEX: 0020
+CONSTANT: key-4 HEX: 0021
+CONSTANT: key-5 HEX: 0022
+CONSTANT: key-6 HEX: 0023
+CONSTANT: key-7 HEX: 0024
+CONSTANT: key-8 HEX: 0025
+CONSTANT: key-9 HEX: 0026
+CONSTANT: key-0 HEX: 0027
+CONSTANT: key-return HEX: 0028
+CONSTANT: key-escape HEX: 0029
+CONSTANT: key-backspace HEX: 002a
+CONSTANT: key-tab HEX: 002b
+CONSTANT: key-space HEX: 002c
+CONSTANT: key-- HEX: 002d
+CONSTANT: key-= HEX: 002e
+CONSTANT: key-[ HEX: 002f
+CONSTANT: key-] HEX: 0030
+CONSTANT: key-\ HEX: 0031
+CONSTANT: key-#-non-us HEX: 0032
+CONSTANT: key-; HEX: 0033
+CONSTANT: key-' HEX: 0034
+CONSTANT: key-` HEX: 0035
+CONSTANT: key-, HEX: 0036
+CONSTANT: key-. HEX: 0037
+CONSTANT: key-/ HEX: 0038
+CONSTANT: key-caps-lock HEX: 0039
+CONSTANT: key-f1 HEX: 003a
+CONSTANT: key-f2 HEX: 003b
+CONSTANT: key-f3 HEX: 003c
+CONSTANT: key-f4 HEX: 003d
+CONSTANT: key-f5 HEX: 003e
+CONSTANT: key-f6 HEX: 003f
+CONSTANT: key-f7 HEX: 0040
+CONSTANT: key-f8 HEX: 0041
+CONSTANT: key-f9 HEX: 0042
+CONSTANT: key-f10 HEX: 0043
+CONSTANT: key-f11 HEX: 0044
+CONSTANT: key-f12 HEX: 0045
+CONSTANT: key-print-screen HEX: 0046
+CONSTANT: key-scroll-lock HEX: 0047
+CONSTANT: key-pause HEX: 0048
+CONSTANT: key-insert HEX: 0049
+CONSTANT: key-home HEX: 004a
+CONSTANT: key-page-up HEX: 004b
+CONSTANT: key-delete HEX: 004c
+CONSTANT: key-end HEX: 004d
+CONSTANT: key-page-down HEX: 004e
+CONSTANT: key-right-arrow HEX: 004f
+CONSTANT: key-left-arrow HEX: 0050
+CONSTANT: key-down-arrow HEX: 0051
+CONSTANT: key-up-arrow HEX: 0052
+CONSTANT: key-keypad-numlock HEX: 0053
+CONSTANT: key-keypad-/ HEX: 0054
+CONSTANT: key-keypad-* HEX: 0055
+CONSTANT: key-keypad-- HEX: 0056
+CONSTANT: key-keypad-+ HEX: 0057
+CONSTANT: key-keypad-enter HEX: 0058
+CONSTANT: key-keypad-1 HEX: 0059
+CONSTANT: key-keypad-2 HEX: 005a
+CONSTANT: key-keypad-3 HEX: 005b
+CONSTANT: key-keypad-4 HEX: 005c
+CONSTANT: key-keypad-5 HEX: 005d
+CONSTANT: key-keypad-6 HEX: 005e
+CONSTANT: key-keypad-7 HEX: 005f
+CONSTANT: key-keypad-8 HEX: 0060
+CONSTANT: key-keypad-9 HEX: 0061
+CONSTANT: key-keypad-0 HEX: 0062
+CONSTANT: key-keypad-. HEX: 0063
+CONSTANT: key-\-non-us HEX: 0064
+CONSTANT: key-application HEX: 0065
+CONSTANT: key-power HEX: 0066
+CONSTANT: key-keypad-= HEX: 0067
+CONSTANT: key-f13 HEX: 0068
+CONSTANT: key-f14 HEX: 0069
+CONSTANT: key-f15 HEX: 006a
+CONSTANT: key-f16 HEX: 006b
+CONSTANT: key-f17 HEX: 006c
+CONSTANT: key-f18 HEX: 006d
+CONSTANT: key-f19 HEX: 006e
+CONSTANT: key-f20 HEX: 006f
+CONSTANT: key-f21 HEX: 0070
+CONSTANT: key-f22 HEX: 0071
+CONSTANT: key-f23 HEX: 0072
+CONSTANT: key-f24 HEX: 0073
+CONSTANT: key-execute HEX: 0074
+CONSTANT: key-help HEX: 0075
+CONSTANT: key-menu HEX: 0076
+CONSTANT: key-select HEX: 0077
+CONSTANT: key-stop HEX: 0078
+CONSTANT: key-again HEX: 0079
+CONSTANT: key-undo HEX: 007a
+CONSTANT: key-cut HEX: 007b
+CONSTANT: key-copy HEX: 007c
+CONSTANT: key-paste HEX: 007d
+CONSTANT: key-find HEX: 007e
+CONSTANT: key-mute HEX: 007f
+CONSTANT: key-volume-up HEX: 0080
+CONSTANT: key-volume-down HEX: 0081
+CONSTANT: key-locking-caps-lock HEX: 0082
+CONSTANT: key-locking-num-lock HEX: 0083
+CONSTANT: key-locking-scroll-lock HEX: 0084
+CONSTANT: key-keypad-, HEX: 0085
+CONSTANT: key-keypad-=-as-400 HEX: 0086
+CONSTANT: key-international-1 HEX: 0087
+CONSTANT: key-international-2 HEX: 0088
+CONSTANT: key-international-3 HEX: 0089
+CONSTANT: key-international-4 HEX: 008a
+CONSTANT: key-international-5 HEX: 008b
+CONSTANT: key-international-6 HEX: 008c
+CONSTANT: key-international-7 HEX: 008d
+CONSTANT: key-international-8 HEX: 008e
+CONSTANT: key-international-9 HEX: 008f
+CONSTANT: key-lang-1 HEX: 0090
+CONSTANT: key-lang-2 HEX: 0091
+CONSTANT: key-lang-3 HEX: 0092
+CONSTANT: key-lang-4 HEX: 0093
+CONSTANT: key-lang-5 HEX: 0094
+CONSTANT: key-lang-6 HEX: 0095
+CONSTANT: key-lang-7 HEX: 0096
+CONSTANT: key-lang-8 HEX: 0097
+CONSTANT: key-lang-9 HEX: 0098
+CONSTANT: key-alternate-erase HEX: 0099
+CONSTANT: key-sysreq HEX: 009a
+CONSTANT: key-cancel HEX: 009b
+CONSTANT: key-clear HEX: 009c
+CONSTANT: key-prior HEX: 009d
+CONSTANT: key-enter HEX: 009e
+CONSTANT: key-separator HEX: 009f
+CONSTANT: key-out HEX: 00a0
+CONSTANT: key-oper HEX: 00a1
+CONSTANT: key-clear-again HEX: 00a2
+CONSTANT: key-crsel-props HEX: 00a3
+CONSTANT: key-exsel HEX: 00a4
+CONSTANT: key-left-control HEX: 00e0
+CONSTANT: key-left-shift HEX: 00e1
+CONSTANT: key-left-alt HEX: 00e2
+CONSTANT: key-left-gui HEX: 00e3
+CONSTANT: key-right-control HEX: 00e4
+CONSTANT: key-right-shift HEX: 00e5
+CONSTANT: key-right-alt HEX: 00e6
+CONSTANT: key-right-gui HEX: 00e7
index 9bd3c5854b536a44ebbf4db7d69ad2238026da7d..4d4e3b0507d51cec4f55073fedab901488c83da1 100644 (file)
@@ -8,7 +8,7 @@ help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 IN: google-tech-talk
 
-: google-slides
+CONSTANT: google-slides
 {
     { $slide "Factor!"
         { $url "http://factorcode.org" }
@@ -562,7 +562,7 @@ IN: google-tech-talk
         "Put your prejudices aside and give it a shot!"
     }
     { $slide "Questions?" }
-} ;
+}
 
 : google-talk ( -- ) google-slides slides-window ;
 
index da69c2ced3746bf58de9f059d74f2c0e8e7db7de..a54bba1629ac0d269b74c96ebefcf828a8803a0f 100644 (file)
@@ -1,13 +1,19 @@
 ! Copyright (C) 2008 Tim Wawrzynczak
 ! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax sequences kernel ;
+USING: help.markup help.syntax sequences kernel accessors ;
 IN: id3
 
 HELP: file-id3-tags
 { $values 
     { "path" "a path string" } 
     { "object/f" "a tuple storing ID3 metadata or f" } }
-{ $description "Return a tuple containing the ID3 information parsed out of the MP3 file, or " { $link f } " if no metadata is present." } ;
+    { $description "Return a tuple containing the ID3 information parsed out of the MP3 file, or " { $link f } " if no metadata is present.  Currently, the parser supports the following tags: "
+      $nl { $link title>> }
+      $nl { $link artist>> }
+      $nl { $link album>> }
+      $nl { $link year>> }
+      $nl { $link genre>> }
+      $nl { $link comment>> } } ;
 
 ARTICLE: "id3" "ID3 tags"
 "The " { $vocab-link "id3" } " vocabulary contains words for parsing " { $emphasis "ID3" } " tags, which are textual fields storing an MP3's title, artist, and other metadata." $nl
index b9d45b1b04fc1af9fd93a667b1f71407d40d7230..bcdc312440e94e496a08ad310f5d9d3c8a46c330 100644 (file)
 ! Copyright (C) 2009 Tim Wawrzynczak
 ! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test id3 ;
+USING: tools.test id3 id3.private ;
 IN: id3.tests
 
-[ T{ mp3v2-file
-     { header  T{ header f t 0 502 } }
-     { frames
-       {
-           T{ frame
-              { frame-id "COMM" }
-              { flags B{ 0 0 } }
-              { size 19 }
-              { data "eng, AG# 08E1C12E" }
-           }
-           T{ frame
-              { frame-id "TIT2" }
-              { flags B{ 0 0 } }
-              { size 15 }
-              { data "Stormy Weather" }
-           }
-           T{ frame
-              { frame-id "TRCK" }
-              { flags B{ 0 0 } }
-              { size 3 }
-              { data "32" }
-           }
-           T{ frame
-              { frame-id "TCON" }
-              { flags B{ 0 0 } }
-              { size 5 }
-              { data "(96)" }
-           }
-           T{ frame
-              { frame-id "TALB" }
-              { flags B{ 0 0 } }
-              { size 28 }
-              { data "Night and Day Frank Sinatra" }
-           }
-           T{ frame
-              { frame-id "PRIV" }
-              { flags B{ 0 0 } }
-              { size 39 }
-              { data "WM/MediaClassPrimaryID�}`�#��K�H�*(D" }
-           }
-           T{ frame
-              { frame-id "PRIV" }
-              { flags B{ 0 0 } }
-              { size 41 }
-              { data "WM/MediaClassSecondaryID" }
-           }
-           T{ frame
-              { frame-id "TPE1" }
-              { flags B{ 0 0 } }
-              { size 14 }
-              { data "Frank Sinatra" }
-           }
-       }
-     }
-}
-] [ "resource:extra/id3/tests/blah3.mp3" file-id3-tags ] unit-test
-
 [
-    T{ mp3v2-file
-    { header
-        T{ header { version t } { flags 0 } { size 1405 } }
+    T{ id3-info
+       { title "BLAH" }
+       { artist "ARTIST" }
+       { album "ALBUM" }
+       { year "2009" }
+       { comment "COMMENT" }
+       { genre "Bluegrass" }
     }
-    { frames
-        {
-            T{ frame
-                { frame-id "TIT2" }
-                { flags B{ 0 0 } }
-                { size 22 }
-                { data "Anthem of the Trinity" }
-            }
-            T{ frame
-                { frame-id "TPE1" }
-                { flags B{ 0 0 } }
-                { size 12 }
-                { data "Terry Riley" }
-            }
-            T{ frame
-                { frame-id "TALB" }
-                { flags B{ 0 0 } }
-                { size 11 }
-                { data "Shri Camel" }
-            }
-            T{ frame
-                { frame-id "TCON" }
-                { flags B{ 0 0 } }
-                { size 10 }
-                { data "Classical" }
-            }
-            T{ frame
-                { frame-id "UFID" }
-                { flags B{ 0 0 } }
-                { size 23 }
-                { data "http://musicbrainz.org" }
-            }
-            T{ frame
-                { frame-id "TXXX" }
-                { flags B{ 0 0 } }
-                { size 23 }
-                { data "MusicBrainz Artist Id" }
-            }
-            T{ frame
-                { frame-id "TXXX" }
-                { flags B{ 0 0 } }
-                { size 22 }
-                { data "musicbrainz_artistid" }
-            }
-            T{ frame
-                { frame-id "TRCK" }
-                { flags B{ 0 0 } }
-                { size 2 }
-                { data "1" }
-            }
-            T{ frame
-                { frame-id "TXXX" }
-                { flags B{ 0 0 } }
-                { size 22 }
-                { data "MusicBrainz Album Id" }
-            }
-            T{ frame
-                { frame-id "TXXX" }
-                { flags B{ 0 0 } }
-                { size 21 }
-                { data "musicbrainz_albumid" }
-            }
-            T{ frame
-                { frame-id "TXXX" }
-                { flags B{ 0 0 } }
-                { size 29 }
-                { data "MusicBrainz Album Artist Id" }
-            }
-            T{ frame
-                { frame-id "TXXX" }
-                { flags B{ 0 0 } }
-                { size 27 }
-                { data "musicbrainz_albumartistid" }
-            }
-            T{ frame
-                { frame-id "TPOS" }
-                { flags B{ 0 0 } }
-                { size 2 }
-                { data "1" }
-            }
-            T{ frame
-                { frame-id "TSOP" }
-                { flags B{ 0 0 } }
-                { size 1 }
-            }
-            T{ frame
-                { frame-id "TMED" }
-                { flags B{ 0 0 } }
-                { size 4 }
-                { data "DIG" }
-            }
-        }
+] [ "resource:extra/id3/tests/blah.mp3" file-id3-tags ] unit-test
+
+[
+    T{ id3-info
+       { title "Anthem of the Trinity" }
+       { artist "Terry Riley" }
+       { album "Shri Camel" }
+       { genre "Classical" }
     }
-}
 ] [ "resource:extra/id3/tests/blah2.mp3" file-id3-tags ] unit-test
 
 [    
-  T{ mp3v1-file
-     { title
-       "BLAH\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-     }
-     { artist
-       "ARTIST\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-     }
-     { album
-       "ALBUM\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-     }
-     { year "2009" }
-     { comment
-       "COMMENT\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-     }
-     { genre 89 }
-  }
-] [ "resource:extra/id3/tests/blah.mp3" file-id3-tags ] unit-test
+    T{ id3-info
+       { title "Stormy Weather" }
+       { artist "Frank Sinatra" }
+       { album "Night and Day Frank Sinatra" }
+       { comment "eng, AG# 08E1C12E" }
+       { genre "Big Band" }
+    }
+] [ "resource:extra/id3/tests/blah3.mp3" file-id3-tags ] unit-test
 
index 64e1ff1d10b498b8778a2ee5716f540a5b929897..f2bbd08996d46bb6a58c03e01b759fd1d252002e 100644 (file)
 ! Copyright (C) 2009 Tim Wawrzynczak
 ! See http://factorcode.org/license.txt for BSD license.
-USING: sequences io io.encodings.binary io.files io.pathnames strings kernel math io.mmap io.mmap.uchar accessors syntax combinators math.ranges unicode.categories byte-arrays prettyprint io.encodings.string io.encodings.ascii ;
+USING: sequences io io.encodings.binary io.files io.pathnames strings kernel math io.mmap io.mmap.uchar accessors syntax combinators math.ranges unicode.categories byte-arrays io.encodings.string io.encodings.utf8 assocs math.parser ;
 IN: id3
 
+<PRIVATE
+
+! genres
+CONSTANT: genres
+  H{
+    { 0 "Blues" }
+    { 1 "Classic Rock" }
+    { 2 "Country" }
+    { 3 "Dance" }
+    { 4 "Disco" }
+    { 5 "Funk" }
+    { 6 "Grunge" }
+    { 7 "Hip-Hop" }
+    { 8 "Jazz" }
+    { 9 "Metal" }
+    { 10 "New Age" }
+    { 11 "Oldies" }
+    { 12 "Other" }
+    { 13 "Pop" }
+    { 14 "R&B" }
+    { 15 "Rap" }
+    { 16 "Reggae" }
+    { 17 "Rock" }
+    { 18 "Techno" }
+    { 19 "Industrial" }
+    { 20 "Alternative" }
+    { 21 "Ska" }
+    { 22 "Death Metal" }
+    { 23 "Pranks" }
+    { 24 "Soundtrack" }
+    { 25 "Euro-Techno" }
+    { 26 "Ambient" }
+    { 27 "Trip-Hop" }
+    { 28 "Vocal" }
+    { 29 "Jazz+Funk" }
+    { 30 "Fusion" }
+    { 31 "Trance" }
+    { 32 "Classical" }
+    { 33 "Instrumental" }
+    { 34 "Acid" }
+    { 35 "House" }
+    { 36 "Game" }
+    { 37 "Sound Clip" }
+    { 38 "Gospel" }
+    { 39 "Noise" }
+    { 40 "AlternRock" }
+    { 41 "Bass" }
+    { 42 "Soul" }
+    { 43 "Punk" }
+    { 44 "Space" }
+    { 45 "Meditative" }
+    { 46 "Instrumental Pop" }
+    { 47 "Instrumental Rock" }
+    { 48 "Ethnic" }
+    { 49 "Gothic" }
+    { 50 "Darkwave" }
+    { 51 "Techno-Industrial" }
+    { 52 "Electronic" }
+    { 53 "Pop-Folk" }
+    { 54 "Eurodance" }
+    { 55 "Dream" }
+    { 56 "Southern Rock" }
+    { 57 "Comedy" }
+    { 58 "Cult" }
+    { 59 "Gangsta" }
+    { 60 "Top 40" }
+    { 61 "Christian Rap" }
+    { 62 "Pop/Funk" }
+    { 63 "Jungle" }
+    { 64 "Native American" }
+    { 65 "Cabaret" }
+    { 66 "New Wave" }
+    { 67 "Psychedelic" }
+    { 68 "Rave" }
+    { 69 "Showtunes" }
+    { 70 "Trailer" }
+    { 71 "Lo-Fi" }
+    { 72 "Tribal" }
+    { 73 "Acid Punk" }
+    { 74 "Acid Jazz" }
+    { 75 "Polka" }
+    { 76 "Retro" }
+    { 77 "Musical" }
+    { 78 "Rock & Roll" }
+    { 79 "Hard Rock" }
+    { 80 "Folk" }
+    { 81 "Folk-Rock" }
+    { 82 "National Folk" }
+    { 83 "Swing" }
+    { 84 "Fast Fusion" }
+    { 85 "Bebop" }
+    { 86 "Latin" }
+    { 87 "Revival" }
+    { 88 "Celtic" }
+    { 89 "Bluegrass" }
+    { 90 "Avantgarde" }
+    { 91 "Gothic Rock" }
+    { 92 "Progressive Rock" }
+    { 93 "Psychedelic Rock" }
+    { 94 "Symphonic Rock" }
+    { 95 "Slow Rock" }
+    { 96 "Big Band" }
+    { 97 "Chorus" }
+    { 98 "Easy Listening" }
+    { 99 "Acoustic" }
+    { 100 "Humour" }
+    { 101 "Speech" }
+    { 102 "Chanson" }
+    { 103 "Opera" }
+    { 104 "Chamber Music" }
+    { 105 "Sonata" }
+    { 106 "Symphony" }
+    { 107 "Booty Bass" }
+    { 108 "Primus" }
+    { 109 "Porn Groove" }
+    { 110 "Satire" }
+    { 111 "Slow Jam" }
+    { 112 "Club" }
+    { 113 "Tango" }
+    { 114 "Samba" }
+    { 115 "Folklore" }
+    { 116 "Ballad" }
+    { 117 "Power Ballad" }
+    { 118 "Rhythmic Soul" }
+    { 119 "Freestyle" }
+    { 120 "Duet" }
+    { 121 "Punk Rock" }
+    { 122 "Drum Solo" }
+    { 123 "A capella" }
+    { 124 "Euro-House" }
+    { 125 "Dance Hall" }
+} ! end genre hashtable
+
 ! tuples
 
 TUPLE: header version flags size ;
 
 TUPLE: frame frame-id flags size data ;
 
-TUPLE: mp3v2-file header frames ;
+TUPLE: id3v2-info header frames ;
 
-TUPLE: mp3v1-file title artist album year comment genre ;
+TUPLE: id3-info title artist album year comment genre ;
 
-: <mp3v1-file> ( -- object ) mp3v1-file new ;
+: <id3-info> ( -- object ) id3-info new ;
 
-: <mp3v2-file> ( header frames -- object ) mp3v2-file boa ;
+: <id3v2-info> ( header frames -- object ) id3v2-info boa ;
 
 : <header> ( -- object ) header new ;
 
 : <frame> ( -- object ) frame new ;
 
-<PRIVATE
-
 ! utility words
 
 : id3v2? ( mmap -- ? )
@@ -59,10 +190,10 @@ TUPLE: mp3v1-file title artist album year comment genre ;
 : (read-frame) ( mmap -- frame )
     [ <frame> ] dip
     {
-        [ read-frame-id    ascii decode >>frame-id ]
+        [ read-frame-id    utf8 decode  >>frame-id ]
         [ read-frame-flags >byte-array  >>flags ]
         [ read-frame-size  >28bitword   >>size ]
-        [ read-frame-data  ascii decode >>data ]
+        [ read-frame-data  utf8 decode  >>data ]
     } cleave ;
 
 : read-frame ( mmap -- frame/f )
@@ -98,9 +229,21 @@ TUPLE: mp3v1-file title artist album year comment genre ;
 : drop-header ( mmap -- seq1 seq2 )
     dup 10 tail-slice swap ;
 
-: read-v2-tag-data ( seq -- mp3v2-file )
-    drop-header read-v2-header swap read-frames <mp3v2-file> ;
+: parse-frames ( id3v2-info -- id3-info )
+    [ <id3-info> ] dip frames>>
+    {
+        [ [ frame-id>> "TIT2" = ] find nip [ data>> >>title ] when* ]
+        [ [ frame-id>> "TALB" = ] find nip [ data>> >>album ] when* ]
+        [ [ frame-id>> "TPE1" = ] find nip [ data>> >>artist ] when* ]
+        [ [ frame-id>> "TCON" = ] find nip [ data>> [ [ digit? ] filter string>number ] keep swap [ genres at nip ] when*
+          >>genre ] when* ]
+        [ [ frame-id>> "COMM" = ] find nip [ data>> >>comment ] when* ]
+        [ [ frame-id>> "TYER" = ] find nip [ data>> >>year ] when* ]
+    } cleave ;
 
+: read-v2-tag-data ( seq -- id3-info )
+    drop-header read-v2-header swap read-frames <id3v2-info> parse-frames ;
+    
 ! v1 information
 
 : skip-to-v1-data ( seq -- seq )
@@ -125,14 +268,14 @@ TUPLE: mp3v1-file title artist album year comment genre ;
     [ 124 ] dip nth ;
 
 : (read-v1-tag-data) ( seq -- mp3-file )
-    [ <mp3v1-file> ] dip
+    [ <id3-info> ] dip
     {
-        [ read-title   ascii decode  >>title ]
-        [ read-artist  ascii decode  >>artist ]
-        [ read-album   ascii decode  >>album ]
-        [ read-year    ascii decode  >>year ]
-        [ read-comment ascii decode  >>comment ]
-        [ read-genre   >fixnum       >>genre ]
+        [ read-title   utf8 decode  filter-text-data >>title   ]
+        [ read-artist  utf8 decode  filter-text-data >>artist  ]
+        [ read-album   utf8 decode  filter-text-data >>album   ]
+        [ read-year    utf8 decode  filter-text-data >>year    ]
+        [ read-comment utf8 decode  filter-text-data >>comment ]
+        [ read-genre   >fixnum       genres at       >>genre ]
     } cleave ;
 
 : read-v1-tag-data ( seq -- mp3-file )
@@ -140,13 +283,13 @@ TUPLE: mp3v1-file title artist album year comment genre ;
 
 PRIVATE>
 
-! main stuff
+! public interface
 
 : file-id3-tags ( path -- object/f )
     [
         {
-            { [ dup id3v2? ] [ read-v2-tag-data ] } ! ( ? -- mp3v2-file )
-            { [ dup id3v1? ] [ read-v1-tag-data ] } ! ( ? -- mp3v1-file )
+            { [ dup id3v2? ] [ read-v2-tag-data ] } ! ( ? -- id3v2 )
+            { [ dup id3v1? ] [ read-v1-tag-data ] } ! ( ? -- id3-info )
             [ drop f ] ! ( mmap -- f )
         } cond
     ] with-mapped-uchar-file ;
index 3e2ba49e3cc926c343538e5bfb5c62145915e4c5..d39c0b3c2def19419ded9af5bd76ead868d9efc0 100644 (file)
@@ -14,11 +14,8 @@ ERROR: local-not-defined name ;
 M: local-not-defined summary
     drop "local is not defined" ;
 
-: at? ( key assoc -- value/key ? )
-    dupd at* [ nip t ] [ drop f ] if ;
-
 : >local-word ( string -- word )
-    locals get at? [ local-not-defined ] unless ;
+    locals get ?at [ local-not-defined ] unless ;
 
 : select-op ( string -- word )
     {
index bcea984579f404b171929c776e8fe39688c2160d..f7324acd051a3474277cfed8995166baf57cc6c0 100644 (file)
@@ -14,8 +14,10 @@ M: invalid-baud summary ( invalid-baud -- string )
     "Baud rate " " not supported" surround ;
 
 HOOK: lookup-baud os ( m -- n )
-HOOK: open-serial os ( serial -- stream )
+HOOK: open-serial os ( serial -- serial' )
+M: serial dispose ( serial -- ) stream>> dispose ;
 
 {
     { [ os unix? ] [ "io.serial.unix" ] } 
+    { [ os windows? ] [ "io.serial.windows" ] }
 } cond require
index b684190698ccaf5cce84eb2595d05a9a9e12bf39..dbb013aca04ff7a8d3ed859d3738384286093cb0 100644 (file)
@@ -10,77 +10,77 @@ M: bsd lookup-baud ( m -- n )
         230400 460800 921600
     } member? [ invalid-baud ] unless ;
 
-: TCSANOW     0 ; inline
-: TCSADRAIN   1 ; inline
-: TCSAFLUSH   2 ; inline
-: TCSASOFT    HEX: 10 ; inline
+CONSTANT: TCSANOW     0
+CONSTANT: TCSADRAIN   1
+CONSTANT: TCSAFLUSH   2
+CONSTANT: TCSASOFT    HEX: 10
 
-: TCIFLUSH    1 ; inline
-: TCOFLUSH    2 ; inline
-: TCIOFLUSH   3 ; inline
-: TCOOFF      1 ; inline
-: TCOON       2 ; inline
-: TCIOFF      3 ; inline
-: TCION       4 ; inline
+CONSTANT: TCIFLUSH    1
+CONSTANT: TCOFLUSH    2
+CONSTANT: TCIOFLUSH   3
+CONSTANT: TCOOFF      1
+CONSTANT: TCOON       2
+CONSTANT: TCIOFF      3
+CONSTANT: TCION       4
 
 ! iflags
-: IGNBRK      HEX: 00000001 ; inline
-: BRKINT      HEX: 00000002 ; inline
-: IGNPAR      HEX: 00000004 ; inline
-: PARMRK      HEX: 00000008 ; inline
-: INPCK       HEX: 00000010 ; inline
-: ISTRIP      HEX: 00000020 ; inline
-: INLCR       HEX: 00000040 ; inline
-: IGNCR       HEX: 00000080 ; inline
-: ICRNL       HEX: 00000100 ; inline
-: IXON        HEX: 00000200 ; inline
-: IXOFF       HEX: 00000400 ; inline
-: IXANY       HEX: 00000800 ; inline
-: IMAXBEL     HEX: 00002000 ; inline
-: IUTF8       HEX: 00004000 ; inline
+CONSTANT: IGNBRK      HEX: 00000001
+CONSTANT: BRKINT      HEX: 00000002
+CONSTANT: IGNPAR      HEX: 00000004
+CONSTANT: PARMRK      HEX: 00000008
+CONSTANT: INPCK       HEX: 00000010
+CONSTANT: ISTRIP      HEX: 00000020
+CONSTANT: INLCR       HEX: 00000040
+CONSTANT: IGNCR       HEX: 00000080
+CONSTANT: ICRNL       HEX: 00000100
+CONSTANT: IXON        HEX: 00000200
+CONSTANT: IXOFF       HEX: 00000400
+CONSTANT: IXANY       HEX: 00000800
+CONSTANT: IMAXBEL     HEX: 00002000
+CONSTANT: IUTF8       HEX: 00004000
 
 ! oflags
-: OPOST       HEX: 00000001 ; inline
-: ONLCR       HEX: 00000002 ; inline
-: OXTABS      HEX: 00000004 ; inline
-: ONOEOT      HEX: 00000008 ; inline
+CONSTANT: OPOST       HEX: 00000001
+CONSTANT: ONLCR       HEX: 00000002
+CONSTANT: OXTABS      HEX: 00000004
+CONSTANT: ONOEOT      HEX: 00000008
 
 ! cflags
-: CIGNORE     HEX: 00000001 ; inline
-: CSIZE       HEX: 00000300 ; inline
-: CS5         HEX: 00000000 ; inline
-: CS6         HEX: 00000100 ; inline
-: CS7         HEX: 00000200 ; inline
-: CS8         HEX: 00000300 ; inline
-: CSTOPB      HEX: 00000400 ; inline
-: CREAD       HEX: 00000800 ; inline
-: PARENB      HEX: 00001000 ; inline
-: PARODD      HEX: 00002000 ; inline
-: HUPCL       HEX: 00004000 ; inline
-: CLOCAL      HEX: 00008000 ; inline
-: CCTS_OFLOW  HEX: 00010000 ; inline
-: CRTS_IFLOW  HEX: 00020000 ; inline
-: CRTSCTS     { CCTS_OFLOW CRTS_IFLOW } flags ; inline
-: CDTR_IFLOW  HEX: 00040000 ; inline
-: CDSR_OFLOW  HEX: 00080000 ; inline
-: CCAR_OFLOW  HEX: 00100000 ; inline
-: MDMBUF      HEX: 00100000 ; inline
+CONSTANT: CIGNORE     HEX: 00000001
+CONSTANT: CSIZE       HEX: 00000300
+CONSTANT: CS5         HEX: 00000000
+CONSTANT: CS6         HEX: 00000100
+CONSTANT: CS7         HEX: 00000200
+CONSTANT: CS8         HEX: 00000300
+CONSTANT: CSTOPB      HEX: 00000400
+CONSTANT: CREAD       HEX: 00000800
+CONSTANT: PARENB      HEX: 00001000
+CONSTANT: PARODD      HEX: 00002000
+CONSTANT: HUPCL       HEX: 00004000
+CONSTANT: CLOCAL      HEX: 00008000
+CONSTANT: CCTS_OFLOW  HEX: 00010000
+CONSTANT: CRTS_IFLOW  HEX: 00020000
+: CRTSCTS ( -- n )  { CCTS_OFLOW CRTS_IFLOW } flags ; inline
+CONSTANT: CDTR_IFLOW  HEX: 00040000
+CONSTANT: CDSR_OFLOW  HEX: 00080000
+CONSTANT: CCAR_OFLOW  HEX: 00100000
+CONSTANT: MDMBUF      HEX: 00100000
 
 ! lflags
-: ECHOKE      HEX: 00000001 ; inline
-: ECHOE       HEX: 00000002 ; inline
-: ECHOK       HEX: 00000004 ; inline
-: ECHO        HEX: 00000008 ; inline
-: ECHONL      HEX: 00000010 ; inline
-: ECHOPRT     HEX: 00000020 ; inline
-: ECHOCTL     HEX: 00000040 ; inline
-: ISIG        HEX: 00000080 ; inline
-: ICANON      HEX: 00000100 ; inline
-: ALTWERASE   HEX: 00000200 ; inline
-: IEXTEN      HEX: 00000400 ; inline
-: EXTPROC     HEX: 00000800 ; inline
-: TOSTOP      HEX: 00400000 ; inline
-: FLUSHO      HEX: 00800000 ; inline
-: NOKERNINFO  HEX: 02000000 ; inline
-: PENDIN      HEX: 20000000 ; inline
-: NOFLSH      HEX: 80000000 ; inline
+CONSTANT: ECHOKE      HEX: 00000001
+CONSTANT: ECHOE       HEX: 00000002
+CONSTANT: ECHOK       HEX: 00000004
+CONSTANT: ECHO        HEX: 00000008
+CONSTANT: ECHONL      HEX: 00000010
+CONSTANT: ECHOPRT     HEX: 00000020
+CONSTANT: ECHOCTL     HEX: 00000040
+CONSTANT: ISIG        HEX: 00000080
+CONSTANT: ICANON      HEX: 00000100
+CONSTANT: ALTWERASE   HEX: 00000200
+CONSTANT: IEXTEN      HEX: 00000400
+CONSTANT: EXTPROC     HEX: 00000800
+CONSTANT: TOSTOP      HEX: 00400000
+CONSTANT: FLUSHO      HEX: 00800000
+CONSTANT: NOKERNINFO  HEX: 02000000
+CONSTANT: PENDIN      HEX: 20000000
+CONSTANT: NOFLSH      HEX: 80000000
index 342ff4499f21c650442266b02613ec3f2ad25e92..4d1878d2a93987fea705d899bee070b07156ad72 100644 (file)
@@ -3,96 +3,96 @@
 USING: assocs alien.syntax kernel io.serial system unix ;
 IN: io.serial.unix
 
-: TCSANOW     0 ; inline
-: TCSADRAIN   1 ; inline
-: TCSAFLUSH   2 ; inline
+CONSTANT: TCSANOW     0
+CONSTANT: TCSADRAIN   1
+CONSTANT: TCSAFLUSH   2
 
-: TCIFLUSH    0 ; inline
-: TCOFLUSH    1 ; inline
-: TCIOFLUSH   2 ; inline
+CONSTANT: TCIFLUSH    0
+CONSTANT: TCOFLUSH    1
+CONSTANT: TCIOFLUSH   2
 
-: TCOOFF      0 ; inline
-: TCOON       1 ; inline
-: TCIOFF      2 ; inline
-: TCION       3 ; inline
+CONSTANT: TCOOFF      0
+CONSTANT: TCOON       1
+CONSTANT: TCIOFF      2
+CONSTANT: TCION       3
 
 ! iflag
-: IGNBRK  OCT: 0000001 ; inline
-: BRKINT  OCT: 0000002 ; inline
-: IGNPAR  OCT: 0000004 ; inline
-: PARMRK  OCT: 0000010 ; inline
-: INPCK   OCT: 0000020 ; inline
-: ISTRIP  OCT: 0000040 ; inline
-: INLCR   OCT: 0000100 ; inline
-: IGNCR   OCT: 0000200 ; inline
-: ICRNL   OCT: 0000400 ; inline
-: IUCLC   OCT: 0001000 ; inline
-: IXON    OCT: 0002000 ; inline
-: IXANY   OCT: 0004000 ; inline
-: IXOFF   OCT: 0010000 ; inline
-: IMAXBEL OCT: 0020000 ; inline
-: IUTF8   OCT: 0040000 ; inline
+CONSTANT: IGNBRK  OCT: 0000001
+CONSTANT: BRKINT  OCT: 0000002
+CONSTANT: IGNPAR  OCT: 0000004
+CONSTANT: PARMRK  OCT: 0000010
+CONSTANT: INPCK   OCT: 0000020
+CONSTANT: ISTRIP  OCT: 0000040
+CONSTANT: INLCR   OCT: 0000100
+CONSTANT: IGNCR   OCT: 0000200
+CONSTANT: ICRNL   OCT: 0000400
+CONSTANT: IUCLC   OCT: 0001000
+CONSTANT: IXON    OCT: 0002000
+CONSTANT: IXANY   OCT: 0004000
+CONSTANT: IXOFF   OCT: 0010000
+CONSTANT: IMAXBEL OCT: 0020000
+CONSTANT: IUTF8   OCT: 0040000
 
 ! oflag
-: OPOST   OCT: 0000001 ; inline
-: OLCUC   OCT: 0000002 ; inline
-: ONLCR   OCT: 0000004 ; inline
-: OCRNL   OCT: 0000010 ; inline
-: ONOCR   OCT: 0000020 ; inline
-: ONLRET  OCT: 0000040 ; inline
-: OFILL   OCT: 0000100 ; inline
-: OFDEL   OCT: 0000200 ; inline
-: NLDLY  OCT: 0000400 ; inline
-:   NL0  OCT: 0000000 ; inline
-:   NL1  OCT: 0000400 ; inline
-: CRDLY  OCT: 0003000 ; inline
-:   CR0  OCT: 0000000 ; inline
-:   CR1  OCT: 0001000 ; inline
-:   CR2  OCT: 0002000 ; inline
-:   CR3  OCT: 0003000 ; inline
-: TABDLY OCT: 0014000 ; inline
-:   TAB0 OCT: 0000000 ; inline
-:   TAB1 OCT: 0004000 ; inline
-:   TAB2 OCT: 0010000 ; inline
-:   TAB3 OCT: 0014000 ; inline
-: BSDLY  OCT: 0020000 ; inline
-:   BS0  OCT: 0000000 ; inline
-:   BS1  OCT: 0020000 ; inline
-: FFDLY  OCT: 0100000 ; inline
-:   FF0  OCT: 0000000 ; inline
-:   FF1  OCT: 0100000 ; inline
+CONSTANT: OPOST   OCT: 0000001
+CONSTANT: OLCUC   OCT: 0000002
+CONSTANT: ONLCR   OCT: 0000004
+CONSTANT: OCRNL   OCT: 0000010
+CONSTANT: ONOCR   OCT: 0000020
+CONSTANT: ONLRET  OCT: 0000040
+CONSTANT: OFILL   OCT: 0000100
+CONSTANT: OFDEL   OCT: 0000200
+CONSTANT: NLDLY  OCT: 0000400
+CONSTANT:   NL0  OCT: 0000000
+CONSTANT:   NL1  OCT: 0000400
+CONSTANT: CRDLY  OCT: 0003000
+CONSTANT:   CR0  OCT: 0000000
+CONSTANT:   CR1  OCT: 0001000
+CONSTANT:   CR2  OCT: 0002000
+CONSTANT:   CR3  OCT: 0003000
+CONSTANT: TABDLY OCT: 0014000
+CONSTANT:   TAB0 OCT: 0000000
+CONSTANT:   TAB1 OCT: 0004000
+CONSTANT:   TAB2 OCT: 0010000
+CONSTANT:   TAB3 OCT: 0014000
+CONSTANT: BSDLY  OCT: 0020000
+CONSTANT:   BS0  OCT: 0000000
+CONSTANT:   BS1  OCT: 0020000
+CONSTANT: FFDLY  OCT: 0100000
+CONSTANT:   FF0  OCT: 0000000
+CONSTANT:   FF1  OCT: 0100000
 
 ! cflags
-: CSIZE   OCT: 0000060 ; inline
-:   CS5   OCT: 0000000 ; inline
-:   CS6   OCT: 0000020 ; inline
-:   CS7   OCT: 0000040 ; inline
-:   CS8   OCT: 0000060 ; inline
-: CSTOPB  OCT: 0000100 ; inline
-: CREAD   OCT: 0000200 ; inline
-: PARENB  OCT: 0000400 ; inline
-: PARODD  OCT: 0001000 ; inline
-: HUPCL   OCT: 0002000 ; inline
-: CLOCAL  OCT: 0004000 ; inline
-: CIBAUD  OCT: 002003600000 ; inline
-: CRTSCTS OCT: 020000000000 ; inline
+CONSTANT: CSIZE   OCT: 0000060
+CONSTANT:   CS5   OCT: 0000000
+CONSTANT:   CS6   OCT: 0000020
+CONSTANT:   CS7   OCT: 0000040
+CONSTANT:   CS8   OCT: 0000060
+CONSTANT: CSTOPB  OCT: 0000100
+CONSTANT: CREAD   OCT: 0000200
+CONSTANT: PARENB  OCT: 0000400
+CONSTANT: PARODD  OCT: 0001000
+CONSTANT: HUPCL   OCT: 0002000
+CONSTANT: CLOCAL  OCT: 0004000
+CONSTANT: CIBAUD  OCT: 002003600000
+CONSTANT: CRTSCTS OCT: 020000000000
 
 ! lflags
-: ISIG    OCT: 0000001 ; inline
-: ICANON  OCT: 0000002 ; inline
-: XCASE  OCT: 0000004 ; inline
-: ECHO    OCT: 0000010 ; inline
-: ECHOE   OCT: 0000020 ; inline
-: ECHOK   OCT: 0000040 ; inline
-: ECHONL  OCT: 0000100 ; inline
-: NOFLSH  OCT: 0000200 ; inline
-: TOSTOP  OCT: 0000400 ; inline
-: ECHOCTL OCT: 0001000 ; inline
-: ECHOPRT OCT: 0002000 ; inline
-: ECHOKE  OCT: 0004000 ; inline
-: FLUSHO  OCT: 0010000 ; inline
-: PENDIN  OCT: 0040000 ; inline
-: IEXTEN  OCT: 0100000 ; inline
+CONSTANT: ISIG    OCT: 0000001
+CONSTANT: ICANON  OCT: 0000002
+CONSTANT: XCASE  OCT: 0000004
+CONSTANT: ECHO    OCT: 0000010
+CONSTANT: ECHOE   OCT: 0000020
+CONSTANT: ECHOK   OCT: 0000040
+CONSTANT: ECHONL  OCT: 0000100
+CONSTANT: NOFLSH  OCT: 0000200
+CONSTANT: TOSTOP  OCT: 0000400
+CONSTANT: ECHOCTL OCT: 0001000
+CONSTANT: ECHOPRT OCT: 0002000
+CONSTANT: ECHOKE  OCT: 0004000
+CONSTANT: FLUSHO  OCT: 0010000
+CONSTANT: PENDIN  OCT: 0040000
+CONSTANT: IEXTEN  OCT: 0100000
 
 M: linux lookup-baud ( n -- n )
     dup H{
@@ -127,4 +127,4 @@ M: linux lookup-baud ( n -- n )
         { 3000000 OCT: 0010015 }
         { 3500000 OCT: 0010016 }
         { 4000000 OCT: 0010017 }
-    } at* [ nip ] [ drop invalid-baud ] if ;
+    } ?at [ invalid-baud ] unless ;
index 414ec9843870589956417cee77814bf01d82b5ff..63d0157780e3e1b9e7812b41df895fa1e98dde0a 100644 (file)
@@ -3,7 +3,7 @@
 USING: alien.syntax kernel sequences system ;
 IN: io.serial.unix.termios
 
-: NCCS 20 ; inline
+CONSTANT: NCCS 20
 
 TYPEDEF: uint tcflag_t
 TYPEDEF: uchar cc_t
index c7da10a6f5267fde6d68843ab980419cf6858bf8..4b8c52c7fb8d06f98e9163bcfa76b570881d49cc 100644 (file)
@@ -3,7 +3,7 @@
 USING: alien.syntax kernel system unix ;
 IN: io.serial.unix.termios
 
-: NCCS 32 ; inline
+CONSTANT: NCCS 32
 
 TYPEDEF: uchar cc_t
 TYPEDEF: uint speed_t
index 6dd056feb5aeb12c4f13fe6616dc33373a5695f4..e9b8d78e4b7fd9ffd5540026bd5b13bf94cb4590 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel math.bitwise serial serial.unix ;
+USING: accessors kernel math.bitwise io.serial io.serial.unix ;
 IN: io.serial.unix
 
 : serial-obj ( -- obj )
index 1da6385f96633ae7dcf1470d60480cec225d4ea2..1ba8031dfc25ec5e70693f701cc0a770008563ea 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.syntax combinators io.ports
-io.streams.duplex io.unix.backend system kernel math math.bitwise
-vocabs.loader unix io.serial io.serial.unix.termios ;
+io.streams.duplex system kernel math math.bitwise
+vocabs.loader unix io.serial io.serial.unix.termios io.backend.unix ;
 IN: io.serial.unix
 
 << {
@@ -31,8 +31,9 @@ FUNCTION: int cfsetspeed ( termios* t, speed_t s ) ;
 : <file-rw> ( path -- stream ) open-rw fd>duplex-stream ;
 
 M: unix open-serial ( serial -- serial' )
+    dup
     path>> { O_RDWR O_NOCTTY O_NDELAY } flags file-mode open-file
-    fd>duplex-stream ;
+    fd>duplex-stream >>stream ;
 
 : serial-fd ( serial -- fd )
     stream>> in>> handle>> fd>> ;
diff --git a/extra/io/serial/windows/authors.txt b/extra/io/serial/windows/authors.txt
new file mode 100755 (executable)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/extra/io/serial/windows/tags.txt b/extra/io/serial/windows/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/extra/io/serial/windows/windows.factor b/extra/io/serial/windows/windows.factor
new file mode 100755 (executable)
index 0000000..2d27a48
--- /dev/null
@@ -0,0 +1,22 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.files.windows io.streams.duplex kernel math
+math.bitwise windows.kernel32 accessors alien.c-types
+windows io.files.windows fry locals continuations ;
+IN: io.serial.windows
+
+: <serial-stream> ( path encoding -- duplex )
+    [ open-r/w dup ] dip <encoder-duplex> ;
+
+: get-comm-state ( duplex -- dcb )
+    in>> handle>>
+    "DCB" <c-object> tuck
+    GetCommState win32-error=0/f ;
+
+: set-comm-state ( duplex dcb -- )
+    [ in>> handle>> ] dip
+    SetCommState win32-error=0/f ;
+
+:: with-comm-state ( duplex quot: ( dcb -- ) -- )
+    duplex get-comm-state :> dcb
+    dcb clone quot curry [ dcb set-comm-state ] recover ; inline
index 465c55c833807d1b8193cc3c580d9ea50bbefc4a..cd9eea140937d3112b9ab39c0450178ad39544aa 100644 (file)
@@ -2,117 +2,117 @@ USING: iokit alien alien.syntax alien.c-types kernel
 system core-foundation ;
 IN: iokit.hid
 
-: kIOHIDDeviceKey "IOHIDDevice" ; inline
-
-: kIOHIDTransportKey                  "Transport" ; inline
-: kIOHIDVendorIDKey                   "VendorID" ; inline
-: kIOHIDVendorIDSourceKey             "VendorIDSource" ; inline
-: kIOHIDProductIDKey                  "ProductID" ; inline
-: kIOHIDVersionNumberKey              "VersionNumber" ; inline
-: kIOHIDManufacturerKey               "Manufacturer" ; inline
-: kIOHIDProductKey                    "Product" ; inline
-: kIOHIDSerialNumberKey               "SerialNumber" ; inline
-: kIOHIDCountryCodeKey                "CountryCode" ; inline
-: kIOHIDLocationIDKey                 "LocationID" ; inline
-: kIOHIDDeviceUsageKey                "DeviceUsage" ; inline
-: kIOHIDDeviceUsagePageKey            "DeviceUsagePage" ; inline
-: kIOHIDDeviceUsagePairsKey           "DeviceUsagePairs" ; inline
-: kIOHIDPrimaryUsageKey               "PrimaryUsage" ; inline
-: kIOHIDPrimaryUsagePageKey           "PrimaryUsagePage" ; inline
-: kIOHIDMaxInputReportSizeKey         "MaxInputReportSize" ; inline
-: kIOHIDMaxOutputReportSizeKey       "MaxOutputReportSize" ; inline
-: kIOHIDMaxFeatureReportSizeKey       "MaxFeatureReportSize" ; inline
-: kIOHIDReportIntervalKey             "ReportInterval" ; inline
-
-: kIOHIDElementKey                    "Elements" ; inline
-
-: kIOHIDElementCookieKey                      "ElementCookie" ; inline
-: kIOHIDElementTypeKey                        "Type" ; inline
-: kIOHIDElementCollectionTypeKey              "CollectionType" ; inline
-: kIOHIDElementUsageKey                       "Usage" ; inline
-: kIOHIDElementUsagePageKey                   "UsagePage" ; inline
-: kIOHIDElementMinKey                         "Min" ; inline
-: kIOHIDElementMaxKey                         "Max" ; inline
-: kIOHIDElementScaledMinKey                   "ScaledMin" ; inline
-: kIOHIDElementScaledMaxKey                   "ScaledMax" ; inline
-: kIOHIDElementSizeKey                        "Size" ; inline
-: kIOHIDElementReportSizeKey                  "ReportSize" ; inline
-: kIOHIDElementReportCountKey                 "ReportCount" ; inline
-: kIOHIDElementReportIDKey                    "ReportID" ; inline
-: kIOHIDElementIsArrayKey                     "IsArray" ; inline
-: kIOHIDElementIsRelativeKey                  "IsRelative" ; inline
-: kIOHIDElementIsWrappingKey                  "IsWrapping" ; inline
-: kIOHIDElementIsNonLinearKey                 "IsNonLinear" ; inline
-: kIOHIDElementHasPreferredStateKey           "HasPreferredState" ; inline
-: kIOHIDElementHasNullStateKey                "HasNullState" ; inline
-: kIOHIDElementFlagsKey                       "Flags" ; inline
-: kIOHIDElementUnitKey                        "Unit" ; inline
-: kIOHIDElementUnitExponentKey                "UnitExponent" ; inline
-: kIOHIDElementNameKey                        "Name" ; inline
-: kIOHIDElementValueLocationKey               "ValueLocation" ; inline
-: kIOHIDElementDuplicateIndexKey              "DuplicateIndex" ; inline
-: kIOHIDElementParentCollectionKey            "ParentCollection" ; inline
+CONSTANT: kIOHIDDeviceKey "IOHIDDevice"
+
+CONSTANT: kIOHIDTransportKey                  "Transport"
+CONSTANT: kIOHIDVendorIDKey                   "VendorID"
+CONSTANT: kIOHIDVendorIDSourceKey             "VendorIDSource"
+CONSTANT: kIOHIDProductIDKey                  "ProductID"
+CONSTANT: kIOHIDVersionNumberKey              "VersionNumber"
+CONSTANT: kIOHIDManufacturerKey               "Manufacturer"
+CONSTANT: kIOHIDProductKey                    "Product"
+CONSTANT: kIOHIDSerialNumberKey               "SerialNumber"
+CONSTANT: kIOHIDCountryCodeKey                "CountryCode"
+CONSTANT: kIOHIDLocationIDKey                 "LocationID"
+CONSTANT: kIOHIDDeviceUsageKey                "DeviceUsage"
+CONSTANT: kIOHIDDeviceUsagePageKey            "DeviceUsagePage"
+CONSTANT: kIOHIDDeviceUsagePairsKey           "DeviceUsagePairs"
+CONSTANT: kIOHIDPrimaryUsageKey               "PrimaryUsage"
+CONSTANT: kIOHIDPrimaryUsagePageKey           "PrimaryUsagePage"
+CONSTANT: kIOHIDMaxInputReportSizeKey         "MaxInputReportSize"
+CONSTANT: kIOHIDMaxOutputReportSizeKey       "MaxOutputReportSize"
+CONSTANT: kIOHIDMaxFeatureReportSizeKey       "MaxFeatureReportSize"
+CONSTANT: kIOHIDReportIntervalKey             "ReportInterval"
+
+CONSTANT: kIOHIDElementKey                    "Elements"
+
+CONSTANT: kIOHIDElementCookieKey                      "ElementCookie"
+CONSTANT: kIOHIDElementTypeKey                        "Type"
+CONSTANT: kIOHIDElementCollectionTypeKey              "CollectionType"
+CONSTANT: kIOHIDElementUsageKey                       "Usage"
+CONSTANT: kIOHIDElementUsagePageKey                   "UsagePage"
+CONSTANT: kIOHIDElementMinKey                         "Min"
+CONSTANT: kIOHIDElementMaxKey                         "Max"
+CONSTANT: kIOHIDElementScaledMinKey                   "ScaledMin"
+CONSTANT: kIOHIDElementScaledMaxKey                   "ScaledMax"
+CONSTANT: kIOHIDElementSizeKey                        "Size"
+CONSTANT: kIOHIDElementReportSizeKey                  "ReportSize"
+CONSTANT: kIOHIDElementReportCountKey                 "ReportCount"
+CONSTANT: kIOHIDElementReportIDKey                    "ReportID"
+CONSTANT: kIOHIDElementIsArrayKey                     "IsArray"
+CONSTANT: kIOHIDElementIsRelativeKey                  "IsRelative"
+CONSTANT: kIOHIDElementIsWrappingKey                  "IsWrapping"
+CONSTANT: kIOHIDElementIsNonLinearKey                 "IsNonLinear"
+CONSTANT: kIOHIDElementHasPreferredStateKey           "HasPreferredState"
+CONSTANT: kIOHIDElementHasNullStateKey                "HasNullState"
+CONSTANT: kIOHIDElementFlagsKey                       "Flags"
+CONSTANT: kIOHIDElementUnitKey                        "Unit"
+CONSTANT: kIOHIDElementUnitExponentKey                "UnitExponent"
+CONSTANT: kIOHIDElementNameKey                        "Name"
+CONSTANT: kIOHIDElementValueLocationKey               "ValueLocation"
+CONSTANT: kIOHIDElementDuplicateIndexKey              "DuplicateIndex"
+CONSTANT: kIOHIDElementParentCollectionKey            "ParentCollection"
 
 : kIOHIDElementVendorSpecificKey ( -- str )
     cpu ppc? "VendorSpecifc" "VendorSpecific" ? ; inline
 
-: kIOHIDElementCookieMinKey           "ElementCookieMin" ; inline
-: kIOHIDElementCookieMaxKey           "ElementCookieMax" ; inline
-: kIOHIDElementUsageMinKey            "UsageMin" ; inline
-: kIOHIDElementUsageMaxKey            "UsageMax" ; inline
-
-: kIOHIDElementCalibrationMinKey              "CalibrationMin" ; inline
-: kIOHIDElementCalibrationMaxKey              "CalibrationMax" ; inline
-: kIOHIDElementCalibrationSaturationMinKey    "CalibrationSaturationMin" ; inline
-: kIOHIDElementCalibrationSaturationMaxKey    "CalibrationSaturationMax" ; inline
-: kIOHIDElementCalibrationDeadZoneMinKey      "CalibrationDeadZoneMin" ; inline
-: kIOHIDElementCalibrationDeadZoneMaxKey      "CalibrationDeadZoneMax" ; inline
-: kIOHIDElementCalibrationGranularityKey      "CalibrationGranularity" ; inline
-
-: kIOHIDElementTypeInput_Misc        1 ; inline
-: kIOHIDElementTypeInput_Button      2 ; inline
-: kIOHIDElementTypeInput_Axis        3 ; inline
-: kIOHIDElementTypeInput_ScanCodes   4 ; inline
-: kIOHIDElementTypeOutput            129 ; inline
-: kIOHIDElementTypeFeature           257 ; inline
-: kIOHIDElementTypeCollection        513 ; inline
-
-: kIOHIDElementCollectionTypePhysical     HEX: 00 ; inline
-: kIOHIDElementCollectionTypeApplication    HEX: 01 ; inline
-: kIOHIDElementCollectionTypeLogical        HEX: 02 ; inline
-: kIOHIDElementCollectionTypeReport         HEX: 03 ; inline
-: kIOHIDElementCollectionTypeNamedArray     HEX: 04 ; inline
-: kIOHIDElementCollectionTypeUsageSwitch    HEX: 05 ; inline
-: kIOHIDElementCollectionTypeUsageModifier  HEX: 06 ; inline
-
-: kIOHIDReportTypeInput    0 ; inline
-: kIOHIDReportTypeOutput   1 ; inline
-: kIOHIDReportTypeFeature  2 ; inline
-: kIOHIDReportTypeCount    3 ; inline
-
-: kIOHIDOptionsTypeNone        HEX: 00 ; inline
-: kIOHIDOptionsTypeSeizeDevice HEX: 01 ; inline
-
-: kIOHIDQueueOptionsTypeNone    HEX: 00 ; inline
-: kIOHIDQueueOptionsTypeEnqueueAll HEX: 01 ; inline
-
-: kIOHIDElementFlagsConstantMask        HEX: 0001 ; inline
-: kIOHIDElementFlagsVariableMask        HEX: 0002 ; inline
-: kIOHIDElementFlagsRelativeMask        HEX: 0004 ; inline
-: kIOHIDElementFlagsWrapMask            HEX: 0008 ; inline
-: kIOHIDElementFlagsNonLinearMask       HEX: 0010 ; inline
-: kIOHIDElementFlagsNoPreferredMask     HEX: 0020 ; inline
-: kIOHIDElementFlagsNullStateMask       HEX: 0040 ; inline
-: kIOHIDElementFlagsVolativeMask        HEX: 0080 ; inline
-: kIOHIDElementFlagsBufferedByteMask    HEX: 0100 ; inline
-
-: kIOHIDValueScaleTypeCalibrated 0 ; inline
-: kIOHIDValueScaleTypePhysical   1 ; inline
-
-: kIOHIDTransactionDirectionTypeInput  0 ; inline
-: kIOHIDTransactionDirectionTypeOutput 1 ; inline
-
-: kIOHIDTransactionOptionDefaultOutputValue 1 ; inline
+CONSTANT: kIOHIDElementCookieMinKey           "ElementCookieMin"
+CONSTANT: kIOHIDElementCookieMaxKey           "ElementCookieMax"
+CONSTANT: kIOHIDElementUsageMinKey            "UsageMin"
+CONSTANT: kIOHIDElementUsageMaxKey            "UsageMax"
+
+CONSTANT: kIOHIDElementCalibrationMinKey              "CalibrationMin"
+CONSTANT: kIOHIDElementCalibrationMaxKey              "CalibrationMax"
+CONSTANT: kIOHIDElementCalibrationSaturationMinKey    "CalibrationSaturationMin"
+CONSTANT: kIOHIDElementCalibrationSaturationMaxKey    "CalibrationSaturationMax"
+CONSTANT: kIOHIDElementCalibrationDeadZoneMinKey      "CalibrationDeadZoneMin"
+CONSTANT: kIOHIDElementCalibrationDeadZoneMaxKey      "CalibrationDeadZoneMax"
+CONSTANT: kIOHIDElementCalibrationGranularityKey      "CalibrationGranularity"
+
+CONSTANT: kIOHIDElementTypeInput_Misc        1
+CONSTANT: kIOHIDElementTypeInput_Button      2
+CONSTANT: kIOHIDElementTypeInput_Axis        3
+CONSTANT: kIOHIDElementTypeInput_ScanCodes   4
+CONSTANT: kIOHIDElementTypeOutput            129
+CONSTANT: kIOHIDElementTypeFeature           257
+CONSTANT: kIOHIDElementTypeCollection        513
+
+CONSTANT: kIOHIDElementCollectionTypePhysical     HEX: 00
+CONSTANT: kIOHIDElementCollectionTypeApplication    HEX: 01
+CONSTANT: kIOHIDElementCollectionTypeLogical        HEX: 02
+CONSTANT: kIOHIDElementCollectionTypeReport         HEX: 03
+CONSTANT: kIOHIDElementCollectionTypeNamedArray     HEX: 04
+CONSTANT: kIOHIDElementCollectionTypeUsageSwitch    HEX: 05
+CONSTANT: kIOHIDElementCollectionTypeUsageModifier  HEX: 06
+
+CONSTANT: kIOHIDReportTypeInput    0
+CONSTANT: kIOHIDReportTypeOutput   1
+CONSTANT: kIOHIDReportTypeFeature  2
+CONSTANT: kIOHIDReportTypeCount    3
+
+CONSTANT: kIOHIDOptionsTypeNone        HEX: 00
+CONSTANT: kIOHIDOptionsTypeSeizeDevice HEX: 01
+
+CONSTANT: kIOHIDQueueOptionsTypeNone    HEX: 00
+CONSTANT: kIOHIDQueueOptionsTypeEnqueueAll HEX: 01
+
+CONSTANT: kIOHIDElementFlagsConstantMask        HEX: 0001
+CONSTANT: kIOHIDElementFlagsVariableMask        HEX: 0002
+CONSTANT: kIOHIDElementFlagsRelativeMask        HEX: 0004
+CONSTANT: kIOHIDElementFlagsWrapMask            HEX: 0008
+CONSTANT: kIOHIDElementFlagsNonLinearMask       HEX: 0010
+CONSTANT: kIOHIDElementFlagsNoPreferredMask     HEX: 0020
+CONSTANT: kIOHIDElementFlagsNullStateMask       HEX: 0040
+CONSTANT: kIOHIDElementFlagsVolativeMask        HEX: 0080
+CONSTANT: kIOHIDElementFlagsBufferedByteMask    HEX: 0100
+
+CONSTANT: kIOHIDValueScaleTypeCalibrated 0
+CONSTANT: kIOHIDValueScaleTypePhysical   1
+
+CONSTANT: kIOHIDTransactionDirectionTypeInput  0
+CONSTANT: kIOHIDTransactionDirectionTypeOutput 1
+
+CONSTANT: kIOHIDTransactionOptionDefaultOutputValue 1
 
 TYPEDEF: ptrdiff_t IOHIDElementCookie
 TYPEDEF: int IOHIDElementType
index 2317d21ed58ea97df481132c608e1c4654b33580..3fb14e8ec5197d3dd7eb18c7610d1443c2f6c6c9 100755 (executable)
@@ -9,95 +9,95 @@ IN: iokit
     when
 >>
 
-: kIOKitBuildVersionKey   "IOKitBuildVersion" ; inline
-: kIOKitDiagnosticsKey   "IOKitDiagnostics" ; inline
+CONSTANT: kIOKitBuildVersionKey   "IOKitBuildVersion"
+CONSTANT: kIOKitDiagnosticsKey   "IOKitDiagnostics"
  
-: kIORegistryPlanesKey   "IORegistryPlanes" ; inline
-: kIOCatalogueKey    "IOCatalogue" ; inline
+CONSTANT: kIORegistryPlanesKey   "IORegistryPlanes"
+CONSTANT: kIOCatalogueKey    "IOCatalogue"
 
-: kIOServicePlane    "IOService" ; inline
-: kIOPowerPlane    "IOPower" ; inline
-: kIODeviceTreePlane   "IODeviceTree" ; inline
-: kIOAudioPlane    "IOAudio" ; inline
-: kIOFireWirePlane   "IOFireWire" ; inline
-: kIOUSBPlane    "IOUSB" ; inline
+CONSTANT: kIOServicePlane    "IOService"
+CONSTANT: kIOPowerPlane    "IOPower"
+CONSTANT: kIODeviceTreePlane   "IODeviceTree"
+CONSTANT: kIOAudioPlane    "IOAudio"
+CONSTANT: kIOFireWirePlane   "IOFireWire"
+CONSTANT: kIOUSBPlane    "IOUSB"
 
-: kIOServiceClass    "IOService" ; inline
+CONSTANT: kIOServiceClass    "IOService"
 
-: kIOResourcesClass   "IOResources" ; inline
+CONSTANT: kIOResourcesClass   "IOResources"
 
-: kIOClassKey    "IOClass" ; inline
-: kIOProbeScoreKey   "IOProbeScore" ; inline
-: kIOKitDebugKey    "IOKitDebug" ; inline
+CONSTANT: kIOClassKey    "IOClass"
+CONSTANT: kIOProbeScoreKey   "IOProbeScore"
+CONSTANT: kIOKitDebugKey    "IOKitDebug"
 
-: kIOProviderClassKey   "IOProviderClass" ; inline
-: kIONameMatchKey    "IONameMatch" ; inline
-: kIOPropertyMatchKey   "IOPropertyMatch" ; inline
-: kIOPathMatchKey    "IOPathMatch" ; inline
-: kIOLocationMatchKey   "IOLocationMatch" ; inline
-: kIOParentMatchKey   "IOParentMatch" ; inline
-: kIOResourceMatchKey   "IOResourceMatch" ; inline
-: kIOMatchedServiceCountKey  "IOMatchedServiceCountMatch" ; inline
+CONSTANT: kIOProviderClassKey   "IOProviderClass"
+CONSTANT: kIONameMatchKey    "IONameMatch"
+CONSTANT: kIOPropertyMatchKey   "IOPropertyMatch"
+CONSTANT: kIOPathMatchKey    "IOPathMatch"
+CONSTANT: kIOLocationMatchKey   "IOLocationMatch"
+CONSTANT: kIOParentMatchKey   "IOParentMatch"
+CONSTANT: kIOResourceMatchKey   "IOResourceMatch"
+CONSTANT: kIOMatchedServiceCountKey  "IOMatchedServiceCountMatch"
 
-: kIONameMatchedKey   "IONameMatched" ; inline
+CONSTANT: kIONameMatchedKey   "IONameMatched"
 
-: kIOMatchCategoryKey   "IOMatchCategory" ; inline
-: kIODefaultMatchCategoryKey  "IODefaultMatchCategory" ; inline
+CONSTANT: kIOMatchCategoryKey   "IOMatchCategory"
+CONSTANT: kIODefaultMatchCategoryKey  "IODefaultMatchCategory"
 
-: kIOUserClientClassKey   "IOUserClientClass" ; inline
+CONSTANT: kIOUserClientClassKey   "IOUserClientClass"
 
-: kIOUserClientCrossEndianKey   "IOUserClientCrossEndian" ; inline
-: kIOUserClientCrossEndianCompatibleKey  "IOUserClientCrossEndianCompatible" ; inline
-: kIOUserClientSharedInstanceKey   "IOUserClientSharedInstance" ; inline
+CONSTANT: kIOUserClientCrossEndianKey   "IOUserClientCrossEndian"
+CONSTANT: kIOUserClientCrossEndianCompatibleKey  "IOUserClientCrossEndianCompatible"
+CONSTANT: kIOUserClientSharedInstanceKey   "IOUserClientSharedInstance"
 
-: kIOPublishNotification   "IOServicePublish" ; inline
-: kIOFirstPublishNotification  "IOServiceFirstPublish" ; inline
-: kIOMatchedNotification   "IOServiceMatched" ; inline
-: kIOFirstMatchNotification  "IOServiceFirstMatch" ; inline
-: kIOTerminatedNotification  "IOServiceTerminate" ; inline
+CONSTANT: kIOPublishNotification   "IOServicePublish"
+CONSTANT: kIOFirstPublishNotification  "IOServiceFirstPublish"
+CONSTANT: kIOMatchedNotification   "IOServiceMatched"
+CONSTANT: kIOFirstMatchNotification  "IOServiceFirstMatch"
+CONSTANT: kIOTerminatedNotification  "IOServiceTerminate"
 
-: kIOGeneralInterest   "IOGeneralInterest" ; inline
-: kIOBusyInterest    "IOBusyInterest" ; inline
-: kIOAppPowerStateInterest  "IOAppPowerStateInterest" ; inline
-: kIOPriorityPowerStateInterest  "IOPriorityPowerStateInterest" ; inline
+CONSTANT: kIOGeneralInterest   "IOGeneralInterest"
+CONSTANT: kIOBusyInterest    "IOBusyInterest"
+CONSTANT: kIOAppPowerStateInterest  "IOAppPowerStateInterest"
+CONSTANT: kIOPriorityPowerStateInterest  "IOPriorityPowerStateInterest"
 
-: kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage" ; inline
+CONSTANT: kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage"
 
-: kIOCFPlugInTypesKey   "IOCFPlugInTypes" ; inline
+CONSTANT: kIOCFPlugInTypesKey   "IOCFPlugInTypes"
 
-: kIOCommandPoolSizeKey         "IOCommandPoolSize" ; inline
+CONSTANT: kIOCommandPoolSizeKey         "IOCommandPoolSize"
 
-: kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead" ; inline
-: kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite" ; inline
-: kIOMaximumByteCountReadKey "IOMaximumByteCountRead" ; inline
-: kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite" ; inline
-: kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead" ; inline
-: kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite" ; inline
-: kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead" ; inline
-: kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite" ; inline
-: kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount" ; inline
-: kIOMaximumSegmentAddressableBitCountKey "IOMaximumSegmentAddressableBitCount" ; inline
+CONSTANT: kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead"
+CONSTANT: kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite"
+CONSTANT: kIOMaximumByteCountReadKey "IOMaximumByteCountRead"
+CONSTANT: kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite"
+CONSTANT: kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead"
+CONSTANT: kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite"
+CONSTANT: kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead"
+CONSTANT: kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite"
+CONSTANT: kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount"
+CONSTANT: kIOMaximumSegmentAddressableBitCountKey "IOMaximumSegmentAddressableBitCount"
 
-: kIOIconKey "IOIcon" ; inline
-: kIOBundleResourceFileKey "IOBundleResourceFile" ; inline
+CONSTANT: kIOIconKey "IOIcon"
+CONSTANT: kIOBundleResourceFileKey "IOBundleResourceFile"
 
-: kIOBusBadgeKey "IOBusBadge" ; inline
-: kIODeviceIconKey "IODeviceIcon" ; inline
+CONSTANT: kIOBusBadgeKey "IOBusBadge"
+CONSTANT: kIODeviceIconKey "IODeviceIcon"
 
-: kIOPlatformSerialNumberKey  "IOPlatformSerialNumber"  ; inline
+CONSTANT: kIOPlatformSerialNumberKey  "IOPlatformSerialNumber" 
 
-: kIOPlatformUUIDKey  "IOPlatformUUID"  ; inline
+CONSTANT: kIOPlatformUUIDKey  "IOPlatformUUID" 
 
-: kIONVRAMDeletePropertyKey  "IONVRAM-DELETE-PROPERTY" ; inline
-: kIODTNVRAMPanicInfoKey   "aapl,panic-info" ; inline
+CONSTANT: kIONVRAMDeletePropertyKey  "IONVRAM-DELETE-PROPERTY"
+CONSTANT: kIODTNVRAMPanicInfoKey   "aapl,panic-info"
 
-: kIOBootDeviceKey "IOBootDevice"   ; inline
-: kIOBootDevicePathKey "IOBootDevicePath"  ; inline
-: kIOBootDeviceSizeKey "IOBootDeviceSize"  ; inline
+CONSTANT: kIOBootDeviceKey "IOBootDevice"  
+CONSTANT: kIOBootDevicePathKey "IOBootDevicePath" 
+CONSTANT: kIOBootDeviceSizeKey "IOBootDeviceSize" 
 
-: kOSBuildVersionKey   "OS Build Version" ; inline
+CONSTANT: kOSBuildVersionKey   "OS Build Version"
 
-: kNilOptions 0 ; inline
+CONSTANT: kNilOptions 0
 
 TYPEDEF: uint mach_port_t
 TYPEDEF: int kern_return_t
@@ -112,8 +112,8 @@ TYPEDEF: kern_return_t IOReturn
 
 TYPEDEF: uint IOOptionBits
 
-: MACH_PORT_NULL 0 ; inline
-: KERN_SUCCESS 0 ; inline
+CONSTANT: MACH_PORT_NULL 0
+CONSTANT: KERN_SUCCESS 0
 
 FUNCTION: IOReturn IOMasterPort ( mach_port_t bootstrap, mach_port_t* master ) ;
 
index 0eba6f6af572148cdd0a520691a354c778a53de7..2770471093d683cfc7c672c497c6a3e7408737de 100755 (executable)
@@ -12,7 +12,7 @@ IN: irc.client
 ! Setup and running objects
 ! ======================================
 
-: irc-port 6667 ; ! Default irc port
+CONSTANT: irc-port 6667 ! Default irc port
 
 TUPLE: irc-profile server port nickname password ;
 C: <irc-profile> irc-profile
index 59e4cf6cb4727e9d59881efb9e5ded70e502f9a8..791639d260f47eef55d33945281c6b903b996022 100755 (executable)
@@ -28,9 +28,9 @@ TUPLE: irc-tab < frame chat client window ;
 \r
 : write-color ( str color -- )\r
     foreground associate format ;\r
-: dark-red T{ rgba f 0.5 0.0 0.0 1 } ;\r
-: dark-green T{ rgba f 0.0 0.5 0.0 1 } ;\r
-: dark-blue T{ rgba f 0.0 0.0 0.5 1 } ;\r
+CONSTANT: dark-red T{ rgba f 0.5 0.0 0.0 1 }\r
+CONSTANT: dark-green T{ rgba f 0.0 0.5 0.0 1 }\r
+CONSTANT: dark-blue T{ rgba f 0.0 0.0 0.5 1 }\r
 \r
 : dot-or-parens ( string -- string )\r
     [ "." ]\r
index 9e457c7bddeaabca17e2d41dd3195a45a589374c..188095dd2ec56d54952b91c109534861a52897b6 100755 (executable)
@@ -5,8 +5,8 @@ calendar locals strings ui.gadgets.buttons
 combinators math.parser assocs threads ;
 IN: joystick-demo
 
-: SIZE { 151 151 } ;
-: INDICATOR-SIZE { 4 4 } ;
+CONSTANT: SIZE { 151 151 }
+CONSTANT: INDICATOR-SIZE { 4 4 }
 : FREQUENCY ( -- f ) 30 recip seconds ;
 
 TUPLE: axis-gadget < gadget indicator z-indicator pov ;
@@ -21,7 +21,7 @@ M: axis-gadget pref-dim* drop SIZE ;
 : indicator-polygon ( -- polygon )
     { 0 0 } INDICATOR-SIZE (rect-polygon) ;
 
-: pov-polygons
+CONSTANT: pov-polygons
     V{
         { pov-neutral    { { 70 75 } { 75 70 } { 80 75 } { 75 80 } } }
         { pov-up         { { 70 65 } { 75 60 } { 80 65 } } }
@@ -32,7 +32,7 @@ M: axis-gadget pref-dim* drop SIZE ;
         { pov-down-left  { { 67 90 } { 60 90 } { 60 83 } } }
         { pov-left       { { 65 70 } { 60 75 } { 65 80 } } }
         { pov-up-left    { { 67 60 } { 60 60 } { 60 67 } } }
-    } ;
+    }
 
 : <indicator-gadget> ( color -- indicator )
     indicator-polygon <polygon-gadget> ;
index 05edb205d2e04c495b2998e2a3a1863e5487abfd..acf20f90ab1f3866556e1be2b5e3168cc1dd7f24 100755 (executable)
@@ -4,7 +4,7 @@ words arrays assocs math calendar fry alarms ui
 ui.gadgets.borders ui.gestures ;
 IN: key-caps
 
-: key-locations H{
+CONSTANT: key-locations H{
     { key-escape        { {   0   0 } {  10  10 } } }
 
     { key-f1            { {  20   0 } {  10  10 } } }
@@ -129,9 +129,9 @@ IN: key-caps
 
     { key-keypad-0       { { 190 55 } {  20  10 } } }
     { key-keypad-.       { { 210 55 } {  10  10 } } }
-} ;
+}
 
-: KEYBOARD-SIZE { 230 65 } ;
+CONSTANT: KEYBOARD-SIZE { 230 65 }
 : FREQUENCY ( -- f ) 30 recip seconds ;
 
 TUPLE: key-caps-gadget < gadget keys alarm ;
index 849cc540a361c26da8b68d7b080f4e5ad32b1832..9877c700626d53e4945da172855eb3bebf0a28b7 100755 (executable)
@@ -42,7 +42,7 @@ SYMBOL: def-hash-keys
     set-alien-float alien-float
 } ;
 
-: trivial-defs
+: trivial-defs ( -- seq )
     {
         [ drop ] [ 2array ]
         [ bitand ]
index df85f01f2655ca283aa805480a9a41f108702d1e..43b5b78097575cad15049fa4875e2c36e156f562 100644 (file)
@@ -1,7 +1,7 @@
 USING: arrays kernel xml-rpc ;
 IN: lisppaste
 
-: url "http://www.common-lisp.net:8185/RPC2" ;
+CONSTANT: url "http://www.common-lisp.net:8185/RPC2"
 
 : channels ( -- seq )
     { } "listchannels" url invoke-method ;
index ae25c7549549ee18b7ce4a1ee0856a48ac2e8e9d..6525264f6a59815975a432734e8ef468a9fa6535 100644 (file)
@@ -1,19 +1,19 @@
 ! Copyright (C) 2008 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax multiline ;
+USING: help.markup help.syntax kernel multiline ;
 IN: literals
 
 HELP: $
 { $syntax "$ word" }
 { $description "Executes " { $snippet "word" } " at parse time and adds the result(s) to the parser accumulator." }
-{ $notes "Since " { $snippet "word" } " is executed at parse time, " { $snippet "$" } " cannot be used with words defined in the same compilation unit." }
+{ $notes { $snippet "word" } "'s definition is looked up and " { $link call } "ed at parse time, so words that reference words in the current compilation unit cannot be used with " { $snippet "$" } "." }
 { $examples
 
     { $example <"
 USING: kernel literals prettyprint ;
 IN: scratchpad
 
-<< : five 5 ; >>
+CONSTANT: five 5
 { $ five } .
     "> "{ 5 }" }
 
@@ -30,7 +30,7 @@ IN: scratchpad
 HELP: $[
 { $syntax "$[ code ]" }
 { $description "Calls " { $snippet "code" } " at parse time and adds the result(s) to the parser accumulator." }
-{ $notes "Since " { $snippet "code" } " is executed at parse time, it cannot reference any words defined in the same compilation unit." }
+{ $notes "Since " { $snippet "code" } " is " { $link call } "ed at parse time, it cannot reference any words defined in the same compilation unit." }
 { $examples
 
     { $example <"
index 34ea4d6415f730d5d11d15501d6c2534e96d5a4b..0e933d520912d35c31838dfd3a26b8313e3ac043 100644 (file)
@@ -2,11 +2,12 @@ USING: kernel literals math tools.test ;
 IN: literals.tests
 
 <<
-: five 5 ;
-: seven-eleven 7 11 ;
 : six-six-six 6 6 6 ;
 >>
 
+: five 5 ;
+: seven-eleven 7 11 ;
+
 [ { 5 } ] [ { $ five } ] unit-test
 [ { 7 11 } ] [ { $ seven-eleven } ] unit-test
 [ { 6 6 6 } ] [ { $ six-six-six } ] unit-test
index 6df51a35ef87875545adc938daac420ef2b665b6..d3cfcaae23e472de898e35251edfe55810b0554c 100644 (file)
@@ -1,6 +1,6 @@
 ! (c) Joe Groff, see license for details
-USING: continuations kernel parser words quotations vectors ;
+USING: accessors continuations kernel parser words quotations vectors ;
 IN: literals
 
-: $ scan-word [ execute ] curry with-datastack >vector ; parsing
+: $ scan-word [ def>> call ] curry with-datastack >vector ; parsing
 : $[ \ ] parse-until >quotation with-datastack >vector ; parsing
index ec0cbdbc9c4e92bc96cccf4bd37e20cddffc06ac..3cd38e1ff406ef85ba38391569316603786b9092 100644 (file)
@@ -67,24 +67,24 @@ SYMBOL: stamp
 : ?prepare-build-machine ( -- )
     builds/factor exists? [ prepare-build-machine ] unless ;
 
-: load-everything-vocabs-file "load-everything-vocabs" ;
-: load-everything-errors-file "load-everything-errors" ;
+CONSTANT: load-everything-vocabs-file "load-everything-vocabs"
+CONSTANT: load-everything-errors-file "load-everything-errors"
 
-: test-all-vocabs-file "test-all-vocabs" ;
-: test-all-errors-file "test-all-errors" ;
+CONSTANT: test-all-vocabs-file "test-all-vocabs"
+CONSTANT: test-all-errors-file "test-all-errors"
 
-: help-lint-vocabs-file "help-lint-vocabs" ;
-: help-lint-errors-file "help-lint-errors" ;
+CONSTANT: help-lint-vocabs-file "help-lint-vocabs"
+CONSTANT: help-lint-errors-file "help-lint-errors"
 
-: boot-time-file "boot-time" ;
-: load-time-file "load-time" ;
-: compiler-errors-file "compiler-errors" ;
-: test-time-file "test-time" ;
-: help-lint-time-file "help-lint-time" ;
-: benchmark-time-file "benchmark-time" ;
-: html-help-time-file "html-help-time" ;
+CONSTANT: boot-time-file "boot-time"
+CONSTANT: load-time-file "load-time"
+CONSTANT: compiler-errors-file "compiler-errors"
+CONSTANT: test-time-file "test-time"
+CONSTANT: help-lint-time-file "help-lint-time"
+CONSTANT: benchmark-time-file "benchmark-time"
+CONSTANT: html-help-time-file "html-help-time"
 
-: benchmarks-file "benchmarks" ;
+CONSTANT: benchmarks-file "benchmarks"
 
 SYMBOL: status
 
index b5f6a547bac77064cc8c259665e68715842a0fde..fa01b0376dcde26bc98664a6aec6f5f7e384c403 100755 (executable)
@@ -9,13 +9,13 @@ IN: math.analysis
 ! http://www.rskey.org/gamma.htm  "Lanczos Approximation"
 ! n=6: error ~ 3 x 10^-11
 
-: gamma-g6 5.15 ; inline
+CONSTANT: gamma-g6 5.15
 
-: gamma-p6
+CONSTANT: gamma-p6
     {
         2.50662827563479526904 225.525584619175212544 -268.295973841304927459
         80.9030806934622512966 -5.00757863970517583837 0.0114684895434781459556
-    } ; inline
+    }
 
 : gamma-z ( x n -- seq )
     [ + recip ] with map 1.0 0 pick set-nth ;
diff --git a/extra/math/derivatives/authors.txt b/extra/math/derivatives/authors.txt
new file mode 100644 (file)
index 0000000..b6089d8
--- /dev/null
@@ -0,0 +1 @@
+Jason W. Merrill
\ No newline at end of file
diff --git a/extra/math/derivatives/derivatives-docs.factor b/extra/math/derivatives/derivatives-docs.factor
new file mode 100644 (file)
index 0000000..4905f26
--- /dev/null
@@ -0,0 +1,11 @@
+! Copyright (C) 2009 Jason W. Merrill.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: math.derivatives
+
+ARTICLE: "math.derivatives" "Derivatives"
+"The " { $vocab-link "math.derivatives" } " vocabulary defines the derivative of many of the words in the " { $vocab-link "math" } " and " { $vocab-link "math.functions" } " vocabularies. The derivative for a word is given by a sequence of quotations stored in its " { $snippet "derivative" } " word property that give the partial derivative of the word with respect to each of its inputs."
+{ $see-also "math.derivatives.syntax" }
+;
+
+ABOUT: "math.derivatives"
diff --git a/extra/math/derivatives/derivatives.factor b/extra/math/derivatives/derivatives.factor
new file mode 100644 (file)
index 0000000..c6a9d1a
--- /dev/null
@@ -0,0 +1,53 @@
+! Copyright (C) 2009 Jason W. Merrill.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel math math.functions math.derivatives.syntax 
+    math.order math.parser summary accessors make combinators ;
+IN: math.derivatives
+
+ERROR: undefined-derivative point word ;
+M: undefined-derivative summary
+    [ dup "Derivative of " % word>> name>> % 
+    " is undefined at " % point>> # "." % ]
+    "" make ;
+
+DERIVATIVE: + [ 2drop ] [ 2drop ]
+DERIVATIVE: - [ 2drop ] [ 2drop neg ]
+DERIVATIVE: * [ nip * ] [ drop * ]
+DERIVATIVE: / [ nip / ] [ sq / neg * ]
+! Conditional checks if the epsilon-part of the exponent is 
+! 0 to avoid getting float answers for integer powers.
+DERIVATIVE: ^ [ [ 1 - ^ ] keep * * ] 
+    [ [ dup zero? ] 2dip [ 3drop 0 ] [ [ ^ ] keep log * * ] if ]
+
+DERIVATIVE: abs 
+    [ 0 <=> 
+        { 
+            { +lt+ [ neg ] } 
+            { +eq+ [ 0 \ abs undefined-derivative ] } 
+            { +gt+ [ ] } 
+        } case
+    ]
+
+DERIVATIVE: sqrt [ sqrt 2 * / ]
+
+DERIVATIVE: exp [ exp * ]
+DERIVATIVE: log [ / ]
+
+DERIVATIVE: sin [ cos * ]
+DERIVATIVE: cos [ sin neg * ]
+DERIVATIVE: tan [ sec sq * ]
+
+DERIVATIVE: sinh [ cosh * ]
+DERIVATIVE: cosh [ sinh * ]
+DERIVATIVE: tanh [ sech sq * ]
+
+DERIVATIVE: asin [ sq neg 1 + sqrt / ]
+DERIVATIVE: acos [ sq neg 1 + sqrt neg / ]
+DERIVATIVE: atan [ sq 1 + / ]
+
+DERIVATIVE: asinh [ sq 1 + sqrt / ]
+DERIVATIVE: acosh [ [ 1 + sqrt ] [ 1 - sqrt ] bi * / ]
+DERIVATIVE: atanh [ sq neg 1 + / ]
+
+DERIVATIVE: neg [ drop neg ]
+DERIVATIVE: recip [ sq recip neg * ]
diff --git a/extra/math/derivatives/syntax/authors.txt b/extra/math/derivatives/syntax/authors.txt
new file mode 100644 (file)
index 0000000..b6089d8
--- /dev/null
@@ -0,0 +1 @@
+Jason W. Merrill
\ No newline at end of file
diff --git a/extra/math/derivatives/syntax/syntax-docs.factor b/extra/math/derivatives/syntax/syntax-docs.factor
new file mode 100644 (file)
index 0000000..2273e7b
--- /dev/null
@@ -0,0 +1,18 @@
+! Copyright (C) 2009 Jason W. Merrill.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax ;
+IN: math.derivatives.syntax
+
+HELP: DERIVATIVE:
+{ $description "Defines the derivative of a word by setting its " { $snippet "derivative" } " word property.  Reads a word followed by " { $snippet "n" } " quotations, giving the " { $snippet "n" } " partial derivatives of the word with respect to each of its arguments successively.  Each quotation should take " { $snippet "n + 1" } " inputs, where the first input is an increment and the last " { $snippet "n" } " inputs are the point at which to evaluate the derivative.  The derivative should be a linear function of the increment, and should have the same number of outputs as the original word." }
+{ $examples 
+    { $unchecked-example "USING: math math.functions math.derivatives.syntax ;"
+    "DERIVATIVE: sin [ cos * ]"
+    "DERIVATIVE: * [ nip * ] [ drop * ]" "" }
+} ;
+
+ARTICLE: "math.derivatives.syntax" "Derivative Syntax"
+"The " { $vocab-link "math.derivatives.syntax" } " vocabulary provides the " { $link POSTPONE: DERIVATIVE: } " syntax for specifying the derivative of a word."
+;
+
+ABOUT: "math.derivatives.syntax"
diff --git a/extra/math/derivatives/syntax/syntax.factor b/extra/math/derivatives/syntax/syntax.factor
new file mode 100644 (file)
index 0000000..02b0608
--- /dev/null
@@ -0,0 +1,10 @@
+! Copyright (C) 2009 Jason W. Merrill.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel parser words effects accessors sequences 
+    math.ranges ;
+    
+IN: math.derivatives.syntax
+
+: DERIVATIVE: scan-object dup stack-effect in>> length [1,b] 
+    [ drop scan-object ] map 
+    "derivative" set-word-prop ; parsing
\ No newline at end of file
diff --git a/extra/math/dual/authors.txt b/extra/math/dual/authors.txt
new file mode 100644 (file)
index 0000000..b6089d8
--- /dev/null
@@ -0,0 +1 @@
+Jason W. Merrill
\ No newline at end of file
diff --git a/extra/math/dual/dual-docs.factor b/extra/math/dual/dual-docs.factor
new file mode 100644 (file)
index 0000000..67b3d6a
--- /dev/null
@@ -0,0 +1,53 @@
+! Copyright (C) 2009 Jason W. Merrill.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax kernel words math math.functions math.derivatives.syntax ;
+IN: math.dual
+
+HELP: <dual>
+{ $values
+    { "ordinary-part" real } { "epsilon-part" real }
+    { "dual" dual number }
+}
+{ $description "Creates a dual number from its ordinary and epsilon parts." } ;
+
+HELP: define-dual
+{ $values
+    { "word" word }
+}
+{ $description "Defines a word " { $snippet "d[word]" } " in the " { $vocab-link "math.dual" } " vocabulary that operates on dual numbers." }
+{ $notes "Uses the derivative word-prop, which holds a list of quotations giving the partial derivatives of the word with respect to each of its arguments.  This can be set using " { $link POSTPONE: DERIVATIVE: } "." } ;
+
+{ define-dual dual-op POSTPONE: DERIVATIVE: } related-words
+
+HELP: dual
+{ $class-description "The class of dual numbers with non-zero epsilon part." } ;
+
+HELP: dual-op
+{ $values
+    { "word" word }
+}
+{ $description "Similar to " { $link execute } ", but promotes word to operate on duals." }
+{ $notes "Uses the derivative word-prop, which holds a list of quotations giving the partial derivatives of the word with respect to each of its arguments. This can be set using " { $link POSTPONE: DERIVATIVE: } ". Once a derivative has been defined for a word, dual-op makes it easy to extend the definition to dual numbers." } 
+{ $examples 
+    { $unchecked-example "USING: math math.dual math.derivatives.syntax math.functions ;" 
+    "DERIVATIVE: sin [ cos * ]" 
+    "M: dual sin \\sin dual-op ;" "" }
+    { $unchecked-example "USING: math math.dual math.derivatives.syntax ;" 
+    "DERIVATIVE: * [ drop ] [ nip ]"
+    ": d* ( x y -- x*y ) \ * dual-op ;" "" }
+} ;
+
+HELP: unpack-dual
+{ $values
+    { "dual" dual }
+    { "ordinary-part" number } { "epsilon-part" number }
+}
+{ $description "Extracts the ordinary and epsilon part of a dual number." } ;
+
+ARTICLE: "math.dual" "Dual Numbers"
+"The " { $vocab-link "math.dual" } " vocabulary implements dual numbers, along with arithmetic methods for working with them. Many of the functions in " { $vocab-link "math.functions" } " are extended to work with dual numbers."
+$nl
+"Dual numbers are ordered pairs " { $snippet "<o,e>"} "--an ordinary part and an epsilon part--with component-wise addition and multiplication defined by "{ $snippet "<o1,e1>*<o2,e2> = <o1*o2,e1*o2 + e2*o1>" } ". They are analagous to complex numbers with " { $snippet "i^2 = 0" } "instead of " { $snippet "i^2 = -1" } ". For well-behaved functions " { $snippet "f" } ", " { $snippet "f(<o1,e1>) = f(o1) + e1*f'(o1)" } ", where " { $snippet "f'"} " is the derivative of " { $snippet "f" } "."
+;
+
+ABOUT: "math.dual"
diff --git a/extra/math/dual/dual-tests.factor b/extra/math/dual/dual-tests.factor
new file mode 100644 (file)
index 0000000..dbafe74
--- /dev/null
@@ -0,0 +1,16 @@
+! Copyright (C) 2009 Jason W. Merrill.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test math.dual kernel accessors math math.functions 
+    math.constants ;
+IN: math.dual.tests
+
+[ 0.0 1.0 ] [ 0 1 <dual> dsin unpack-dual ] unit-test
+[ 1.0 0.0 ] [ 0 1 <dual> dcos unpack-dual ] unit-test
+[ 3 5 ] [ 1 5 <dual> 2 d+ unpack-dual ] unit-test
+[ 0 -1 ] [ 1 5 <dual> 1 6 <dual> d- unpack-dual ] unit-test
+[ 2 1 ] [ 2 3 <dual> 1 -1 <dual> d* unpack-dual ] unit-test
+[ 1/2 -1/4 ] [ 2 1 <dual> 1 swap d/ unpack-dual ] unit-test
+[ 2 ] [ 1 1 <dual> 2 d^ epsilon-part>> ] unit-test
+[ 2.0 .25 ] [ 4 1 <dual> dsqrt unpack-dual ] unit-test
+[ 2 -1 ] [ -2 1 <dual> dabs unpack-dual ] unit-test
+[ -2 -1 ] [ 2 1 <dual> dneg unpack-dual ] unit-test
\ No newline at end of file
diff --git a/extra/math/dual/dual.factor b/extra/math/dual/dual.factor
new file mode 100644 (file)
index 0000000..3e0e543
--- /dev/null
@@ -0,0 +1,83 @@
+! Copyright (C) 2009 Jason W. Merrill.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel math math.functions math.derivatives accessors
+    macros generic compiler.units words effects vocabs
+    sequences arrays assocs generalizations fry make
+    combinators.smart help help.markup ;
+
+IN: math.dual
+
+TUPLE: dual ordinary-part epsilon-part ;
+
+C: <dual> dual
+
+! Ordinary numbers implement the dual protocol by returning 
+! themselves as the ordinary part, and 0 as the epsilon part.
+M: number ordinary-part>> ;
+
+M: number epsilon-part>> drop 0 ;
+
+: unpack-dual ( dual -- ordinary-part epsilon-part )
+    [ ordinary-part>> ] [ epsilon-part>> ] bi ;
+
+<PRIVATE
+
+: input-length ( word -- n ) stack-effect in>> length ;
+
+MACRO: ordinary-op ( word -- o )
+    [ input-length ] keep
+    '[ [ ordinary-part>> ] _ napply _ execute ] ;
+
+! Takes N dual numbers <o1,e1> <o2,e2> ... <oN,eN> and weaves 
+! their ordinary and epsilon parts to produce
+! e1 o1 o2 ... oN e2 o1 o2 ... oN ... eN o1 o2 ... oN
+! This allows a set of partial derivatives each to be evaluated 
+! at the same point.
+MACRO: duals>nweave ( n -- )
+   dup dup dup
+   '[
+       [ [ epsilon-part>> ] _ napply ]
+       _ nkeep
+       [ ordinary-part>> ] _ napply
+       _ nweave
+    ] ;
+
+MACRO: chain-rule ( word -- e )
+    [ input-length '[ _ duals>nweave ] ]
+    [ "derivative" word-prop ]
+    [ input-length 1+ '[ _ nspread ] ]
+    tri
+    '[ [ @ _ @ ] sum-outputs ] ;
+
+: set-dual-help ( word dword -- ) 
+    [ swap
+        [ stack-effect [ in>> ] [ out>> ] bi append 
+            [ dual ] { } map>assoc { $values } prepend
+        ]
+        [ [ { $description } % "Version of " , 
+                   { $link } swap suffix , 
+                   " extended to work on dual numbers." , ] 
+            { } make
+        ]
+        bi* 2array
+    ] keep set-word-help ;
+
+PRIVATE>
+
+MACRO: dual-op ( word -- )
+    [ '[ _ ordinary-op ] ]
+    [ input-length '[ _ nkeep ] ]
+    [ '[ _ chain-rule ] ]
+    tri
+    '[ _ @ @ <dual> ] ;
+
+: define-dual ( word -- )
+    dup name>> "d" prepend "math.dual" create
+    [ [ stack-effect ] dip set-stack-effect ]
+    [ set-dual-help ]
+    [ swap '[ _ dual-op ] define ]
+    2tri ;
+
+! Specialize math functions to operate on dual numbers.
+[ all-words [ "derivative" word-prop ] filter
+    [ define-dual ] each ] with-compilation-unit
\ No newline at end of file
index de345e732ec9d5cd3a66045d1ce662b64359532b..a490a8bbfca064f93ee5e41afce1c1eba42e1011 100644 (file)
@@ -4,7 +4,7 @@ arrays kernel random ui ui.gadgets ui.gadgets.canvas ui.render
 math.order math.geometry.rect ;
 IN: maze
 
-: line-width 8 ;
+CONSTANT: line-width 8
 
 SYMBOL: visited
 
index 25bad4061adc7fc63773cc5dc40c6976b63ea976..6f1df44bfb69f2d5ab00acabbf60e4837404e35c 100755 (executable)
@@ -2,7 +2,7 @@ USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize ;
 IN: minneapolis-talk
 
-: minneapolis-slides
+CONSTANT: minneapolis-slides
 {
     { $slide "What is Factor?"
         "Dynamically typed, stack language"
@@ -175,7 +175,7 @@ IN: minneapolis-talk
         "Mailing list: factor-talk@lists.sf.net"
     }
     { $slide "Questions?" }
-} ;
+}
 
 : minneapolis-talk ( -- ) minneapolis-slides slides-window ;
 
diff --git a/extra/minneapolis-talk/minneapolis-talk.txt b/extra/minneapolis-talk/minneapolis-talk.txt
deleted file mode 100755 (executable)
index 5310acc..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-- how to create a small module\r
-- editor integration\r
-- presentations\r
-- module system\r
-- copy and paste factoring, inverse\r
-- help system\r
-- tetris\r
-- memoization\r
-- editing inspector demo\r
-- dynamic scope, lexical scope\r
-\r
-Factor: contradictions?\r
------------------------\r
-\r
-Have our cake and eat it too\r
-\r
-Research -vs- practical\r
-High level -vs- fast\r
-Interactive -vs- deployment\r
-\r
-Factor from 10,000 feet\r
------------------------\r
-\r
-word: named function\r
-vocabulary: module\r
-quotation: anonymous function\r
-classes, objects, etc.\r
-\r
-The stack\r
----------\r
-\r
-- Stack -vs- applicative\r
-- Pass by reference, dynamically typed\r
-- Stack languages: you can omit names where they're not needed\r
-- More compositional style\r
-- If you need to name things for clarity, you can:\r
-  lexical vars, dynamic vars, sequences, assocs, objects...\r
-\r
-Functional programming\r
-----------------------\r
-\r
-Quotations\r
-Curry\r
-Continuations\r
-\r
-Object-oriented programming\r
----------------------------\r
-\r
-Generic words: sort of like open classes\r
-Tuple reshaping\r
-Editing inspector\r
-\r
-Meta programming\r
-----------------\r
-\r
-Simple, orthogonal core\r
-\r
-Why use a stack at all?\r
------------------------\r
-\r
-Nice idioms: 10 days ago\r
-Copy and paste factoring\r
-Easy meta-programming\r
-Sequence operations correspond to functional operations:\r
-- curry is adding at the front\r
-- compose is append\r
-\r
-UI\r
---\r
-\r
-Written in Factor\r
-renders with OpenGL\r
-Windows, X11, Cocoa backends\r
-You can call Windows, X11, Cocoa APIs directly\r
-OpenGL 2.1 shaders, OpenAL 3D audio...\r
-\r
-Tools\r
------\r
-\r
-Edit\r
-Usages\r
-Profiler\r
-Easy to make your own tools\r
-\r
-Implementation\r
---------------\r
-\r
-Two compilers\r
-Generational garbage collector\r
-Non-blocking I/O\r
-\r
-Hands on\r
---------\r
-\r
-Community\r
----------\r
-\r
-Factor started in 2003\r
-About a dozen contributors\r
-Handful of "core contributors"\r
-Web site: http://factorcode.org\r
-IRC: #concatenative on irc.freenode.net\r
-Mailing list: factor-talk@lists.sf.net\r
-\r
-C library interface\r
--------------------\r
-\r
-Efficient\r
-No need to write C code\r
-Supports floats, structs, unions, ...\r
-Function pointers, callbacks\r
-Here is an example\r
-\r
-TerminateProcess\r
-\r
-process-handle TerminateProcess\r
index 29d4ccffc1f17b832bfb19a197f679321dca4832..fdb53ef2541f2a7360d6c44d2b8f3be7394fa55f 100644 (file)
@@ -4,8 +4,8 @@ IN: nehe.2
 
 TUPLE: nehe2-gadget < gadget ;
 
-: width 256 ;
-: height 256 ;
+CONSTANT: width 256
+CONSTANT: height 256
 
 : <nehe2-gadget> (  -- gadget )
   nehe2-gadget new-gadget ;
index 75f2e573cc5a406718e339a3e03c59a2144f0ce0..557655a02917ec83016ba2097fc867063bed2cf9 100644 (file)
@@ -4,8 +4,8 @@ IN: nehe.3
 
 TUPLE: nehe3-gadget < gadget ;
 
-: width 256 ;
-: height 256 ;
+CONSTANT: width 256
+CONSTANT: height 256
 
 : <nehe3-gadget> (  -- gadget )
   nehe3-gadget new-gadget ;
index fda22d2f1e3c610068578f421821cef0ebd961f7..00308277ea8c6cb933ca90ba03e01f4ff4d84847 100644 (file)
@@ -5,8 +5,8 @@ IN: nehe.4
 
 TUPLE: nehe4-gadget < gadget rtri rquad thread quit? ;
 
-: width 256 ;
-: height 256 ;
+CONSTANT: width 256
+CONSTANT: height 256
 : redraw-interval ( -- dt ) 10 milliseconds ;
 
 : <nehe4-gadget> (  -- gadget )
index 30d0991fd890523392191bf5d84dd486ade8415f..3723014c83b5e060b889fc4f1e7737dab85acf4b 100755 (executable)
@@ -4,8 +4,8 @@ calendar ;
 IN: nehe.5\r
 \r
 TUPLE: nehe5-gadget < gadget rtri rquad thread quit? ;\r
-: width 256 ;\r
-: height 256 ;\r
+CONSTANT: width 256\r
+CONSTANT: height 256\r
 : redraw-interval ( -- dt ) 10 milliseconds ;\r
 \r
 : <nehe5-gadget> (  -- gadget )\r
index c8fe2b4882a1d9a59ad562664f8987dada4e2086..9f05482b30f75f161d279ccc9ec023a8f8987799 100755 (executable)
@@ -4,8 +4,8 @@ ui.render accessors combinators ;
 IN: opengl.demo-support
 
 : FOV ( -- x ) 2.0 sqrt 1+ ; inline
-: MOUSE-MOTION-SCALE 0.5 ; inline
-: KEY-ROTATE-STEP 10.0 ; inline
+CONSTANT: MOUSE-MOTION-SCALE 0.5
+CONSTANT: KEY-ROTATE-STEP 10.0
 
 SYMBOL: last-drag-loc
 
index b52749dbe1cdd5812f2d599aebe3b0bc06fe9118..ef5782dda731394c400ebec28c5d750e576d560b 100644 (file)
@@ -39,7 +39,7 @@ M: png-gadget ungraft* ( gadget -- )
 : $tetris ( element -- )
     drop [ <default-tetris> <tetris-gadget> gadget. ] ($block) ;
 
-: otug-slides
+CONSTANT: otug-slides
 {
     { $slide "Factor!"
         { $url "http://factorcode.org" }
@@ -361,7 +361,7 @@ var price = (order == null ? null : order.price);"> }
         "Factor has many cool things that I didn't talk about"
         "Questions?"
     }
-} ;
+}
 
 : otug-talk ( -- ) otug-slides slides-window ;
 
index a38bf33c3cc77ea67322b2310e98cc4985a3178c..643ffaa321d209faa2663deb99bdb18fc6b1c7d0 100755 (executable)
@@ -1,4 +1,3 @@
-text
 javascript
 parsing
 languages
index a38bf33c3cc77ea67322b2310e98cc4985a3178c..643ffaa321d209faa2663deb99bdb18fc6b1c7d0 100755 (executable)
@@ -1,4 +1,3 @@
-text
 javascript
 parsing
 languages
index a38bf33c3cc77ea67322b2310e98cc4985a3178c..643ffaa321d209faa2663deb99bdb18fc6b1c7d0 100755 (executable)
@@ -1,4 +1,3 @@
-text
 javascript
 parsing
 languages
index a38bf33c3cc77ea67322b2310e98cc4985a3178c..643ffaa321d209faa2663deb99bdb18fc6b1c7d0 100755 (executable)
@@ -1,4 +1,3 @@
-text
 javascript
 parsing
 languages
diff --git a/extra/serial/authors.txt b/extra/serial/authors.txt
deleted file mode 100644 (file)
index 7c1b2f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
diff --git a/extra/serial/serial.factor b/extra/serial/serial.factor
deleted file mode 100644 (file)
index 96900fb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types assocs combinators destructors
-kernel math math.bitwise math.parser sequences summary system
-vocabs.loader ;
-IN: serial
-
-TUPLE: serial stream path baud 
-    termios iflag oflag cflag lflag ;
-
-ERROR: invalid-baud baud ;
-M: invalid-baud summary ( invalid-baud -- string )
-    "Baud rate "
-    swap baud>> number>string
-    " not supported" 3append ;
-
-HOOK: lookup-baud os ( m -- n )
-HOOK: open-serial os ( serial -- serial' )
-M: serial dispose ( serial -- ) stream>> dispose ;
-
-{
-    { [ os unix? ] [ "serial.unix" ] } 
-    { [ os windows? ] [ "serial.windows" ] }
-} cond require
diff --git a/extra/serial/summary.txt b/extra/serial/summary.txt
deleted file mode 100644 (file)
index 5ccd99d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Serial port library
diff --git a/extra/serial/tags.txt b/extra/serial/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/unix/bsd/bsd.factor b/extra/serial/unix/bsd/bsd.factor
deleted file mode 100644 (file)
index d31d947..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel math.bitwise sequences system serial ;
-IN: serial.unix
-
-M: bsd lookup-baud ( m -- n )
-    dup {
-        0 50 75 110 134 150 200 300 600 1200 1800 2400 4800
-        7200 9600 14400 19200 28800 38400 57600 76800 115200
-        230400 460800 921600
-    } member? [ invalid-baud ] unless ;
-
-: TCSANOW     0 ; inline
-: TCSADRAIN   1 ; inline
-: TCSAFLUSH   2 ; inline
-: TCSASOFT    HEX: 10 ; inline
-
-: TCIFLUSH    1 ; inline
-: TCOFLUSH    2 ; inline
-: TCIOFLUSH   3 ; inline
-: TCOOFF      1 ; inline
-: TCOON       2 ; inline
-: TCIOFF      3 ; inline
-: TCION       4 ; inline
-
-! iflags
-: IGNBRK      HEX: 00000001 ; inline
-: BRKINT      HEX: 00000002 ; inline
-: IGNPAR      HEX: 00000004 ; inline
-: PARMRK      HEX: 00000008 ; inline
-: INPCK       HEX: 00000010 ; inline
-: ISTRIP      HEX: 00000020 ; inline
-: INLCR       HEX: 00000040 ; inline
-: IGNCR       HEX: 00000080 ; inline
-: ICRNL       HEX: 00000100 ; inline
-: IXON        HEX: 00000200 ; inline
-: IXOFF       HEX: 00000400 ; inline
-: IXANY       HEX: 00000800 ; inline
-: IMAXBEL     HEX: 00002000 ; inline
-: IUTF8       HEX: 00004000 ; inline
-
-! oflags
-: OPOST       HEX: 00000001 ; inline
-: ONLCR       HEX: 00000002 ; inline
-: OXTABS      HEX: 00000004 ; inline
-: ONOEOT      HEX: 00000008 ; inline
-
-! cflags
-: CIGNORE     HEX: 00000001 ; inline
-: CSIZE       HEX: 00000300 ; inline
-: CS5         HEX: 00000000 ; inline
-: CS6         HEX: 00000100 ; inline
-: CS7         HEX: 00000200 ; inline
-: CS8         HEX: 00000300 ; inline
-: CSTOPB      HEX: 00000400 ; inline
-: CREAD       HEX: 00000800 ; inline
-: PARENB      HEX: 00001000 ; inline
-: PARODD      HEX: 00002000 ; inline
-: HUPCL       HEX: 00004000 ; inline
-: CLOCAL      HEX: 00008000 ; inline
-: CCTS_OFLOW  HEX: 00010000 ; inline
-: CRTS_IFLOW  HEX: 00020000 ; inline
-: CRTSCTS     { CCTS_OFLOW CRTS_IFLOW } flags ; inline
-: CDTR_IFLOW  HEX: 00040000 ; inline
-: CDSR_OFLOW  HEX: 00080000 ; inline
-: CCAR_OFLOW  HEX: 00100000 ; inline
-: MDMBUF      HEX: 00100000 ; inline
-
-! lflags
-: ECHOKE      HEX: 00000001 ; inline
-: ECHOE       HEX: 00000002 ; inline
-: ECHOK       HEX: 00000004 ; inline
-: ECHO        HEX: 00000008 ; inline
-: ECHONL      HEX: 00000010 ; inline
-: ECHOPRT     HEX: 00000020 ; inline
-: ECHOCTL     HEX: 00000040 ; inline
-: ISIG        HEX: 00000080 ; inline
-: ICANON      HEX: 00000100 ; inline
-: ALTWERASE   HEX: 00000200 ; inline
-: IEXTEN      HEX: 00000400 ; inline
-: EXTPROC     HEX: 00000800 ; inline
-: TOSTOP      HEX: 00400000 ; inline
-: FLUSHO      HEX: 00800000 ; inline
-: NOKERNINFO  HEX: 02000000 ; inline
-: PENDIN      HEX: 20000000 ; inline
-: NOFLSH      HEX: 80000000 ; inline
diff --git a/extra/serial/unix/bsd/tags.txt b/extra/serial/unix/bsd/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/unix/linux/linux.factor b/extra/serial/unix/linux/linux.factor
deleted file mode 100644 (file)
index 3ad5088..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: assocs alien.syntax kernel serial system unix ;
-IN: serial.unix
-
-: TCSANOW     0 ; inline
-: TCSADRAIN   1 ; inline
-: TCSAFLUSH   2 ; inline
-
-: TCIFLUSH    0 ; inline
-: TCOFLUSH    1 ; inline
-: TCIOFLUSH   2 ; inline
-
-: TCOOFF      0 ; inline
-: TCOON       1 ; inline
-: TCIOFF      2 ; inline
-: TCION       3 ; inline
-
-! iflag
-: IGNBRK  OCT: 0000001 ; inline
-: BRKINT  OCT: 0000002 ; inline
-: IGNPAR  OCT: 0000004 ; inline
-: PARMRK  OCT: 0000010 ; inline
-: INPCK   OCT: 0000020 ; inline
-: ISTRIP  OCT: 0000040 ; inline
-: INLCR   OCT: 0000100 ; inline
-: IGNCR   OCT: 0000200 ; inline
-: ICRNL   OCT: 0000400 ; inline
-: IUCLC   OCT: 0001000 ; inline
-: IXON    OCT: 0002000 ; inline
-: IXANY   OCT: 0004000 ; inline
-: IXOFF   OCT: 0010000 ; inline
-: IMAXBEL OCT: 0020000 ; inline
-: IUTF8   OCT: 0040000 ; inline
-
-! oflag
-: OPOST   OCT: 0000001 ; inline
-: OLCUC   OCT: 0000002 ; inline
-: ONLCR   OCT: 0000004 ; inline
-: OCRNL   OCT: 0000010 ; inline
-: ONOCR   OCT: 0000020 ; inline
-: ONLRET  OCT: 0000040 ; inline
-: OFILL   OCT: 0000100 ; inline
-: OFDEL   OCT: 0000200 ; inline
-: NLDLY  OCT: 0000400 ; inline
-:   NL0  OCT: 0000000 ; inline
-:   NL1  OCT: 0000400 ; inline
-: CRDLY  OCT: 0003000 ; inline
-:   CR0  OCT: 0000000 ; inline
-:   CR1  OCT: 0001000 ; inline
-:   CR2  OCT: 0002000 ; inline
-:   CR3  OCT: 0003000 ; inline
-: TABDLY OCT: 0014000 ; inline
-:   TAB0 OCT: 0000000 ; inline
-:   TAB1 OCT: 0004000 ; inline
-:   TAB2 OCT: 0010000 ; inline
-:   TAB3 OCT: 0014000 ; inline
-: BSDLY  OCT: 0020000 ; inline
-:   BS0  OCT: 0000000 ; inline
-:   BS1  OCT: 0020000 ; inline
-: FFDLY  OCT: 0100000 ; inline
-:   FF0  OCT: 0000000 ; inline
-:   FF1  OCT: 0100000 ; inline
-
-! cflags
-: CSIZE   OCT: 0000060 ; inline
-:   CS5   OCT: 0000000 ; inline
-:   CS6   OCT: 0000020 ; inline
-:   CS7   OCT: 0000040 ; inline
-:   CS8   OCT: 0000060 ; inline
-: CSTOPB  OCT: 0000100 ; inline
-: CREAD   OCT: 0000200 ; inline
-: PARENB  OCT: 0000400 ; inline
-: PARODD  OCT: 0001000 ; inline
-: HUPCL   OCT: 0002000 ; inline
-: CLOCAL  OCT: 0004000 ; inline
-: CIBAUD  OCT: 002003600000 ; inline
-: CRTSCTS OCT: 020000000000 ; inline
-
-! lflags
-: ISIG    OCT: 0000001 ; inline
-: ICANON  OCT: 0000002 ; inline
-: XCASE  OCT: 0000004 ; inline
-: ECHO    OCT: 0000010 ; inline
-: ECHOE   OCT: 0000020 ; inline
-: ECHOK   OCT: 0000040 ; inline
-: ECHONL  OCT: 0000100 ; inline
-: NOFLSH  OCT: 0000200 ; inline
-: TOSTOP  OCT: 0000400 ; inline
-: ECHOCTL OCT: 0001000 ; inline
-: ECHOPRT OCT: 0002000 ; inline
-: ECHOKE  OCT: 0004000 ; inline
-: FLUSHO  OCT: 0010000 ; inline
-: PENDIN  OCT: 0040000 ; inline
-: IEXTEN  OCT: 0100000 ; inline
-
-M: linux lookup-baud ( n -- n )
-    dup H{
-        { 0 OCT: 0000000 }
-        { 50    OCT: 0000001 }
-        { 75    OCT: 0000002 }
-        { 110   OCT: 0000003 }
-        { 134   OCT: 0000004 }
-        { 150   OCT: 0000005 }
-        { 200   OCT: 0000006 }
-        { 300   OCT: 0000007 }
-        { 600   OCT: 0000010 }
-        { 1200  OCT: 0000011 }
-        { 1800  OCT: 0000012 }
-        { 2400  OCT: 0000013 }
-        { 4800  OCT: 0000014 }
-        { 9600  OCT: 0000015 }
-        { 19200 OCT: 0000016 }
-        { 38400 OCT: 0000017 }
-        { 57600   OCT: 0010001 }
-        { 115200  OCT: 0010002 }
-        { 230400  OCT: 0010003 }
-        { 460800  OCT: 0010004 }
-        { 500000  OCT: 0010005 }
-        { 576000  OCT: 0010006 }
-        { 921600  OCT: 0010007 }
-        { 1000000 OCT: 0010010 }
-        { 1152000 OCT: 0010011 }
-        { 1500000 OCT: 0010012 }
-        { 2000000 OCT: 0010013 }
-        { 2500000 OCT: 0010014 }
-        { 3000000 OCT: 0010015 }
-        { 3500000 OCT: 0010016 }
-        { 4000000 OCT: 0010017 }
-    } at* [ nip ] [ drop invalid-baud ] if ;
diff --git a/extra/serial/unix/linux/tags.txt b/extra/serial/unix/linux/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/unix/tags.txt b/extra/serial/unix/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/unix/termios/bsd/bsd.factor b/extra/serial/unix/termios/bsd/bsd.factor
deleted file mode 100644 (file)
index 5fbc571..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel sequences system ;
-IN: serial.unix.termios
-
-: NCCS 20 ; inline
-
-TYPEDEF: uint tcflag_t
-TYPEDEF: uchar cc_t
-TYPEDEF: uint speed_t
-
-C-STRUCT: termios
-    { "tcflag_t" "iflag" }           !  input mode flags
-    { "tcflag_t" "oflag" }           !  output mode flags
-    { "tcflag_t" "cflag" }           !  control mode flags
-    { "tcflag_t" "lflag" }           !  local mode flags
-    { { "cc_t" NCCS } "cc" }         !  control characters
-    { "speed_t" "ispeed" }           !  input speed
-    { "speed_t" "ospeed" } ;         !  output speed
diff --git a/extra/serial/unix/termios/bsd/tags.txt b/extra/serial/unix/termios/bsd/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/unix/termios/linux/linux.factor b/extra/serial/unix/termios/linux/linux.factor
deleted file mode 100644 (file)
index de9906e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax kernel system unix ;
-IN: serial.unix.termios
-
-: NCCS 32 ; inline
-
-TYPEDEF: uchar cc_t
-TYPEDEF: uint speed_t
-TYPEDEF: uint tcflag_t
-
-C-STRUCT: termios
-    { "tcflag_t" "iflag" }           !  input mode flags
-    { "tcflag_t" "oflag" }           !  output mode flags
-    { "tcflag_t" "cflag" }           !  control mode flags
-    { "tcflag_t" "lflag" }           !  local mode flags
-    { "cc_t" "line" }                !  line discipline
-    { { "cc_t" NCCS } "cc" }         !  control characters
-    { "speed_t" "ispeed" }           !  input speed
-    { "speed_t" "ospeed" } ;         !  output speed
diff --git a/extra/serial/unix/termios/linux/tags.txt b/extra/serial/unix/termios/linux/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/unix/termios/tags.txt b/extra/serial/unix/termios/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/unix/termios/termios.factor b/extra/serial/unix/termios/termios.factor
deleted file mode 100644 (file)
index 901416d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: combinators system vocabs.loader ;
-IN: serial.unix.termios
-
-{
-    { [ os linux? ] [ "serial.unix.termios.linux" ] }
-    { [ os bsd? ] [ "serial.unix.termios.bsd" ] }
-} cond require
diff --git a/extra/serial/unix/unix-tests.factor b/extra/serial/unix/unix-tests.factor
deleted file mode 100644 (file)
index e9126a5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel math.bitwise serial serial.unix ;
-IN: serial.unix
-
-: serial-obj ( -- obj )
-    serial new
-    "/dev/ttyS0" >>path
-    19200 >>baud
-    { IGNPAR ICRNL } flags >>iflag
-    { } flags >>oflag
-    { CS8 CLOCAL CREAD } flags >>cflag
-    { ICANON } flags >>lflag ;
-
-: serial-test ( -- serial )
-    serial-obj
-    open-serial
-    dup get-termios >>termios
-    dup configure-termios
-    dup tciflush
-    dup apply-termios ;
diff --git a/extra/serial/unix/unix.factor b/extra/serial/unix/unix.factor
deleted file mode 100644 (file)
index 90dbd18..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types alien.syntax combinators io.ports
-io.streams.duplex io.unix.backend system kernel math math.bitwise
-vocabs.loader unix serial serial.unix.termios ;
-IN: serial.unix
-
-<< {
-    { [ os linux? ] [ "serial.unix.linux" ] }
-    { [ os bsd? ] [ "serial.unix.bsd" ] }
-} cond require >>
-
-FUNCTION: speed_t cfgetispeed ( termios* t ) ;
-FUNCTION: speed_t cfgetospeed ( termios* t ) ;
-FUNCTION: int cfsetispeed ( termios* t, speed_t s ) ;
-FUNCTION: int cfsetospeed ( termios* t, speed_t s ) ;
-FUNCTION: int tcgetattr ( int i1, termios* t ) ;
-FUNCTION: int tcsetattr ( int i1, int i2, termios* t ) ;
-FUNCTION: int tcdrain ( int i1 ) ;
-FUNCTION: int tcflow ( int i1, int i2 ) ;
-FUNCTION: int tcflush ( int i1, int i2 ) ;
-FUNCTION: int tcsendbreak ( int i1, int i2 ) ;
-FUNCTION: void cfmakeraw ( termios* t ) ;
-FUNCTION: int cfsetspeed ( termios* t, speed_t s ) ;
-
-: fd>duplex-stream ( fd -- duplex-stream )
-    <fd> init-fd
-    [ <input-port> ] [ <output-port> ] bi <duplex-stream> ;
-
-: open-rw ( path -- fd ) O_RDWR file-mode open-file  ;
-: <file-rw> ( path -- stream ) open-rw fd>duplex-stream ;
-
-M: unix open-serial ( serial -- serial' )
-    dup
-    path>> { O_RDWR O_NOCTTY O_NDELAY } flags file-mode open-file
-    fd>duplex-stream >>stream ;
-
-: serial-fd ( serial -- fd )
-    stream>> in>> handle>> fd>> ;
-
-: get-termios ( serial -- termios )
-    serial-fd
-    "termios" <c-object> [ tcgetattr io-error ] keep ;
-
-: configure-termios ( serial -- )
-    dup termios>>
-    {
-        [ [ iflag>> ] dip over [ set-termios-iflag ] [ 2drop ] if ]
-        [ [ oflag>> ] dip over [ set-termios-oflag ] [ 2drop ] if ]
-        [
-            [
-                [ cflag>> 0 or ] [ baud>> lookup-baud ] bi bitor
-            ] dip set-termios-cflag
-        ]
-        [ [ lflag>> ] dip over [ set-termios-lflag ] [ 2drop ] if ]
-    } 2cleave ;
-
-: tciflush ( serial -- )
-    serial-fd TCIFLUSH tcflush io-error ;
-
-: apply-termios ( serial -- )
-    [ serial-fd TCSANOW ]
-    [ termios>> ] bi tcsetattr io-error ;
diff --git a/extra/serial/windows/authors.txt b/extra/serial/windows/authors.txt
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/extra/serial/windows/tags.txt b/extra/serial/windows/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/extra/serial/windows/windows-tests.factor b/extra/serial/windows/windows-tests.factor
deleted file mode 100755 (executable)
index bd67f77..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-! Copyright (C) 2009 Your name.
-! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test serial.windows ;
-IN: serial.windows.tests
diff --git a/extra/serial/windows/windows.factor b/extra/serial/windows/windows.factor
deleted file mode 100755 (executable)
index a80366c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-! Copyright (C) 2009 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: io.files.windows io.streams.duplex kernel math
-math.bitwise windows.kernel32 accessors alien.c-types
-windows io.files.windows fry locals continuations ;
-IN: serial.windows
-
-: <serial-stream> ( path encoding -- duplex )
-    [ open-r/w dup ] dip <encoder-duplex> ;
-
-: get-comm-state ( duplex -- dcb )
-    in>> handle>>
-    "DCB" <c-object> tuck
-    GetCommState win32-error=0/f ;
-
-: set-comm-state ( duplex dcb -- )
-    [ in>> handle>> ] dip
-    SetCommState win32-error=0/f ;
-
-:: with-comm-state ( duplex quot: ( dcb -- ) -- )
-    duplex get-comm-state :> dcb
-    dcb clone quot curry [ dcb set-comm-state ] recover ; inline
index 0ce946dc49e409e84c96cb2a8b3b71aa1238f0aa..ba21ba9c84180d87e78e6c25a7cfcf6f5cb33b13 100755 (executable)
@@ -6,7 +6,7 @@ ui.gadgets.books ui.gadgets.panes ui.gestures ui.render
 parser accessors colors ;
 IN: slides
 
-: stylesheet
+CONSTANT: stylesheet
     H{
         { default-span-style
             H{
@@ -40,7 +40,7 @@ IN: slides
             H{ { table-gap { 10 20 } } }
         }
         { bullet "\u0000b7" }
-    } ;
+    }
 
 : $title ( string -- )
     [ H{ { font "sans-serif" } { font-size 48 } } format ] ($block) ;
index ef5ffcc3447c48822931394ac41006132d363b52..00b5bb6c410a8d16d59f19eb47da80b56154b1de 100644 (file)
@@ -12,8 +12,8 @@ TUPLE: tetris
     { paused? initial: f }
     { running? initial: t } ;
 
-: default-width 10 ; inline
-: default-height 20 ; inline
+CONSTANT: default-width 10
+CONSTANT: default-height 20
 
 : <tetris> ( width height -- tetris )
     dupd <board> swap <piece-llist>
index 25ec30ac78673bac67927e9c6d34f2cfa84f970e..0ee2a114dd7b486702f1bb3d08a7f3bafc868a1f 100644 (file)
@@ -28,8 +28,8 @@ TUPLE: city
 first-zip name state latitude longitude gmt-offset dst-offset ;
 
 MEMO: cities ( -- seq )
-    "resource:extra/usa-cities/zipcode.csv" ascii <file-reader>
-    csv rest-slice [
+    "resource:extra/usa-cities/zipcode.csv" ascii file>csv
+    rest-slice [
         [
             {
                 [ string>number ]
index 35d8bb52ff63fd3c625ea55b53d12c751305e374..5d7620101fea1b0eda49af5178c5f07d2066160b 100644 (file)
@@ -8,7 +8,7 @@ help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 IN: vpri-talk
 
-: vpri-slides
+CONSTANT: vpri-slides
 {
     { $slide "Factor!"
         { $url "http://factorcode.org" }
@@ -485,7 +485,7 @@ IN: vpri-talk
         "Factor has many cool things that I didn't talk about"
         "Questions?"
     }
-} ;
+}
 
 : vpri-talk ( -- ) vpri-slides slides-window ;
 
index 6ef60c198facbf1bee8e72e5fa410b71c02b76ce..4f6edee03121130a3b005961bb76f47727e73c7a 100755 (executable)
@@ -143,8 +143,8 @@ io.sockets.secure ;
 : <todo-secure-config> ( -- config )
     ! This is only suitable for testing!
     <secure-config>
-        "resource:basis/openssl/test/dh1024.pem" >>dh-file
-        "resource:basis/openssl/test/server.pem" >>key-file
+        "vocab:openssl/test/dh1024.pem" >>dh-file
+        "vocab:openssl/test/server.pem" >>key-file
         "password" >>password ;
 
 : <todo-app> ( -- responder )
index 35a1129338f4f6714b476aa47f3fb35248be997d..d7b132d4f23502660b148a2bb8a839cf9463e64f 100644 (file)
@@ -69,8 +69,8 @@ SYMBOL: dh-file
     init-factor-db ;
 
 : init-testing ( -- )
-    "resource:basis/openssl/test/dh1024.pem" dh-file set-global
-    "resource:basis/openssl/test/server.pem" key-file set-global
+    "vocab:openssl/test/dh1024.pem" dh-file set-global
+    "vocab:openssl/test/server.pem" key-file set-global
     "password" key-password set-global
     common-configuration
     <factor-website>
index b58a11747f00c61c08adeb1adee87f1ddfe564e2..5e0c08b430eadb66dacb656d21a8f877ce6f8606 100755 (executable)
@@ -18,8 +18,7 @@ format similar-ok language country site subscription license ;
         first3 <result>
     ] map ;
 
-: yahoo-url ( -- str )
-    URL" http://search.yahooapis.com/WebSearchService/V1/webSearch" ;
+CONSTANT: yahoo-url URL" http://search.yahooapis.com/WebSearchService/V1/webSearch"
 
 :: param ( search url name quot -- search url )
     search url search quot call
@@ -49,8 +48,7 @@ format similar-ok language country site subscription license ;
     "similar_ok" [ similar-ok>> ] bool-param
     nip ;
 
-: factor-id
-    "fRrVAKzV34GDyeRw6bUHDhEWHRedwfOC7e61wwXZLgGF80E67spxdQXuugBe2pgIevMmKwA-" ;
+CONSTANT: factor-id "fRrVAKzV34GDyeRw6bUHDhEWHRedwfOC7e61wwXZLgGF80E67spxdQXuugBe2pgIevMmKwA-"
 
 : <search> ( query -- search )
     search new
index d712560b03b6384804e5101f25fb9a4a3a658a5d..0411e0709bf86bd09d46862d1a335c16f513e4a8 100644 (file)
@@ -111,6 +111,7 @@ beast.
     | C-cC-ev         | edit vocabulary (fuel-edit-vocabulary)                     |
     | C-cC-ew         | edit word (fuel-edit-word-at-point)                        |
     | C-cC-ed         | edit word's doc (C-u M-x fuel-edit-word-doc-at-point)      |
+    | C-cC-el         | load vocabs in USING: form                                 |
     |-----------------+------------------------------------------------------------|
     | C-cC-er         | eval region                                                |
     | C-M-r, C-cC-ee  | eval region, extending it to definition boundaries         |
@@ -138,6 +139,8 @@ beast.
     | C-cC-xi         | replace word by its definition (fuel-refactor-inline-word) |
     | C-cC-xw         | rename all uses of a word (fuel-refactor-rename-word)      |
     | C-cC-xa         | extract region as a separate ARTICLE: form                 |
+    | C-cC-xg         | convert current word definition into GENERIC + method      |
+    |                 | (fuel-refactor-make-generic)                               |
     |-----------------+------------------------------------------------------------|
 
 *** In the listener:
index ba9be2edd3e727e8e0c3b876f420188fc973c49a..b302fb6b8fcd3f79f442c1a1c44e2496f0bb67dc 100644 (file)
@@ -197,7 +197,7 @@ code in the buffer."
   (when (string-match factor-mode--cycle-basename-regex basename)
     (cons (match-string 1 basename) (match-string 2 basename))))
 
-(defun factor-mode--cycle-next (file)
+(defun factor-mode--cycle-next (file skip)
   (let* ((dir (file-name-directory file))
          (basename (file-name-nondirectory file))
          (p/s (factor-mode--cycle-split basename))
@@ -211,7 +211,8 @@ code in the buffer."
       (let* ((suffix (ring-ref ring (+ i idx)))
              (path (expand-file-name (concat prefix suffix) dir)))
         (when (or (file-exists-p path)
-                  (and (not (member suffix factor-mode--cycling-no-ask))
+                  (and (not skip)
+                       (not (member suffix factor-mode--cycling-no-ask))
                        (y-or-n-p (format "Create %s? " path))))
           (setq result path))
         (when (and (not factor-mode-cycle-always-ask-p)
@@ -224,10 +225,11 @@ code in the buffer."
 (defsubst factor-mode--cycling-setup ()
   (setq factor-mode--cycling-no-ask nil))
 
-(defun factor-mode-visit-other-file (&optional file)
-  "Cycle between code, tests and docs factor files."
-  (interactive)
-  (let ((file (factor-mode--cycle-next (or file (buffer-file-name)))))
+(defun factor-mode-visit-other-file (&optional skip)
+  "Cycle between code, tests and docs factor files.
+With prefix, non-existing files will be skipped."
+  (interactive "P")
+  (let ((file (factor-mode--cycle-next (buffer-file-name) skip)))
     (unless file (error "No other file found"))
     (find-file file)
     (unless (file-exists-p file)
index 76919702bb93386ed35a26cb2c64c346878144b5..d02e4fcfb95e5f553d3c9419d9940ca9fd3aed35 100644 (file)
   :type 'boolean)
 
 
+(defcustom fuel-autodoc-eval-using-form-p nil
+  "When enabled, automatically load vocabularies in USING: form
+to display autodoc messages.
+
+In order to show autodoc messages for words in a Factor buffer,
+the used vocabularies must be loaded in the Factor image. Setting
+this variable to `t' will do that automatically for you,
+asynchronously. That means that you'll be able to move around
+while the vocabs are being loaded, but no other FUEL
+functionality will be available until loading finishes (and it
+may take a while). Thus, this functionality is disabled by
+default. You can force loading the vocabs in a Factor buffer
+USING: form with \\[fuel-load-usings]."
+  :group 'fuel-autodoc
+  :type 'boolean)
+
 \f
 ;;; Eldoc function:
 
   (let ((word (or word (fuel-syntax-symbol-at-point)))
         (fuel-log--inhibit-p t))
     (when word
-      (let* ((cmd (if (fuel-syntax--in-using)
+      (let* ((usings (if fuel-autodoc-eval-using-form-p :usings t))
+             (cmd (if (fuel-syntax--in-using)
                       `(:fuel* (,word fuel-vocab-summary) :in t)
-                    `(:fuel* (((:quote ,word) synopsis :get)) :in)))
+                    `(:fuel* ((,word :usings fuel-word-synopsis)) t ,usings)))
              (ret (fuel-eval--send/wait cmd fuel-autodoc--timeout))
              (res (fuel-eval--retort-result ret)))
         (when (and ret (not (fuel-eval--retort-error ret)) (stringp res))
index 941f57140ec44af46350defd2c31196fa24d3e02..f89e2b3eb830817f0e834fdeac4267ee84c7c3df 100644 (file)
@@ -65,7 +65,6 @@
 ;;; Editing commands:
 
 (defvar fuel-edit--word-history nil)
-(defvar fuel-edit--previous-location nil)
 
 (defun fuel-edit-vocabulary (&optional refresh vocab)
   "Visits vocabulary file in Emacs.
@@ -129,7 +128,7 @@ was last invoked."
   (interactive)
   (condition-case nil
       (pop-tag-mark)
-    (error "No previous location for find word or vocab invokation")))
+    (error "No previous location for find word or vocab invocation")))
 
 (defvar fuel-edit--buffer-history nil)
 
index 9e8210a3e3e89983672704752e8fc1952f4d83c4..985722854f52e6fc75e93ecafe810288307fd120 100644 (file)
@@ -77,7 +77,7 @@
         (t (error "Invalid 'in' (%s)" in))))
 
 (defsubst factor--fuel-usings (usings)
-  (cond ((null usings) :usings)
+  (cond ((or (null usings) (eq usings :usings)) :usings)
         ((eq usings t) nil)
         ((listp usings) `(:array ,@usings))
         (t (error "Invalid 'usings' (%s)" usings))))
index 86ae94fe8af52894e01f8b36165cde1f321f93bc..f3b510fdd97003f313ae63b983758dbc80836b97 100644 (file)
@@ -88,7 +88,6 @@
                      (t 'default))))
             ((or (char-equal c ?U) (char-equal c ?C))
              'factor-font-lock-parsing-word)
-            ((char-equal c ?\() 'factor-font-lock-stack-effect)
             ((char-equal c ?\") 'factor-font-lock-string)
             (t 'factor-font-lock-comment)))))
 
index 980ea111a662dc16ca02626e3dbae45ede1a34a7..3a00b70ab1dcb13dc3797b0817e2cacab184ebd0 100644 (file)
     ($nl . fuel-markup--newline)
     ($notes . fuel-markup--notes)
     ($operation . fuel-markup--link)
+    ($or . fuel-markup--or)
     ($parsing-note . fuel-markup--parsing-note)
     ($predicate . fuel-markup--predicate)
     ($prettyprinting-note . fuel-markup--prettyprinting-note)
   (fuel-markup--instance (cons '$instance (cdr e)))
   (insert " or f "))
 
+(defun fuel-markup--or (e)
+  (let ((fst (car (cdr e)))
+        (mid (butlast (cddr e)))
+        (lst (car (last (cdr e)))))
+    (insert (format "%s" fst))
+    (dolist (m mid) (insert (format ", %s" m)))
+    (insert (format " or %s" lst))))
+
 (defun fuel-markup--values (e)
   (fuel-markup--insert-heading "Inputs and outputs")
   (dolist (val (cdr e))
index 504308fccd5998e3b1e4bec9bf34c08e461c0e47..aa9a7d944e17f2de75089370ec86fc2299a49e15 100644 (file)
@@ -132,6 +132,18 @@ With prefix argument, ask for the file name."
   (let ((file (car (fuel-mode--read-file arg))))
     (when file (fuel-debug--uses-for-file file))))
 
+(defun fuel-load-usings ()
+  "Loads all vocabularies in the current buffer's USING: from.
+Useful to activate autodoc help messages in a vocabulary not yet
+loaded. See documentation for `fuel-autodoc-eval-using-form-p'
+for details."
+  (interactive)
+  (message "Loading all vocabularies in USING: form ...")
+  (let ((err (fuel-eval--retort-error
+              (fuel-eval--send/wait '(:fuel* (t) t :usings) 120000))))
+    (message (if err "Warning: some vocabularies failed to load"
+               "All vocabularies loaded"))))
+
 \f
 ;;; Minor mode definition:
 
@@ -191,7 +203,8 @@ interacting with a factor listener is at your disposal.
 
 (fuel-mode--key ?e ?d 'fuel-edit-word-doc-at-point)
 (fuel-mode--key ?e ?e 'fuel-eval-extended-region)
-(fuel-mode--key ?e ?l 'fuel-run-file)
+(fuel-mode--key ?e ?k 'fuel-run-file)
+(fuel-mode--key ?e ?l 'fuel-load-usings)
 (fuel-mode--key ?e ?r 'fuel-eval-region)
 (fuel-mode--key ?e ?u 'fuel-update-usings)
 (fuel-mode--key ?e ?v 'fuel-edit-vocabulary)
@@ -200,6 +213,7 @@ interacting with a factor listener is at your disposal.
 
 (fuel-mode--key ?x ?a 'fuel-refactor-extract-article)
 (fuel-mode--key ?x ?i 'fuel-refactor-inline-word)
+(fuel-mode--key ?x ?g 'fuel-refactor-make-generic)
 (fuel-mode--key ?x ?r 'fuel-refactor-extract-region)
 (fuel-mode--key ?x ?s 'fuel-refactor-extract-sexp)
 (fuel-mode--key ?x ?v 'fuel-refactor-extract-vocab)
index bd622277551b170cc0841833be19a0a0aac111f4..942d4394662fc28a0b7c1769a2ceb3f259fd4cc9 100644 (file)
@@ -145,6 +145,28 @@ word."
                                 (if (looking-at-p ";") (point)
                                   (fuel-syntax--end-of-symbol-pos))))
 
+\f
+;;; Convert word to generic + method:
+
+(defun fuel-refactor-make-generic ()
+  "Inserts a new generic definition with the current word's stack effect.
+The word's body is put in a new method for the generic."
+  (interactive)
+  (let ((p (point)))
+    (fuel-syntax--beginning-of-defun)
+    (unless (re-search-forward fuel-syntax--word-signature-regex nil t)
+      (goto-char p)
+      (error "Cannot find a proper word definition here"))
+    (let ((begin (match-beginning 0))
+          (end (match-end 0))
+          (name (match-string-no-properties 1))
+          (cls (read-string "Method's class (object): " nil nil "object")))
+      (goto-char begin)
+      (insert "GENERIC")
+      (goto-char (+ end 7))
+      (newline 2)
+      (insert "M: " cls " " name " "))))
+
 \f
 ;;; Inline word:
 
index 80bfd0afcb0fb3f9c0d89b1721aed3254a4317ec..b6409b2fead9606ed62d91b375f7d832042948a7 100644 (file)
   (fuel-syntax--second-word-regex '("&:" "SYMBOL:" "VAR:")))
 
 (defconst fuel-syntax--stack-effect-regex
-  "\\( ( .* )\\)\\|\\( (( .* ))\\)")
+  "\\( ( [^\n]* )\\)\\|\\( (( [^\n]* ))\\)")
 
 (defconst fuel-syntax--using-lines-regex "^USING: +\\([^;]+\\);")
 
           fuel-syntax--end-of-def-line-regex
           fuel-syntax--single-liner-regex))
 
+(defconst fuel-syntax--word-signature-regex
+  (format ":[^ ]* \\([^ ]+\\)\\(%s\\)*" fuel-syntax--stack-effect-regex))
+
 (defconst fuel-syntax--defun-signature-regex
-  (format "\\(%s\\|%s\\)"
-          (format ":[^ ]* [^ ]+\\(%s\\)*" fuel-syntax--stack-effect-regex)
-          "M[^:]*: [^ ]+ [^ ]+"))
+  (format "\\(%s\\|%s\\)" fuel-syntax--word-signature-regex "M[^:]*: [^ ]+ [^ ]+"))
 
 (defconst fuel-syntax--constructor-decl-regex
   "\\_<C: +\\(\\w+\\) +\\(\\w+\\)\\( .*\\)?$")
     (modify-syntax-entry ?\r " " table)
     (modify-syntax-entry ?\  " " table)
     (modify-syntax-entry ?\n " " table)
+    (modify-syntax-entry ?\( "()" table)
+    (modify-syntax-entry ?\) ")(" table)
     table))
 
 (defconst fuel-syntax--syntactic-keywords
     ;; Comments:
     ("\\_<\\(#?!\\) .*\\(\n\\|$\\)" (1 "<") (2 ">"))
     ("\\_<\\(#?!\\)\\(\n\\|$\\)" (1 "<") (2 ">"))
-    (" \\((\\)( \\([^\n]*\\) )\\()\\)\\( \\|\n\\)" (1 "<b") (2 "w") (3 ">b"))
-    (" \\((\\) \\([^\n]*\\) \\()\\)\\( \\|\n\\)" (1 "<b") (2 "w") (3 ">b"))
     ;; Strings
     ("\\( \\|^\\)\\(DLL\\|P\\|SBUF\\)\\(\"\\)\\([^\n\r\f\\\"]\\|\\\\.\\)*?\\(\"\\)"
      (3 "\"") (5 "\""))
diff --git a/unfinished/benchmark/richards/richards.factor b/unfinished/benchmark/richards/richards.factor
deleted file mode 100644 (file)
index 90d4304..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-! Based on http://research.sun.com/people/mario/java_benchmarking/
-! Ported by Factor by Slava Pestov
-!
-! Based on original version written in BCPL by Dr Martin Richards
-! in 1981 at Cambridge University Computer Laboratory, England
-! Java version:  Copyright (C) 1995 Sun Microsystems, Inc.
-! by Jonathan Gibbons.
-! Outer loop added 8/7/96 by Alex Jacoby
-USING: values kernel accessors math math.bitwise sequences
-arrays combinators fry locals ;
-IN: benchmark.richards
-
-! Packets
-TUPLE: packet link id kind a1 a2 ;
-
-: BUFSIZE 4 ; inline
-
-: <packet> ( link id kind -- packet )
-    packet new
-        swap >>kind
-        swap >>id
-        swap >>link
-        0 >>a1
-        BUFSIZE 0 <array> >>a2 ;
-
-: last-packet ( packet -- last )
-    dup link>> [ last-packet ] [ ] ?if ;
-
-: append-to ( packet list -- packet )
-    [ f >>link ] dip
-    [ tuck last-packet >>link drop ] when* ;
-
-! Tasks
-: I_IDLE 1 ; inline
-: I_WORK 2 ; inline
-: I_HANDLERA 3 ; inline
-: I_HANDLERB 4 ; inline
-: I_DEVA 5 ; inline
-: I_DEVB 6 ; inline
-
-! Packet types
-: K_DEV 1000 ; inline
-: K_WORK 1001 ; inline
-
-: PKTBIT 1 ; inline
-: WAITBIT 2 ; inline
-: HOLDBIT 4 ; inline
-
-: S_RUN 0 ;  inline
-: S_RUNPKT ( -- n ) { PKTBIT } flags ; inline
-: S_WAIT ( -- n ) { WAITBIT } flags ; inline
-: S_WAITPKT ( -- n ) { WAITBIT PKTBIT } flags ; inline
-: S_HOLD ( -- n ) { HOLDBIT } flags ; inline
-: S_HOLDPKT ( -- n ) { HOLDBIT PKTBIT } flags ; inline
-: S_HOLDWAIT ( -- n ) { HOLDBIT WAITBIT } flags ; inline
-: S_HOLDWAITPKT ( -- n ) { HOLDBIT WAITBIT PKTBIT } flags ; inline
-
-: task-tab-size 10 ; inline
-
-VALUE: task-tab
-VALUE: task-list
-VALUE: tracing
-VALUE: hold-count
-VALUE: qpkt-count
-
-TUPLE: task link id pri wkq state ;
-
-: new-task ( id pri wkq state class -- task )
-    new
-        swap >>state
-        swap >>wkq
-        swap >>pri
-        swap >>id
-        task-list >>link
-        dup to: task-list
-        dup dup id>> task-tab set-nth ; inline
-
-GENERIC: fn ( packet task -- task )
-
-: state-on ( task flag -- task )
-    '[ _ bitor ] change-state ; inline
-
-: state-off ( task flag -- task )
-    '[ _ bitnot bitand ] change-state ; inline
-
-: wait-task ( task -- task )
-    WAITBIT state-on ;
-
-: hold ( task -- task )
-    hold-count 1+ to: hold-count
-    HOLDBIT state-on
-    link>> ;
-
-: highest-priority ( t1 t2 -- t1/t2 )
-    [ [ pri>> ] bi@ > ] most ;
-
-: find-tcb ( i -- task )
-    task-tab nth [ "Bad task" throw ] unless* ;
-
-: release ( task i -- task )
-    find-tcb HOLDBIT state-off highest-priority ;
-
-:: qpkt ( task pkt -- task )
-    [let | t [ pkt id>> find-tcb ] |
-        t [
-            qpkt-count 1+ to: qpkt-count
-            f pkt (>>link)
-            task id>> pkt (>>id)
-            t wkq>> [
-                pkt t wkq>> append-to t (>>wkq)
-                task
-            ] [
-                pkt t (>>wkq)
-                t PKTBIT state-on drop
-                t task highest-priority
-            ] if
-        ] [ task ] if
-    ] ;
-
-: schedule-waitpkt ( task -- task pkt )
-    dup wkq>>
-    2dup link>> >>wkq drop
-    2dup S_RUNPKT S_RUN ? >>state drop ; inline
-
-: schedule-run ( task pkt -- task )
-    swap fn ; inline
-
-: schedule-wait ( task -- task )
-    link>> ; inline
-
-: (schedule) ( task -- )
-    [
-        dup state>> {
-            { S_WAITPKT [ schedule-waitpkt schedule-run (schedule) ] }
-            { S_RUN [ f schedule-run (schedule) ] }
-            { S_RUNPKT [ f schedule-run (schedule) ] }
-            { S_WAIT [ schedule-wait (schedule) ] }
-            { S_HOLD [ schedule-wait (schedule) ] }
-            { S_HOLDPKT [ schedule-wait (schedule) ] }
-            { S_HOLDWAIT [ schedule-wait (schedule) ] }
-            { S_HOLDWAITPKT [ schedule-wait (schedule) ] }
-            [ 2drop ]
-        } case
-    ] when* ;
-
-: schedule ( -- )
-    task-list (schedule) ;
-
-! Device task
-TUPLE: device-task < task v1 ;
-
-: <device-task> ( id pri wkq -- task )
-    dup S_WAITPKT S_WAIT ? device-task new-task ;
-
-M:: device-task fn ( pkt task -- task )
-    pkt [
-        task dup v1>>
-        [ wait-task ]
-        [ [ f ] change-v1 swap qpkt ] if
-    ] [ pkt task (>>v1) task hold ] if ;
-
-TUPLE: handler-task < task workpkts devpkts ;
-
-: <handler-task> ( id pri wkq -- task )
-    dup S_WAITPKT S_WAIT ? handler-task new-task ;
-
-M:: handler-task fn ( pkt task -- task )
-    pkt [
-        task over kind>> K_WORK =
-        [ [ append-to ] change-workpkts ]
-        [ [ append-to ] change-devpkts ]
-        if drop
-    ] when*
-
-    task workpkts>> [
-        [let* | devpkt [ task devpkts>> ]
-                workpkt [ task workpkts>> ]
-                count [ workpkt a1>> ] |
-            count BUFSIZE > [
-                workpkt link>> task (>>workpkts)
-                task workpkt qpkt
-            ] [
-                devpkt [
-                    devpkt link>> task (>>devpkts)
-                    count workpkt a2>> nth devpkt (>>a1)
-                    count 1+ workpkt (>>a1)
-                    task devpkt qpkt
-                ] [
-                    task wait-task
-                ] if
-            ] if
-        ]
-    ] [ task wait-task ] if ;
-
-! Idle task
-TUPLE: idle-task < task { v1 fixnum } { v2 fixnum } ;
-
-: <idle-task> ( i a1 a2 -- task )
-    [ 0 f S_RUN idle-task new-task ] 2dip
-    [ >>v1 ] [ >>v2 ] bi* ;
-
-M: idle-task fn ( pkt task -- task )
-    nip
-    [ 1- ] change-v2
-    dup v2>> 0 = [ hold ] [
-        dup v1>> 1 bitand 0 = [
-            [ -1 shift ] change-v1
-            I_DEVA release
-        ] [
-            [ -1 shift HEX: d008 bitor ] change-v1
-            I_DEVB release
-        ] if
-    ] if ;
-
-! Work task
-TUPLE: work-task < task { handler fixnum } { n fixnum } ;
-
-: <work-task> ( id pri w -- work-task )
-    dup S_WAITPKT S_WAIT ? work-task new-task
-    I_HANDLERA >>handler
-    0 >>n ;
-
-M:: work-task fn ( pkt task -- task )
-    pkt [
-        task [ I_HANDLERA = I_HANDLERB I_HANDLERA ? ] change-handler drop
-        task handler>> pkt (>>id)
-        0 pkt (>>a1)
-        BUFSIZE [| i |
-            task [ 1+ ] change-n drop
-            task n>> 26 > [ 1 task (>>n) ] when
-            task n>> 1 - CHAR: A + i pkt a2>> set-nth
-        ] each
-        task pkt qpkt
-    ] [ task wait-task ] if ;
-
-! Main
-: init ( -- )
-    task-tab-size f <array> to: task-tab
-    f to: tracing
-    0 to: hold-count
-    0 to: qpkt-count ;
-
-: start ( -- )
-    I_IDLE 1 10000 <idle-task> drop
-
-    I_WORK 1000
-    f 0 K_WORK <packet> 0 K_WORK <packet>
-    <work-task> drop
-
-    I_HANDLERA 2000
-    f I_DEVA K_DEV <packet>
-    I_DEVA K_DEV <packet>
-    I_DEVA K_DEV <packet>
-    <handler-task> drop
-
-    I_HANDLERB 3000
-    f I_DEVB K_DEV <packet>
-    I_DEVB K_DEV <packet>
-    I_DEVB K_DEV <packet>
-    <handler-task> drop
-
-    I_DEVA 4000 f <device-task> drop
-    I_DEVB 4000 f <device-task> drop ;
-
-: check ( -- )
-    qpkt-count 23246 assert=
-    hold-count 9297 assert= ;
-
-: run ( -- )
-    init
-    start
-    schedule check ;
diff --git a/unfinished/sql/sql-tests.factor b/unfinished/sql/sql-tests.factor
deleted file mode 100644 (file)
index 0b57c2d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-USING: kernel namespaces db.sql sequences math ;
-IN: db.sql.tests
-
-! TUPLE: person name age ;
-: insert-1
-    { insert
-        {
-            { table "person" }
-            { columns "name" "age" }
-            { values "erg" 26 }
-        }
-    } ;
-
-: update-1
-    { update "person"
-       { set { "name" "erg" }
-             { "age" 6 } }
-       { where { "age" 6 } }
-    } ;
-
-: select-1
-    { select
-        { columns
-                "branchno"
-                { count "staffno" as "mycount" }
-                { sum "salary" as "mysum" } }
-        { from "staff" "lol" }
-        { where
-                { "salary" > all
-                    { select
-                        { columns "salary" }
-                        { from "staff" }
-                        { where { "branchno" = "b003" } }
-                    }
-                }
-                { "branchno" > 3 } }
-        { group-by "branchno" "lol2" }
-        { having { count "staffno" > 1 } }
-        { order-by "branchno" }
-        { offset 40 }
-        { limit 20 }
-    } ;
diff --git a/unfinished/sql/sql.factor b/unfinished/sql/sql.factor
deleted file mode 100755 (executable)
index ba0673a..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-USING: kernel parser quotations classes.tuple words math.order
-nmake namespaces sequences arrays combinators
-prettyprint strings math.parser math symbols db ;
-IN: db.sql
-
-SYMBOLS: insert update delete select distinct columns from as
-where group-by having order-by limit offset is-null desc all
-any count avg table values ;
-
-: input-spec, ( obj -- ) 1, ;
-: output-spec, ( obj -- ) 2, ;
-: input, ( obj -- ) 3, ;
-: output, ( obj -- ) 4, ;
-
-DEFER: sql%
-
-: (sql-interleave) ( seq sep -- )
-    [ sql% ] curry [ sql% ] interleave ;
-
-: sql-interleave ( seq str sep -- )
-    swap sql% (sql-interleave) ;
-
-: sql-function, ( seq function -- )
-    sql% "(" sql% unclip sql% ")" sql% [ sql% ] each ;
-
-: sql-where, ( seq -- )
-    [
-        [ second 0, ]
-        [ first 0, ]
-        [ third 1, \ ? 0, ] tri
-    ] each ;
-
-HOOK: sql-create db ( object -- )
-M: db sql-create ( object -- )
-    drop
-    "create table" sql% ;
-
-HOOK: sql-drop db ( object -- )
-M: db sql-drop ( object -- )
-    drop
-    "drop table" sql% ;
-
-HOOK: sql-insert db ( object -- )
-M: db sql-insert ( object -- )
-    drop
-    "insert into" sql% ;
-
-HOOK: sql-update db ( object -- )
-M: db sql-update ( object -- )
-    drop
-    "update" sql% ;
-
-HOOK: sql-delete db ( object -- )
-M: db sql-delete ( object -- )
-    drop
-    "delete" sql% ;
-
-HOOK: sql-select db ( object -- )
-M: db sql-select ( object -- )
-    "select" sql% "," (sql-interleave) ;
-
-HOOK: sql-columns db ( object -- )
-M: db sql-columns ( object -- )
-    "," (sql-interleave) ;
-
-HOOK: sql-from db ( object -- )
-M: db sql-from ( object -- )
-    "from" "," sql-interleave ;
-
-HOOK: sql-where db ( object -- )
-M: db sql-where ( object -- )
-    "where" 0, sql-where, ;
-
-HOOK: sql-group-by db ( object -- )
-M: db sql-group-by ( object -- )
-    "group by" "," sql-interleave ;
-
-HOOK: sql-having db ( object -- )
-M: db sql-having ( object -- )
-    "having" "," sql-interleave ;
-
-HOOK: sql-order-by db ( object -- )
-M: db sql-order-by ( object -- )
-    "order by" "," sql-interleave ;
-
-HOOK: sql-offset db ( object -- )
-M: db sql-offset ( object -- )
-    "offset" sql% sql% ;
-
-HOOK: sql-limit db ( object -- )
-M: db sql-limit ( object -- )
-    "limit" sql% sql% ;
-
-! GENERIC: sql-subselect db ( object -- )
-! M: db sql-subselectselect ( object -- )
-    ! "(select" sql% sql% ")" sql% ;
-
-HOOK: sql-table db ( object -- )
-M: db sql-table ( object -- )
-    sql% ;
-
-HOOK: sql-set db ( object -- )
-M: db sql-set ( object -- )
-    "set" "," sql-interleave ;
-
-HOOK: sql-values db ( object -- )
-M: db sql-values ( object -- )
-    "values(" sql% "," (sql-interleave) ")" sql% ;
-
-HOOK: sql-count db ( object -- )
-M: db sql-count ( object -- )
-    "count" sql-function, ;
-
-HOOK: sql-sum db ( object -- )
-M: db sql-sum ( object -- )
-    "sum" sql-function, ;
-
-HOOK: sql-avg db ( object -- )
-M: db sql-avg ( object -- )
-    "avg" sql-function, ;
-
-HOOK: sql-min db ( object -- )
-M: db sql-min ( object -- )
-    "min" sql-function, ;
-
-HOOK: sql-max db ( object -- )
-M: db sql-max ( object -- )
-    "max" sql-function, ;
-
-: sql-array% ( array -- )
-    unclip
-    {
-        { \ create [ sql-create ] }
-        { \ drop [ sql-drop ] }
-        { \ insert [ sql-insert ] }
-        { \ update [ sql-update ] }
-        { \ delete [ sql-delete ] }
-        { \ select [ sql-select ] }
-        { \ columns [ sql-columns ] }
-        { \ from [ sql-from ] }
-        { \ where [ sql-where ] }
-        { \ group-by [ sql-group-by ] }
-        { \ having [ sql-having ] }
-        { \ order-by [ sql-order-by ] }
-        { \ offset [ sql-offset ] }
-        { \ limit [ sql-limit ] }
-        { \ table [ sql-table ] }
-        { \ set [ sql-set ] }
-        { \ values [ sql-values ] }
-        { \ count [ sql-count ] }
-        { \ sum [ sql-sum ] }
-        { \ avg [ sql-avg ] }
-        { \ min [ sql-min ] }
-        { \ max [ sql-max ] }
-        [ sql% [ sql% ] each ]
-    } case ;
-
-ERROR: no-sql-match ;
-: sql% ( obj -- )
-    {
-        { [ dup string? ] [ 0, ] }
-        { [ dup array? ] [ sql-array% ] }
-        { [ dup number? ] [ number>string sql% ] }
-        { [ dup symbol? ] [ unparse sql% ] }
-        { [ dup word? ] [ unparse sql% ] }
-        { [ dup quotation? ] [ call ] }
-        [ no-sql-match ]
-    } cond ;
-
-: parse-sql ( obj -- sql in-spec out-spec in out )
-    [ [ sql% ] each ] { { } { } { } } nmake
-    [ " " join ] 2dip ;
index 1f4bc3ce7693f0435c41792bf884422eb5b6cf89..497a4bbf62ffc3990178d9943c42798fb169b885 100644 (file)
@@ -1827,14 +1827,13 @@ int
 bignum_unsigned_logbitp(int shift, bignum_type bignum)
 {
   bignum_length_type len = (BIGNUM_LENGTH (bignum));
-  bignum_digit_type digit;
   int index = shift / BIGNUM_DIGIT_LENGTH;
-  int p;
   if (index >= len)
     return 0;
-  digit = (BIGNUM_REF (bignum, index));
-  p = shift % BIGNUM_DIGIT_LENGTH;
-  return digit & (1 << p);
+  bignum_digit_type digit = (BIGNUM_REF (bignum, index));
+  int p = shift % BIGNUM_DIGIT_LENGTH;
+  bignum_digit_type mask = ((F_FIXNUM)1) << p;
+  return (digit & mask) ? 1 : 0;
 }
 
 /* Allocates memory */