]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: more top level forms. top-level-using 2573/head
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 4 Feb 2022 02:47:41 +0000 (20:47 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 4 Feb 2022 03:01:48 +0000 (21:01 -0600)
Depends on fixing https://github.com/factor/factor/issues/2572 first

145 files changed:
basis/alien/libraries/finder/finder.factor
basis/alien/libraries/libraries.factor
basis/atk/ffi/ffi.factor
basis/bit-arrays/bit-arrays.factor
basis/bit-vectors/bit-vectors.factor
basis/bootstrap/compiler/compiler.factor
basis/bootstrap/handbook/handbook.factor
basis/bootstrap/ui/tools/tools.factor
basis/cairo/ffi/ffi.factor
basis/calendar/calendar.factor
basis/classes/struct/struct.factor
basis/colors/colors.factor
basis/command-line/command-line.factor
basis/compiler/compiler.factor
basis/compression/snappy/ffi/ffi.factor
basis/compression/zlib/ffi/ffi.factor
basis/compression/zstd/ffi/ffi.factor
basis/concurrency/mailboxes/mailboxes.factor
basis/cpu/x86/64/64.factor
basis/db/postgresql/ffi/ffi.factor
basis/db/sqlite/ffi/ffi.factor
basis/debugger/debugger.factor
basis/dlists/dlists.factor
basis/dns/dns.factor
basis/editors/brackets/brackets.factor
basis/environment/environment.factor
basis/environment/unix/unix.factor
basis/fixups/fixups.factor
basis/game/input/input.factor
basis/gdk/ffi/ffi.factor
basis/gdk/gl/ffi/ffi.factor
basis/gdk/pixbuf/ffi/ffi.factor
basis/gio/ffi/ffi.factor
basis/glib/ffi/ffi.factor
basis/gmodule/ffi/ffi.factor
basis/gobject/ffi/ffi.factor
basis/gtk/ffi/ffi.factor
basis/gtk/gl/ffi/ffi.factor
basis/hash-sets/identity/identity.factor
basis/hash-sets/numbers/numbers.factor
basis/hash-sets/sequences/sequences.factor
basis/hash-sets/wrapped/wrapped.factor
basis/hashtables/numbers/numbers.factor
basis/hashtables/sequences/sequences.factor
basis/http/client/client.factor
basis/io/backend/unix/freebsd/freebsd.factor
basis/io/directories/directories.factor
basis/io/directories/unix/unix.factor
basis/io/files/info/info.factor
basis/io/files/info/unix/unix.factor
basis/io/files/links/links.factor
basis/io/files/temp/temp.factor
basis/io/files/unique/unique.factor
basis/io/launcher/launcher.factor
basis/io/mmap/mmap.factor
basis/io/monitors/monitors.factor
basis/io/pipes/pipes.factor
basis/io/sockets/icmp/icmp.factor
basis/io/sockets/secure/openssl/openssl.factor
basis/io/sockets/secure/secure.factor
basis/io/sockets/sockets.factor
basis/io/sockets/unix/unix.factor
basis/io/standard-paths/standard-paths.factor
basis/libc/libc.factor
basis/linked-assocs/linked-assocs.factor
basis/math/floats/env/env.factor
basis/math/floats/env/x86/x86.factor
basis/math/rectangles/rectangles.factor
basis/opengl/gl/extensions/extensions.factor
basis/openssl/libcrypto/libcrypto.factor
basis/openssl/libssl/libssl.factor
basis/pango/cairo/ffi/ffi.factor
basis/pango/ffi/ffi.factor
basis/peg/peg.factor
basis/random/random.factor
basis/random/unix/unix.factor
basis/regexp/regexp.factor
basis/specialized-arrays/specialized-arrays.factor
basis/specialized-vectors/specialized-vectors.factor
basis/stack-checker/errors/errors.factor
basis/system-info/system-info.factor
basis/tools/completion/completion.factor
basis/tools/deploy/deploy.factor
basis/tools/disassembler/udis/udis.factor
basis/tools/files/files.factor
basis/tools/ps/ps.factor
basis/typed/typed.factor
basis/ui/backend/gtk/gtk.factor
basis/ui/gadgets/gadgets.factor
basis/ui/text/core-text/core-text.factor
basis/ui/text/text.factor
basis/unix/ffi/ffi.factor
basis/unix/kqueue/kqueue.factor
basis/unix/scheduler/scheduler.factor
basis/unix/stat/stat.factor
basis/unix/statvfs/statvfs.factor
basis/unix/types/types.factor
basis/unix/unix.factor
basis/unix/users/users.factor
basis/unix/utmpx/utmpx.factor
basis/urls/urls.factor
basis/vlists/vlists.factor
basis/vocabs/platforms/platforms.factor
basis/webbrowser/webbrowser.factor
basis/windows/com/syntax/syntax.factor
basis/windows/winsock/winsock.factor
basis/x11/x11.factor
basis/xml/errors/errors.factor
basis/xml/syntax/syntax.factor
core/hashtables/identity/identity.factor
core/hashtables/wrapped/wrapped.factor
core/locals/locals.factor
core/vocabs/loader/loader.factor
core/vocabs/loader/test/m/m.factor
extra/chipmunk/ffi/ffi.factor
extra/clutter/cally/ffi/ffi.factor
extra/clutter/cogl/ffi/ffi.factor
extra/clutter/ffi/ffi.factor
extra/clutter/gtk/ffi/ffi.factor
extra/clutter/json/ffi/ffi.factor
extra/cuda/ffi/ffi.factor
extra/cuda/libraries/libraries.factor
extra/curl/ffi/ffi.factor
extra/curses/ffi/ffi.factor
extra/elevate/elevate.factor
extra/file-picker/file-picker.factor
extra/fuel/listener/listener.factor
extra/game/loop/loop.factor
extra/gpu/shaders/shaders.factor
extra/graphviz/render/render.factor
extra/io/files/trash/trash.factor
extra/io/serial/serial.factor
extra/pcre/ffi/ffi.factor
extra/python/ffi/ffi.factor
extra/raylib/raylib.factor
extra/sodium/ffi/ffi.factor
extra/terminal/terminal.factor
extra/text-to-speech/text-to-speech.factor
extra/time/time.factor
extra/tokyo/alien/tcrdb/tcrdb.factor
extra/tokyo/alien/tcutil/tcutil.factor
extra/tools/image-analyzer/data-heap-reader/data-heap-reader.factor
extra/tools/image-analyzer/graphviz/graphviz.factor
extra/yaml/ffi/ffi.factor
extra/zeromq/ffi/ffi.factor

index 8c26d23973de66db1794ece71a59034f9cccade2..4fabc29e3b32d790cebd44c8ec3dd0c7b9856cce 100644 (file)
@@ -1,5 +1,5 @@
-USING: accessors alien.libraries kernel sequences system vocabs
-;
+USING: accessors alien.libraries kernel lexer parser sequences
+system vocabs vocabs.platforms ;
 IN: alien.libraries.finder
 
 HOOK: find-library* os ( name -- path/f )
 IN: alien.libraries.finder
 
 HOOK: find-library* os ( name -- path/f )
@@ -21,4 +21,8 @@ HOOK: find-library* os ( name -- path/f )
     dup [ find-library* ] map-find drop
     [ ] [ ?first "library_not_found" or ] ?if ;
 
     dup [ find-library* ] map-find drop
     [ ] [ ?first "library_not_found" or ] ?if ;
 
-"alien.libraries.finder." os name>> append require
+SYNTAX: ADD-FIRST-LIBRARY:
+    scan-token scan-word scan-object
+    find-library-from-list swap add-library ;
+
+USE-OS-SUFFIX: alien.libraries.finder
index cb67a66f039f1f8d2b15be5f662b218ae22b79f2..77b368403b7a3387e2ba9f05e1e846584a719b92 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2009, 2010 Slava Pestov, Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.strings assocs combinators
 ! Copyright (C) 2009, 2010 Slava Pestov, Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.strings assocs combinators
-compiler.errors destructors kernel namespaces sequences strings
-system vocabs ;
+compiler.errors destructors kernel lexer namespaces
+parser sequences strings system vocabs vocabs.platforms ;
 IN: alien.libraries
 
 PRIMITIVE: dll-valid? ( dll -- ? )
 IN: alien.libraries
 
 PRIMITIVE: dll-valid? ( dll -- ? )
@@ -100,9 +100,13 @@ deploy-libraries [ V{ } clone ] initialize
     [ deploy-libraries get 2dup member? [ 2drop ] [ push ] if ]
     [ "deploy-library failure" no-such-library ] if ;
 
     [ deploy-libraries get 2dup member? [ 2drop ] [ push ] if ]
     [ "deploy-library failure" no-such-library ] if ;
 
+SYNTAX: DEPLOY-LIBRARY: scan-token deploy-library ;
+
 HOOK: >deployed-library-path os ( path -- path' )
 
 HOOK: >deployed-library-path os ( path -- path' )
 
-{
-    { [ os windows? ] [ "alien.libraries.windows" ] }
-    { [ os unix? ] [ "alien.libraries.unix" ] }
-} cond require
+SYNTAX: LIBRARY-MACOSX: scan-token scan-object scan-object swap add-library ;
+SYNTAX: LIBRARY-UNIX: scan-token scan-object scan-object swap add-library ;
+SYNTAX: LIBRARY-WINDOWS: scan-token scan-object scan-object swap add-library ;
+
+USE-UNIX: alien.libraries.unix
+USE-WINDOWS: alien.libraries.windows
index 4082c4a04beb78266fd32c172e78d08857ccaf68..2ed15e754cb0d08e87e53d0175029bbe79154c8e 100644 (file)
@@ -1,17 +1,15 @@
 ! Copyright (C) 2010 Anton Gorenko.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.libraries alien.syntax combinators
 ! Copyright (C) 2010 Anton Gorenko.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.libraries alien.syntax combinators
-gobject-introspection system vocabs ;
+gobject-introspection system vocabs vocabs.platforms ;
 IN: atk.ffi
 
 << "gobject.ffi" require >>
 
 LIBRARY: atk
 
 IN: atk.ffi
 
 << "gobject.ffi" require >>
 
 LIBRARY: atk
 
-<< "atk" {
-    { [ os windows? ] [ "libatk-1.0-0.dll" ] }
-    { [ os macosx? ] [ "libatk-1.0.dylib" ] }
-    { [ os unix? ] [ "libatk-1.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: atk cdecl "libatk-1.0.so"
+LIBRARY-MACOSX: atk cdecl "libatk-1.0.dylib"
+LIBRARY-WINDOWS: atk cdecl "libatk-1.0-0.dll"
 
 GIR: vocab:atk/Atk-1.0.gir
 
 GIR: vocab:atk/Atk-1.0.gir
index c71dc243d8f11c6b9402b0f09cee5077e02f66cb..e9a14b5729fa83813f97da7c2c7dd54b93511f1f 100644 (file)
@@ -98,4 +98,4 @@ SYNTAX: ?{ \ } [ >bit-array ] parse-literal ;
 
 INSTANCE: bit-array sequence
 
 
 INSTANCE: bit-array sequence
 
-{ "bit-arrays" "prettyprint" } "bit-arrays.prettyprint" require-when
+USE-WHEN-LOADED: bit-arrays.prettyprint { "bit-arrays" "prettyprint" }
index d589d35415154ecb6aa10d66ea3f414f86ea8cea..76ddfadc26e9ea5f56d634e63ab83fcc0f9a5d84 100644 (file)
@@ -10,4 +10,4 @@ SYNTAX: ?V{ \ } [ >bit-vector ] parse-literal ;
 
 M: bit-vector contract 2drop ;
 
 
 M: bit-vector contract 2drop ;
 
-{ "bit-vectors" "prettyprint" } "bit-vectors.prettyprint" require-when
+USE-WHEN-LOADED: bit-vectors.prettyprint { "bit-vectors" "prettyprint" }
index 80ed054bcf3ca18ca0c8c07c62b7326bfca858b8..f60f5b0db091e5febc3e2652d494db833a6fda5e 100644 (file)
@@ -16,6 +16,7 @@ IN: bootstrap.compiler
 ] unless
 
 { "boostrap.compiler" "prettyprint" } "alien.prettyprint" require-when
 ] unless
 
 { "boostrap.compiler" "prettyprint" } "alien.prettyprint" require-when
+! USE-WHEN-LOADED: alien.prettyprint { "boostrap.compiler" "prettyprint" }
 
 "cpu." cpu name>> append require
 
 
 "cpu." cpu name>> append require
 
index 5e153a38f266a87bce1a752bd50c29d7f99e4564..4fc7f58f42a11efbf4f21ac9d6eeb36e2a26a952 100644 (file)
@@ -1,4 +1,4 @@
 USING: vocabs.loader vocabs kernel ;
 IN: bootstrap.handbook
 
 USING: vocabs.loader vocabs kernel ;
 IN: bootstrap.handbook
 
-{ "bootstrap.handbook" "bootstrap.help" } "help.handbook" require-when
+USE-WHEN-LOADED: help.handbook { "bootstrap.handbook" "bootstrap.help" }
index c5fd8f2e15ac625044d5ffb18594fd4feb9d32df..ea068b7f623eb82bfcbbca6d06a952637c263969 100644 (file)
@@ -3,6 +3,6 @@ IN: bootstrap.ui.tools
 
 "ui.tools" require
 
 
 "ui.tools" require
 
-{ "ui.backend.cocoa" } "ui.backend.cocoa.tools" require-when
+USE-WHEN-LOADED: ui.backend.cocoa.tools { "ui.backend.cocoa" }
 
 "ui.tools.walker" require
 
 "ui.tools.walker" require
index 1db2527d5b86275730a6be2a96b738c3d5d83ecb..e0b943f80851280a9f52d54fedeb3e6a3d997129 100644 (file)
@@ -8,11 +8,9 @@ IN: cairo.ffi
 
 ! Adapted from cairo.h, version 1.8.10
 
 
 ! Adapted from cairo.h, version 1.8.10
 
-<< "cairo" {
-    { [ os windows? ] [ "libcairo-2.dll" ] }
-    { [ os macosx? ] [ "libcairo.dylib" ] }
-    { [ os unix? ] [ "libcairo.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: cairo cdecl "libcairo.so"
+LIBRARY-MACOSX: cairo cdecl "libcairo.dylib"
+LIBRARY-WINDOWS: cairo cdecl "libcairo-2.dll"
 
 LIBRARY: cairo
 
 
 LIBRARY: cairo
 
index df7349d65e30a231cf90eec16f31f0bc5808aabd..44f9cb7a26ac191ccd94f5e3f9d35302fe70552f 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors arrays classes.tuple combinators
 combinators.short-circuit kernel literals math math.functions
 math.intervals math.order math.statistics sequences slots.syntax
 USING: accessors arrays classes.tuple combinators
 combinators.short-circuit kernel literals math math.functions
 math.intervals math.order math.statistics sequences slots.syntax
-system vocabs vocabs.loader ;
+system vocabs vocabs.loader vocabs.platforms ;
 FROM: ranges => [a..b) ;
 IN: calendar
 
 FROM: ranges => [a..b) ;
 IN: calendar
 
@@ -826,9 +826,7 @@ M: integer weeks-in-week-year
 M: timestamp weeks-in-week-year
     { [ january 1 >>day thursday? ] [ december 31 >>day thursday? ] } 1|| 53 52 ? ;
 
 M: timestamp weeks-in-week-year
     { [ january 1 >>day thursday? ] [ december 31 >>day thursday? ] } 1|| 53 52 ? ;
 
-{
-    { [ os unix? ] [ "calendar.unix" ] }
-    { [ os windows? ] [ "calendar.windows" ] }
-} cond require
+USE-UNIX: calendar.unix
+USE-WINDOWS: calendar.windows
 
 
-{ "threads" "calendar" } "calendar.threads" require-when
+USE-WHEN-LOADED: calendar.threads { "threads" "calendar" }
index c5930697c262262eb0b539a72da3af35d214dee7..527ec48612a608b743f9b37a49bd99f9dc3a350f 100644 (file)
@@ -441,4 +441,4 @@ FUNCTOR-SYNTAX: STRUCT:
     [ parse-struct-slots* ] [ ] while
     [ >array define-struct-class ] append! ;
 
     [ parse-struct-slots* ] [ ] while
     [ >array define-struct-class ] append! ;
 
-{ "classes.struct" "prettyprint" } "classes.struct.prettyprint" require-when
+USE-WHEN-LOADED: classes.struct.prettyprint { "classes.struct" "prettyprint" }
index 7b3844c3014b944ed5205e7dcd9172309b4e38d0..bff673aceb6e77b6ba221a2256ec99b691a687e4 100644 (file)
@@ -91,4 +91,4 @@ M: parsed-color >rgba value>> >rgba ;
 
 SYNTAX: COLOR: scan-token dup parse-color parsed-color boa suffix! ;
 
 
 SYNTAX: COLOR: scan-token dup parse-color parsed-color boa suffix! ;
 
-{ "colors" "prettyprint" } "colors.prettyprint" require-when
+USE-WHEN-LOADED: colors.prettyprint { "colors" "prettyprint" }
index 48518fe9d89cf22aaa638070f20a60be615b5bbd..912aaf0ee4870f9fac352329edb4b25f11ba2728 100644 (file)
@@ -106,4 +106,4 @@ STARTUP-HOOK: [
     default-cli-args
 ]
 
     default-cli-args
 ]
 
-{ "debugger" "command-line" } "command-line.debugger" require-when
+USE-WHEN-LOADED: command-line.debugger { "debugger" "command-line" }
index 5b6bed1343529ccb961aedc9f8152d4331f33f39..af8b36186c6490a89e8abdcd0c9654f7344bb17e 100644 (file)
@@ -178,5 +178,5 @@ M: optimizing-compiler process-forgotten-words
 : disable-optimizer ( -- )
     f compiler-impl set-global ;
 
 : disable-optimizer ( -- )
     f compiler-impl set-global ;
 
-{ "prettyprint" "compiler" } "compiler.prettyprint" require-when
-{ "threads" "compiler" } "compiler.threads" require-when
+USE-WHEN-LOADED: compiler.prettyprint { "prettyprint" "compiler" }
+USE-WHEN-LOADED: compiler.threads { "threads" "compiler" }
index a010eeb4906da0c777d01a8830e7d3a88723c053..34cf8a630cbc93a647f8d46aa2339f3cd3ba4eff 100644 (file)
@@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax
 combinators system ;
 IN: compression.snappy.ffi
 
 combinators system ;
 IN: compression.snappy.ffi
 
-<< "snappy" {
-    { [ os windows? ] [ "snappy.dll" ] }
-    { [ os macosx? ] [ "libsnappy.dylib" ] }
-    { [ os unix? ] [ "libsnappy.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: snappy cdecl "libsnappy.so"
+LIBRARY-MACOSX: snappy cdecl "libsnappy.dylib"
+LIBRARY-WINDOWS: snappy cdecl "snappy.dll"
 
 LIBRARY: snappy
 
 
 LIBRARY: snappy
 
index a2c4eb555e3c496bfa0574ab555654bcfb419146..152e1aedf649c2369d244c1294da97416ac7ed06 100644 (file)
@@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax
 classes.struct combinators system ;
 IN: compression.zlib.ffi
 
 classes.struct combinators system ;
 IN: compression.zlib.ffi
 
-<< "zlib" {
-    { [ os windows? ] [ "zlib1.dll" ] }
-    { [ os macosx? ] [ "libz.dylib" ] }
-    { [ os unix? ] [ "libz.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: zlib cdecl "libz.so"
+LIBRARY-MACOSX: zlib cdecl "libz.dylib"
+LIBRARY-WINDOWS: zlib cdecl "zlib1.dll"
 
 LIBRARY: zlib
 
 
 LIBRARY: zlib
 
index 8bbe820ac6ee025ba6e352018c122d8950bc02b1..b4760f820fb42f6e049e35bc325413f8c88235da 100644 (file)
@@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax
 combinators system ;
 IN: compression.zstd.ffi
 
 combinators system ;
 IN: compression.zstd.ffi
 
-<< "zstd" {
-    { [ os windows? ] [ "libzstd.dll" ] }
-    { [ os macosx? ] [ "libzstd.dylib" ] }
-    { [ os unix? ] [ "libzstd.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: zstd cdecl "libzstd.so"
+LIBRARY-MACOSX: zstd cdecl "libzstd.dylib"
+LIBRARY-WINDOWS: zstd cdecl "libzstd.dll"
 
 LIBRARY: zstd
 
 
 LIBRARY: zstd
 
index 546a6489afec28e892adbd2c2189b9d8148382f8..6d2690c517ed4e8928787765c078466b1d210b12 100644 (file)
@@ -89,4 +89,4 @@ M: linked-thread error-in-thread
 : spawn-linked-to ( quot name mailbox -- thread )
     <linked-thread> [ (spawn) ] keep ;
 
 : spawn-linked-to ( quot name mailbox -- thread )
     <linked-thread> [ (spawn) ] keep ;
 
-{ "concurrency.mailboxes" "debugger" } "concurrency.mailboxes.debugger" require-when
+USE-WHEN-LOADED: concurrency.mailboxes.debugger { "concurrency.mailboxes" "debugger" }
index 1e19b39fd75755c23488d2d55106667aeac106d0..7b9fb063298430e90b3dbbd5a1e8e1f03b5d60d6 100644 (file)
@@ -4,7 +4,8 @@ USING: alien alien.c-types assocs combinators compiler.cfg.intrinsics
 compiler.codegen.gc-maps compiler.codegen.labels
 compiler.codegen.relocation compiler.constants cpu.architecture
 cpu.x86 cpu.x86.assembler cpu.x86.assembler.operands cpu.x86.features
 compiler.codegen.gc-maps compiler.codegen.labels
 compiler.codegen.relocation compiler.constants cpu.architecture
 cpu.x86 cpu.x86.assembler cpu.x86.assembler.operands cpu.x86.features
-kernel locals math sequences specialized-arrays system vocabs ;
+kernel locals math sequences specialized-arrays system vocabs
+vocabs.platforms ;
 SPECIALIZED-ARRAY: uint
 IN: cpu.x86.64
 
 SPECIALIZED-ARRAY: uint
 IN: cpu.x86.64
 
@@ -134,7 +135,5 @@ M: x86.64 (cpuid)
         RSI 12 [+] EDX MOV
     ] alien-assembly ;
 
         RSI 12 [+] EDX MOV
     ] alien-assembly ;
 
-{
-    { [ os unix? ] [ "cpu.x86.64.unix" require ] }
-    { [ os windows? ] [ "cpu.x86.64.windows" require ] }
-} cond
+USE-UNIX: cpu.x86.64.unix
+USE-WINDOWS: cpu.x86.64.windows
index 0ad686c8ce4cce85a381a2f790b34fe3c9204142..ce4ecf7cc54c4bdbb64954a29e8280b154647834 100644 (file)
@@ -5,11 +5,9 @@ USING: alien alien.c-types alien.libraries alien.syntax
 combinators system ;
 IN: db.postgresql.ffi
 
 combinators system ;
 IN: db.postgresql.ffi
 
-<< "postgresql" {
-    { [ os windows? ] [ "libpq.dll" ] }
-    { [ os macosx? ] [ "libpq.dylib" ] }
-    { [ os unix? ] [ "libpq.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: postgresql cdecl "libpq.so"
+LIBRARY-MACOSX: postgresql cdecl "libpq.dylib"
+LIBRARY-WINDOWS: postgresql cdecl "libpq.dll"
 
 ! ConnSatusType
 CONSTANT: CONNECTION_OK                     0x0
 
 ! ConnSatusType
 CONSTANT: CONNECTION_OK                     0x0
index 2371b790ac5f6ab765a49982e1177903ca2e516d..4d9e351bfd5b6c95f56598c5206e595e42633f5d 100644 (file)
@@ -6,11 +6,9 @@ USING: alien alien.c-types alien.libraries alien.syntax
 combinators system ;
 IN: db.sqlite.ffi
 
 combinators system ;
 IN: db.sqlite.ffi
 
-<< "sqlite" {
-    { [ os windows? ] [ "sqlite3.dll" ] }
-    { [ os macosx? ] [ "libsqlite3.dylib" ] }
-    { [ os unix? ] [ "libsqlite3.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: sqlite cdecl "libsqlite3.so"
+LIBRARY-MACOSX: sqlite cdecl "libsqlite3.dylib"
+LIBRARY-WINDOWS: sqlite cdecl "sqlite3.dll"
 
 ! Return values from sqlite functions
 CONSTANT: SQLITE_OK           0  ! Successful result
 
 ! Return values from sqlite functions
 CONSTANT: SQLITE_OK           0  ! Successful result
index cfeeac6c0a861f6e717f830fa38b84e9830776ed..cf5c7d504598722a0512b1f8f22d0c1d2a7ccf05 100644 (file)
@@ -9,7 +9,7 @@ io.encodings io.styles kernel kernel.private lexer libc make
 math math.order math.parser math.ratios namespaces parser
 prettyprint sequences sequences.private slots
 source-files.errors strings strings.parser summary system vocabs
 math math.order math.parser math.ratios namespaces parser
 prettyprint sequences sequences.private slots
 source-files.errors strings strings.parser summary system vocabs
-vocabs.loader vocabs.parser words ;
+vocabs.loader vocabs.parser vocabs.platforms words ;
 IN: debugger
 
 GENERIC: error-help ( error -- topic )
 IN: debugger
 
 GENERIC: error-help ( error -- topic )
@@ -380,6 +380,6 @@ M: stack-effect-omits-dashes summary drop "Stack effect must contain “--”" ;
 M: callsite-not-compiled summary
     drop "Caller not compiled with the optimizing compiler" ;
 
 M: callsite-not-compiled summary
     drop "Caller not compiled with the optimizing compiler" ;
 
-{ "threads" "debugger" } "debugger.threads" require-when
+USE-UNIX: debugger.unix
 
 
-os unix? [ "debugger.unix" require ] when
+USE-WHEN-LOADED: debugger.threads { "threads" "debugger" }
index cab11dd042047819cca875c48e03929111978920..62dfc889158b084ad31c5f358d84b4880e85182e 100644 (file)
@@ -215,4 +215,4 @@ INSTANCE: dlist deque
 
 SYNTAX: DL{ \ } [ >dlist ] parse-literal ;
 
 
 SYNTAX: DL{ \ } [ >dlist ] parse-literal ;
 
-{ "dlists" "prettyprint" } "dlists.prettyprint" require-when
+USE-WHEN-LOADED: dlists.prettyprint { "dlists" "prettyprint" }
index c6bcfb37ad48bf9fbd18536428472eec35738c43..6c71a7ae919750b9ef7afb2fa1851cdfafab44fd 100644 (file)
@@ -6,7 +6,7 @@ grouping io io.encodings.binary io.encodings.string
 io.encodings.utf8 io.sockets io.sockets.private
 io.streams.byte-array io.timeouts kernel make math math.bitwise
 math.parser namespaces random sequences slots.syntax splitting
 io.encodings.utf8 io.sockets io.sockets.private
 io.streams.byte-array io.timeouts kernel make math math.bitwise
 math.parser namespaces random sequences slots.syntax splitting
-system vectors vocabs ;
+system vectors vocabs vocabs.platforms ;
 IN: dns
 
 : with-input-seek ( n seek-type quot -- )
 IN: dns
 
 : with-input-seek ( n seek-type quot -- )
@@ -448,10 +448,8 @@ M: TXT rdata>byte-array
 
 HOOK: initial-dns-servers os ( -- sequence )
 
 
 HOOK: initial-dns-servers os ( -- sequence )
 
-{
-    { [ os windows? ] [ "dns.windows" ] }
-    { [ os unix? ] [ "dns.unix" ] }
-} cond require
+USE-UNIX: dns.unix
+USE-WINDOWS: dns.windows
 
 : with-dns-servers ( servers quot -- )
     [ dns-servers ] dip with-variable ; inline
 
 : with-dns-servers ( servers quot -- )
     [ dns-servers ] dip with-variable ; inline
index e6ef60561ce93a9bb5f72b5a1d0294d4b8e10b01..9e1d1304c2c0ead1a85e9521f34c6b5d2efeb7a1 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2015 Dimage Sapelkin.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: editors io.pathnames io.standard-paths kernel make
 ! Copyright (C) 2015 Dimage Sapelkin.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: editors io.pathnames io.standard-paths kernel make
-namespaces system vocabs ;
+namespaces system vocabs vocabs.platforms ;
 IN: editors.brackets
 
 SINGLETON: brackets
 IN: editors.brackets
 
 SINGLETON: brackets
@@ -19,4 +19,4 @@ M: macosx brackets-path
 M: brackets editor-command
     [ brackets-path "brackets" or , drop , ] { } make ;
 
 M: brackets editor-command
     [ brackets-path "brackets" or , drop , ] { } make ;
 
-os windows? [ "editors.brackets.windows" require ] when
+USE-WINDOWS: editors.brackets.windows
index 4647fb45787346539beca577197865680321fd4f..a66a0d1539611a981cab8e5ac1e196e0bad3198f 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs combinators continuations init kernel sequences
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs combinators continuations init kernel sequences
-splitting system vocabs vocabs.loader ;
+splitting system vocabs vocabs.loader vocabs.platforms ;
 IN: environment
 
 HOOK: os-env os ( key -- value )
 IN: environment
 
 HOOK: os-env os ( key -- value )
@@ -29,10 +29,8 @@ HOOK: set-os-envs-pointer os ( malloc -- )
     over [ [ [ set-os-env ] 2curry ] [ compose ] bi* ] dip
     [ os-env ] keep [ set-os-env ] 2curry finally ; inline
 
     over [ [ [ set-os-env ] 2curry ] [ compose ] bi* ] dip
     [ os-env ] keep [ set-os-env ] 2curry finally ; inline
 
-{
-    { [ os unix? ] [ "environment.unix" require ] }
-    { [ os windows? ] [ "environment.windows" require ] }
-} cond
+USE-UNIX: environment.unix
+USE-WINDOWS: environment.windows
 
 STARTUP-HOOK: [
     "FACTOR_ROOTS" os-env [
 
 STARTUP-HOOK: [
     "FACTOR_ROOTS" os-env [
index 2309fba1a20d381dabc5a46a5242c12dc38ad9db..f77a3c874e39c6e3000c9b3509a2c1bd5714fe5e 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.accessors alien.c-types alien.data alien.strings
 alien.syntax alien.utilities environment io.encodings.utf8
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.accessors alien.c-types alien.data alien.strings
 alien.syntax alien.utilities environment io.encodings.utf8
-kernel libc system unix.ffi vocabs ;
+kernel libc system unix.ffi vocabs vocabs.platforms ;
 IN: environment.unix
 
 HOOK: environ os ( -- void* )
 IN: environment.unix
 
 HOOK: environ os ( -- void* )
@@ -30,4 +30,4 @@ M: unix set-os-envs-pointer environ set-void* ;
 M: unix (set-os-envs)
     utf8 strings>alien malloc-byte-array set-os-envs-pointer ;
 
 M: unix (set-os-envs)
     utf8 strings>alien malloc-byte-array set-os-envs-pointer ;
 
-os macosx? [ "environment.unix.macosx" require ] when
+USE-MACOSX: environment.unix.macosx
\ No newline at end of file
index 9f2b4ce7617b76e08ba28925088fdf395acc9f37..bb870801a669b82f7b580476786eb0dab31a2983 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2021 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2021 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs continuations kernel sequences
-vocabs vocabs.parser ;
+USING: accessors assocs continuations kernel sequences vocabs
+vocabs.parser words ;
 IN: fixups
 
 CONSTANT: vocab-renames {
 IN: fixups
 
 CONSTANT: vocab-renames {
@@ -60,6 +60,9 @@ M: object compute-fixups
 
 M: f compute-fixups 2drop { } ;
 
 
 M: f compute-fixups 2drop { } ;
 
+M: undefined-word compute-fixups
+    2drop { } ;
+
 M: no-vocab compute-fixups
     [ name>> vocab-renames compute-assoc-fixups ] [ drop { } ] if* ;
 
 M: no-vocab compute-fixups
     [ name>> vocab-renames compute-assoc-fixups ] [ drop { } ] if* ;
 
index 3f92333cc5c719cf5c81392bc08a7e81af0f5a20..fc52ab80628f0c87932aad42cb3b6709b9873be9 100644 (file)
@@ -106,9 +106,6 @@ SYMBOLS: pressed released ;
 : buttons-delta ( old-buttons new-buttons -- delta )
     { } buttons-delta-as ; inline
 
 : buttons-delta ( old-buttons new-buttons -- delta )
     { } buttons-delta-as ; inline
 
-{
-    { [ os windows? ] [ "game.input.dinput" require ] }
-    { [ os macosx? ] [ "game.input.iokit" require ] }
-    { [ os linux? ] [ "game.input.gtk" require ] }
-    [ ]
-} cond
+USE-WINDOWS: game.input.dinput
+USE-MACOSX: game.input.iokit
+USE-LINUX: game.input.gtk
\ No newline at end of file
index b4fb9b94de88ce888c052392cb045b48bc7af154..d7b52b2aa6ee3c565f50ab97e6abf3603cc666b2 100644 (file)
@@ -13,13 +13,8 @@ IN: gdk.ffi
 
 LIBRARY: gdk
 
 
 LIBRARY: gdk
 
-<<
-"gdk" {
-    { [ os windows? ] [ "libgdk-win32-2.0-0.dll" cdecl add-library ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libgdk-x11-2.0.so" cdecl add-library ] }
-} cond
->>
+LIBRARY-UNIX: gdk cdecl "libgdk-x11-2.0.so"
+LIBRARY-WINDOWS: gdk cdecl "libgdk-win32-2.0-0.dll"
 
 ! <workaround these types are from cairo 1.10
 STRUCT: cairo_rectangle_int_t
 
 ! <workaround these types are from cairo 1.10
 STRUCT: cairo_rectangle_int_t
index 4b3fb6ce9dbda55031b1e1e4362c051e2fbd2cde..81e90eea4c68a67a3fa14f0fa20ee3d5a627fd67 100644 (file)
@@ -10,12 +10,7 @@ IN: gdk.gl.ffi
 
 LIBRARY: gdk.gl
 
 
 LIBRARY: gdk.gl
 
-<<
-"gdk.gl" {
-    { [ os windows? ] [ "libgdkglext-win32-1.0-0.dll" cdecl add-library ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libgdkglext-x11-1.0.so" cdecl add-library ] }
-} cond
->>
+LIBRARY-UNIX: gdk.gl cdecl "libgdkglext-x11-1.0.so"
+LIBRARY-WINDOWS: gdk.gl cdecl "libgdkglext-win32-1.0-0.dll"
 
 GIR: vocab:gdk/gl/GdkGLExt-1.0.gir
 
 GIR: vocab:gdk/gl/GdkGLExt-1.0.gir
index bd69437bbb8b246e3bd1ca41f52ab117cecc318e..c74fb3463d5ccc30ad0f7785557cfcddc2fdab32 100644 (file)
@@ -10,11 +10,9 @@ IN: gdk.pixbuf.ffi
 
 LIBRARY: gdk.pixbuf
 
 
 LIBRARY: gdk.pixbuf
 
-<< "gdk.pixbuf" {
-    { [ os windows? ] [ "libgdk_pixbuf-2.0-0.dll" ] }
-    { [ os macosx? ] [ "libgdk_pixbuf-2.0.dylib" ] }
-    { [ os unix? ] [ "libgdk_pixbuf-2.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: gdk.pixbuf cdecl "libgdk_pixbuf-2.0.so"
+LIBRARY-MACOSX: gdk.pixbuf cdecl "libgdk_pixbuf-2.0.dylib"
+LIBRARY-WINDOWS: gdk.pixbuf cdecl "libgdk_pixbuf-2.0-0.dll"
 
 GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir
 
 
 GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir
 
index 7b21154eeb2004aed37a87dc451a0ffff1c370cf..fdc968ac7759881a96a3392c7936f66193fe5fa1 100644 (file)
@@ -8,10 +8,8 @@ IN: gio.ffi
 
 LIBRARY: gio
 
 
 LIBRARY: gio
 
-<< "gio" {
-    { [ os windows? ] [ "libgio-2.0-0.dll" ] }
-    { [ os macosx? ] [ "libgio-2.0.dylib" ] }
-    { [ os unix? ] [ "libgio-2.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: gio cdecl "libgio-2.0.so"
+LIBRARY-MACOSX: gio cdecl "libgio-2.0.dylib"
+LIBRARY-WINDOWS: gio cdecl "libgio-2.0-0.dll"
 
 GIR: vocab:gio/Gio-2.0.gir
 
 GIR: vocab:gio/Gio-2.0.gir
index 3474a2a66cbbd1a3fb2f199d7daf3c3138f05bd6..16a648ea4bc13b8e33e6b4b1cc20ab69984b4524 100644 (file)
@@ -8,11 +8,9 @@ IN: glib.ffi
 
 LIBRARY: glib
 
 
 LIBRARY: glib
 
-<< "glib" {
-    { [ os windows? ] [ "libglib-2.0-0.dll" ] }
-    { [ os macosx? ] [ "libglib-2.0.dylib" ] }
-    { [ os unix? ] [ "libglib-2.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: glib cdecl "libglib-2.0.so"
+LIBRARY-MACOSX: glib cdecl "libglib-2.0.dylib"
+LIBRARY-WINDOWS: glib cdecl "libglib-2.0-0.dll"
 
 IMPLEMENT-STRUCTS: GError GPollFD GSource GSourceFuncs ;
 
 
 IMPLEMENT-STRUCTS: GError GPollFD GSource GSourceFuncs ;
 
index 118b5bdc12b8bad4b15b3df89d79633547881a37..fb0c3f40e83df8f60b8ab054e46efec613f670c4 100644 (file)
@@ -8,10 +8,8 @@ IN: gmodule.ffi
 
 LIBRARY: gmodule
 
 
 LIBRARY: gmodule
 
-<< "gmodule" {
-    { [ os windows? ] [ "libgmodule-2.0-0.dll" ] }
-    { [ os macosx? ] [ "libgmodule-2.0.dylib" ] }
-    { [ os unix? ] [ "libgmodule-2.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: gmodule cdecl "libgmodule-2.0.so"
+LIBRARY-MACOSX: gmodule cdecl "libgmodule-2.0.dylib"
+LIBRARY-WINDOWS: gmodule cdecl "libgmodule-2.0-0.dll"
 
 GIR: vocab:gmodule/GModule-2.0.gir
 
 GIR: vocab:gmodule/GModule-2.0.gir
index b6d31cf514a9338cdb6e3c32e69fa2a8f3f17d88..c9b3fe24eb9384cd56a0cbe82555ad46df2c589f 100644 (file)
@@ -11,11 +11,9 @@ USE: glib.ffi
 
 LIBRARY: gobject
 
 
 LIBRARY: gobject
 
-<< "gobject" {
-    { [ os windows? ] [ "libgobject-2.0-0.dll" ] }
-    { [ os macosx? ] [ "libgobject-2.0.dylib" ] }
-    { [ os unix? ] [ "libgobject-2.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: gobject cdecl "libgobject-2.0.so"
+LIBRARY-MACOSX: gobject cdecl "libgobject-2.0.dylib"
+LIBRARY-WINDOWS: gobject cdecl "libgobject-2.0-0.dll"
 
 IMPLEMENT-STRUCTS: GValue GParamSpecVariant ;
 
 
 IMPLEMENT-STRUCTS: GValue GParamSpecVariant ;
 
index cf1977513ff2c50688ef5eb563fa5adeda41099f..1ae406c31f33b09630cfe141edb1f29b7220f99d 100644 (file)
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types alien.destructors alien.libraries
 alien.syntax combinators gobject-introspection
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types alien.destructors alien.libraries
 alien.syntax combinators gobject-introspection
-gobject-introspection.standard-types kernel pango.ffi system vocabs ;
+gobject-introspection.standard-types kernel pango.ffi system
+vocabs ;
 IN: gtk.ffi
 
 <<
 IN: gtk.ffi
 
 <<
@@ -12,13 +13,8 @@ IN: gtk.ffi
 
 LIBRARY: gtk
 
 
 LIBRARY: gtk
 
-<<
-"gtk" {
-    { [ os windows? ] [ "libgtk-win32-2.0-0.dll" cdecl add-library ] }
-    { [ os linux? ] [ "libgtk-x11-2.0.so" cdecl add-library ] }
-    [ drop ]
-} cond
->>
+USE-WINDOWS: gtk cdecl "libgtk-win32-2.0-0.dll"
+USE-LINUX: gtk cdecl "libgtk-x11-2.0.so"
 
 IMPLEMENT-STRUCTS: GtkTreeIter ;
 
 
 IMPLEMENT-STRUCTS: GtkTreeIter ;
 
index 50d39366930edc04da5a8acde20dce9de055e249..e08bd05219217338570e6410101d346d436f9bfd 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2010 Anton Gorenko.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.libraries alien.syntax combinators
 ! Copyright (C) 2010 Anton Gorenko.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.libraries alien.syntax combinators
-gobject-introspection kernel system vocabs ;
+gobject-introspection kernel system vocabs vocabs.platforms ;
 IN: gtk.gl.ffi
 
 <<
 IN: gtk.gl.ffi
 
 <<
@@ -11,12 +11,6 @@ IN: gtk.gl.ffi
 
 LIBRARY: gtk.gl
 
 
 LIBRARY: gtk.gl
 
-<<
-"gtk.gl" {
-    { [ os windows? ] [ drop ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libgtkglext-x11-1.0.so" cdecl add-library ] }
-} cond
->>
+USE-UNIX: gtk.gl cdecl "libgtkglext-x11-1.0.so"
 
 GIR: vocab:gtk/gl/GtkGLExt-1.0.gir
 
 GIR: vocab:gtk/gl/GtkGLExt-1.0.gir
index afc2fff0771fce5ee1f110427c1b69b9d44bc678..a02d90f414a6f6dcc679eca31dd14a03f9a6f7ec 100644 (file)
@@ -39,4 +39,4 @@ M: identity-hash-set set-like
 
 SYNTAX: IHS{ \ } [ >identity-hash-set ] parse-literal ;
 
 
 SYNTAX: IHS{ \ } [ >identity-hash-set ] parse-literal ;
 
-{ "hash-sets.identity" "prettyprint" } "hash-sets.identity.prettyprint" require-when
+USE-WHEN-LOADED: hash-sets.identity.prettyprint { "hash-sets.identity" "prettyprint" }
index 72b313754f26566c2ce1ab83cce8658064f40e31..6e6e491ec262914d802d355d344476bc252b65e0 100644 (file)
@@ -38,4 +38,4 @@ M: number-hash-set clone
 
 SYNTAX: NHS{ \ } [ >number-hash-set ] parse-literal ;
 
 
 SYNTAX: NHS{ \ } [ >number-hash-set ] parse-literal ;
 
-{ "hash-sets.numbers" "prettyprint" } "hash-sets.numbers.prettyprint" require-when
+USE-WHEN-LOADED: hash-sets.numbers.prettyprint { "hash-sets.numbers" "prettyprint" }
index 0fbe0424dbc3dca42c94ca991eb3c33265b48634..9e4a7239ab6ddc1762c17a55777f654d60035315 100644 (file)
@@ -38,4 +38,5 @@ M: sequence-hash-set clone
 
 SYNTAX: SHS{ \ } [ >sequence-hash-set ] parse-literal ;
 
 
 SYNTAX: SHS{ \ } [ >sequence-hash-set ] parse-literal ;
 
-{ "hash-sets.sequences" "prettyprint" } "hash-sets.sequences.prettyprint" require-when
+USE-WHEN-LOADED: hash-sets.sequences.prettyprint { "hash-sets.sequences" "prettyprint" }
+
index 92d724e97ec2a862b191656a5703c1f15a88cbed..82d322207e07ab46780055e24617f69c76dbe037 100644 (file)
@@ -47,4 +47,4 @@ M: wrapped-hash-set equal?
 
 INSTANCE: wrapped-hash-set set
 
 
 INSTANCE: wrapped-hash-set set
 
-{ "hash-sets.wrapped" "prettyprint" } "hash-sets.wrapped.prettyprint" require-when
+USE-WHEN-LOADED: hash-sets.wrapped.prettyprint { "hash-sets.wrapped" "prettyprint" }
index 42b162d84a1f97e75d2f6a114513f565586e648a..1ea09027346aa48889feb3452920337813c4e0c3 100644 (file)
@@ -40,4 +40,4 @@ M: number-hashtable new-assoc drop <number-hashtable> ;
 
 SYNTAX: NH{ \ } [ >number-hashtable ] parse-literal ;
 
 
 SYNTAX: NH{ \ } [ >number-hashtable ] parse-literal ;
 
-{ "hashtables.numbers" "prettyprint" } "hashtables.numbers.prettyprint" require-when
+USE-WHEN-LOADED: hashtables.numbers.prettyprint { "hashtables.numbers" "prettyprint" }
index b8edcc419f8e46ecfb30f537ba5b27d0ecc22c5d..5ea9ef7106dcc3c336f0b4598670cb8255c744ea 100644 (file)
@@ -40,4 +40,4 @@ M: sequence-hashtable new-assoc drop <sequence-hashtable> ;
 
 SYNTAX: SH{ \ } [ >sequence-hashtable ] parse-literal ;
 
 
 SYNTAX: SH{ \ } [ >sequence-hashtable ] parse-literal ;
 
-{ "hashtables.sequences" "prettyprint" } "hashtables.sequences.prettyprint" require-when
+USE-WHEN-LOADED: hashtables.sequences.prettyprint { "hashtables.sequences" "prettyprint" }
index 236a203bc8ec844fa42cbb69d2be6a7c80e3d333..928ab20d099ec98a458f5072061a8c820ad8ada8 100644 (file)
@@ -353,4 +353,4 @@ PRIVATE>
 : http-trace* ( url -- response data )
     <trace-request> http-request* ;
 
 : http-trace* ( url -- response data )
     <trace-request> http-request* ;
 
-{ "http.client" "debugger" } "http.client.debugger" require-when
+USE-WHEN-LOADED: http.client.debugger { "http.client" "debugger" }
index 38a66e0467431d59647b75b0eb7116c3864f511b..7f29a861665c6d098f4c70a09839a627ffce2bd1 100644 (file)
@@ -1,4 +1,6 @@
-USING: io.backend io.backend.unix system namespaces kernel accessors assocs continuations unix init io.backend.unix.multiplexers io.backend.unix.multiplexers.kqueue vocabs io.files.unix ;
+USING: io.backend io.backend.unix system namespaces kernel
+accessors assocs continuations unix init io.backend.unix.multiplexers
+io.backend.unix.multiplexers.kqueue vocabs io.files.unix ;
 
 << "io.files.unix" require >> ! needed for deploy
 
 
 << "io.files.unix" require >> ! needed for deploy
 
index 11c000b229ea85998128eeb540a68c3cf709b6df..e3e488b646897ac00afd7b9b9df2d8d66043bd88 100644 (file)
@@ -5,7 +5,7 @@ combinators.short-circuit continuations deques destructors
 dlists fry io io.backend io.encodings.binary io.files
 io.files.info io.files.links io.files.types io.pathnames kernel
 kernel.private make math namespaces sequences sorting strings
 dlists fry io io.backend io.encodings.binary io.files
 io.files.info io.files.links io.files.types io.pathnames kernel
 kernel.private make math namespaces sequences sorting strings
-system unicode vocabs ;
+system unicode vocabs vocabs.platforms ;
 IN: io.directories
 
 : set-current-directory ( path -- )
 IN: io.directories
 
 : set-current-directory ( path -- )
@@ -262,7 +262,5 @@ DEFER: copy-trees-into
 : copy-trees-into ( files to -- )
     '[ _ copy-tree-into ] each ;
 
 : copy-trees-into ( files to -- )
     '[ _ copy-tree-into ] each ;
 
-{
-    { [ os unix? ] [ "io.directories.unix" require ] }
-    { [ os windows? ] [ "io.directories.windows" require ] }
-} cond
+USE-UNIX: io.directories.unix
+USE-WINDOWS: io.directories.windows
\ No newline at end of file
index 32b9df10b40f1b03cacbb870b251481e43ee0862..413ec5a3ca39f7f58f8ef47a9fabeb26398f6378 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors alien.c-types alien.data alien.strings assocs
 classes.struct continuations fry io.backend io.backend.unix
 io.directories io.files io.files.info io.files.info.unix
 io.files.types kernel libc literals math sequences system unix
 classes.struct continuations fry io.backend io.backend.unix
 io.directories io.files io.files.info io.files.info.unix
 io.files.types kernel libc literals math sequences system unix
-unix.ffi vocabs ;
+unix.ffi vocabs vocabs.platforms ;
 IN: io.directories.unix
 
 CONSTANT: touch-mode flags{ O_WRONLY O_APPEND O_CREAT O_EXCL }
 IN: io.directories.unix
 
 CONSTANT: touch-mode flags{ O_WRONLY O_APPEND O_CREAT O_EXCL }
@@ -77,4 +77,4 @@ M: unix (directory-entries)
         '[ _ _ next-dirent ] [ >directory-entry ] produce nip
     ] with-unix-directory ;
 
         '[ _ _ next-dirent ] [ >directory-entry ] produce nip
     ] with-unix-directory ;
 
-os linux? [ "io.directories.unix.linux" require ] when
+USE-LINUX: io.directories.unix.linux
\ No newline at end of file
index a329835e09b034cba4a30dc898fcf679d57d7b30..c5dc4ffbba9774d1a8c118d0709f85f2bc1a8387 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators combinators.short-circuit
 io.files io.files.types io.pathnames kernel math strings system
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators combinators.short-circuit
 io.files io.files.types io.pathnames kernel math strings system
-vocabs ;
+vocabs vocabs.platforms ;
 IN: io.files.info
 
 ! File info
 IN: io.files.info
 
 ! File info
@@ -66,7 +66,5 @@ M: object mount-points
 : find-mount-point ( path -- object )
     mount-points (find-mount-point) ;
 
 : find-mount-point ( path -- object )
     mount-points (find-mount-point) ;
 
-{
-    { [ os unix? ] [ "io.files.info.unix" ] }
-    { [ os windows? ] [ "io.files.info.windows" ] }
-} cond require
+USE-UNIX: io.files.info.unix
+USE-WINDOWS: io.fiels.info.windows
index c6cdfd846c9ceb2e807219172ab1b03c05adb4d5..5c19855030eec8680de5c8423b8fa2c7402e39a6 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors alien.data arrays calendar calendar.unix
 classes.struct combinators combinators.short-circuit io.backend
 io.files.info io.files.types kernel libc math math.bitwise
 sequences specialized-arrays strings system unix unix.ffi
 classes.struct combinators combinators.short-circuit io.backend
 io.files.info io.files.types kernel libc math math.bitwise
 sequences specialized-arrays strings system unix unix.ffi
-unix.groups unix.stat unix.time unix.users vocabs ;
+unix.groups unix.stat unix.time unix.users vocabs vocabs.platforms ;
 IN: io.files.info.unix
 SPECIALIZED-ARRAY: timeval
 
 IN: io.files.info.unix
 SPECIALIZED-ARRAY: timeval
 
@@ -296,4 +296,4 @@ M: unix file-readable? R_OK access? ;
 M: unix file-writable? W_OK access? ;
 M: unix file-executable? X_OK access? ;
 
 M: unix file-writable? W_OK access? ;
 M: unix file-executable? X_OK access? ;
 
-"io.files.info.unix." os name>> append require
+USE-OS-SUFFIX: io.files.info.unix
index 42a5535cca988bb1839f4062e699b56d56baa57d..d276bc2d1c2466cc86be4b56c32df3f8a70d2ad2 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors io.backend io.files.info io.files.types
 ! Copyright (C) 2008 Slava Pestov, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors io.backend io.files.info io.files.types
-io.pathnames kernel math namespaces system vocabs ;
+io.pathnames kernel math namespaces system vocabs vocabs.platforms ;
 IN: io.files.links
 
 HOOK: make-link os ( target symlink -- )
 IN: io.files.links
 
 HOOK: make-link os ( target symlink -- )
@@ -13,8 +13,6 @@ HOOK: read-link os ( symlink -- path )
 : copy-link ( target symlink -- )
     [ read-link ] dip make-link ;
 
 : copy-link ( target symlink -- )
     [ read-link ] dip make-link ;
 
-os unix? [ "io.files.links.unix" require ] when
-
 : follow-link ( path -- path' )
     [ parent-directory ] [ read-link ] bi append-path ;
 
 : follow-link ( path -- path' )
     [ parent-directory ] [ read-link ] bi append-path ;
 
@@ -35,3 +33,5 @@ PRIVATE>
 
 : follow-links ( path -- path' )
     [ symlink-depth get ] dip normalize-path (follow-links) ;
 
 : follow-links ( path -- path' )
     [ symlink-depth get ] dip normalize-path (follow-links) ;
+
+USE-UNIX: io.files.links.unix
index f6eb7b9f96501cab6edf237bc28e358cdbf03bd1..428829bfc130a25e083914c547b3f355047bf4da 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2012 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators init io.directories io.pathnames kernel
 ! Copyright (C) 2012 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators init io.directories io.pathnames kernel
-namespaces system vocabs ;
+namespaces system vocabs vocabs.platforms ;
 IN: io.files.temp
 
 HOOK: default-temp-directory os ( -- path )
 IN: io.files.temp
 
 HOOK: default-temp-directory os ( -- path )
@@ -30,11 +30,9 @@ SYMBOL: current-cache-directory
 : with-cache-directory ( quot -- )
     [ cache-directory ] dip with-directory ; inline
 
 : with-cache-directory ( quot -- )
     [ cache-directory ] dip with-directory ; inline
 
-{
-    { [ os windows? ] [ "io.files.temp.windows" ] }
-    { [ os macosx? ] [ "io.files.temp.macosx" ] }
-    { [ os unix? ] [ "io.files.temp.unix" ] }
-} cond require
+USE-MACOSX: io.files.temp.macosx
+USE-UNIX: io.files.temp.unix
+USE-WINDOWS: io.files.temp.windows
 
 STARTUP-HOOK: [
     default-temp-directory dup make-directories
 
 STARTUP-HOOK: [
     default-temp-directory dup make-directories
index e0452567ef7714046aaa94ebf3856d52ff63a801..1a61aac3fc70a0213629ba882bfb99a83dad9a28 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators continuations fry io.backend io.directories
 io.pathnames kernel locals namespaces random.data sequences
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators continuations fry io.backend io.directories
 io.pathnames kernel locals namespaces random.data sequences
-system vocabs ;
+system vocabs vocabs.platforms ;
 IN: io.files.unique
 
 <PRIVATE
 IN: io.files.unique
 
 <PRIVATE
@@ -72,7 +72,5 @@ PRIVATE>
     [ path quot with-directory ]
     [ path delete-tree ] finally ; inline
 
     [ path quot with-directory ]
     [ path delete-tree ] finally ; inline
 
-{
-    { [ os unix? ] [ "io.files.unique.unix" ] }
-    { [ os windows? ] [ "io.files.unique.windows" ] }
-} cond require
+USE-UNIX: io.files.unique.unix
+USE-WINDOWS: io.files.unique.windows
index 7e5aac1e458b914804f73dddb54682fddc29acd5..d2336c6cbc18c6883d26f05aed1e4e3ad203687c 100644 (file)
@@ -5,7 +5,8 @@ USING: accessors assocs calendar combinators concurrency.flags
 debugger destructors environment fry init io io.backend
 io.encodings io.encodings.utf8 io.pipes io.pipes.private
 io.ports io.streams.duplex io.timeouts kernel math math.order
 debugger destructors environment fry init io io.backend
 io.encodings io.encodings.utf8 io.pipes io.pipes.private
 io.ports io.streams.duplex io.timeouts kernel math math.order
-namespaces prettyprint sequences strings system threads vocabs ;
+namespaces prettyprint sequences strings system threads vocabs
+vocabs.platforms ;
 
 IN: io.launcher
 
 
 IN: io.launcher
 
@@ -313,7 +314,5 @@ M: output-process-error error.
     [ [ stream-contents ] [ dup (wait-for-process) ] bi* ] with-timeout
     0 = [ 2drop ] [ output-process-error ] if ;
 
     [ [ stream-contents ] [ dup (wait-for-process) ] bi* ] with-timeout
     0 = [ 2drop ] [ output-process-error ] if ;
 
-{
-    { [ os unix? ] [ "io.launcher.unix" require ] }
-    { [ os windows? ] [ "io.launcher.windows" require ] }
-} cond
+USE-UNIX: io.launcher.unix
+USE-WINDOWS: io.launcher.windows
index 1d6a3344e2aec2da83cee0be521732e48a7f1634..58dbcf055d8d106fb2cc59ba6145bc37065700b5 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2007, 2009 Doug Coleman, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.data combinators
 ! Copyright (C) 2007, 2009 Doug Coleman, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.data combinators
-destructors io.backend io.files.info kernel math system vocabs ;
+destructors io.backend io.files.info kernel math system vocabs
+vocabs.platforms ;
 IN: io.mmap
 
 TUPLE: mapped-file < disposable address handle length ;
 IN: io.mmap
 
 TUPLE: mapped-file < disposable address handle length ;
@@ -56,7 +57,5 @@ PRIVATE>
 : with-mapped-array-reader ( path c-type quot -- )
     [ <mapped-file-reader> ] 2dip (with-mapped-array) ; inline
 
 : with-mapped-array-reader ( path c-type quot -- )
     [ <mapped-file-reader> ] 2dip (with-mapped-array) ; inline
 
-{
-    { [ os unix? ] [ "io.mmap.unix" require ] }
-    { [ os windows? ] [ "io.mmap.windows" require ] }
-} cond
+USE-UNIX: io.mmap.unix
+USE-WINDOWS: io.mmap.windows
index 6891f9983f0f7b5601011118516852aeac78d20d..526325d56bca671646bf8bb4bc3baa8388e460a3 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors concurrency.mailboxes continuations destructors
 fry io.backend io.timeouts kernel namespaces sequences system
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors concurrency.mailboxes continuations destructors
 fry io.backend io.timeouts kernel namespaces sequences system
-vocabs ;
+vocabs vocabs.platforms ;
 IN: io.monitors
 
 HOOK: init-monitors io-backend ( -- )
 IN: io.monitors
 
 HOOK: init-monitors io-backend ( -- )
@@ -71,4 +71,4 @@ SYMBOL: +rename-file+
 : run-monitor ( path recursive? quot -- )
     '[ [ @ t ] loop ] with-monitor ; inline
 
 : run-monitor ( path recursive? quot -- )
     '[ [ @ t ] loop ] with-monitor ; inline
 
-"io.monitors." os name>> append require
+USE-OS-SUFFIX: io.monitors
index 9df6c52a5f70931ccf7a8d9a16de7d7395dfe393..9bad0ebdaabea74d30367b8068b3bed70844d8e4 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors combinators concurrency.combinators destructors
 fry grouping io io.backend io.ports io.streams.duplex kernel
 math namespaces quotations sequences simple-tokenizer splitting
 USING: accessors combinators concurrency.combinators destructors
 fry grouping io io.backend io.ports io.streams.duplex kernel
 math namespaces quotations sequences simple-tokenizer splitting
-strings system vocabs ;
+strings system vocabs vocabs.platforms ;
 IN: io.pipes
 
 TUPLE: pipe in out ;
 IN: io.pipes
 
 TUPLE: pipe in out ;
@@ -64,8 +64,5 @@ PRIVATE>
         run-pipeline-element
     ] 2parallel-map ;
 
         run-pipeline-element
     ] 2parallel-map ;
 
-{
-    { [ os unix? ] [ "io.pipes.unix" require ] }
-    { [ os windows? ] [ "io.pipes.windows" require ] }
-    [ ]
-} cond
+USE-UNIX: io.pipes.unix
+USE-WINDOWS: io.pipes.windows
index b1f62cb19b9729973eada7625b7076ccfe476a7f..ebb9dca597284dce7de885a6a0c5c47fc62794d5 100644 (file)
@@ -3,14 +3,12 @@
 
 USING: accessors arrays combinators io.sockets
 io.sockets.private kernel sequences system
 
 USING: accessors arrays combinators io.sockets
 io.sockets.private kernel sequences system
-vocabs.parser ;
+vocabs.parser vocabs.platforms ;
 
 IN: io.sockets.icmp
 
 
 IN: io.sockets.icmp
 
-<< {
-    { [ os windows? ] [ "windows.winsock" ] }
-    { [ os unix? ] [ "unix.ffi" ] }
-} cond use-vocab >>
+USE-WINDOWS: windows.winsock
+USE-UNIX: unix.ffi
 
 <PRIVATE
 
 
 <PRIVATE
 
index 6437f3b07decee7d4835b29cafd1f854f495ad1d..0e08d5684f3db38c70e0ac4512cb3b8625464af0 100644 (file)
@@ -491,4 +491,6 @@ M: openssl accept-secure-handshake
     input/output-ports
     make-input/output-secure ;
 
     input/output-ports
     make-input/output-secure ;
 
-openssl secure-socket-backend set-global
+STARTUP-HOOK: [
+    openssl secure-socket-backend set-global
+]
\ No newline at end of file
index c2993069855c49e42220c2985cdf9f4458bf88bb..be41b4a844b79f792df6bf04f7f58506fa8623a6 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2008, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.libraries calendar combinators delegate
 ! Copyright (C) 2008, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.libraries calendar combinators delegate
-destructors io io.sockets io.sockets.private kernel memoize namespaces
-openssl.libssl present sequences summary system vocabs ;
+destructors io io.sockets io.sockets.private kernel namespaces
+present sequences summary system vocabs.platforms ;
+USE: openssl.libssl
 IN: io.sockets.secure
 
 SYMBOL: secure-socket-timeout
 IN: io.sockets.secure
 
 SYMBOL: secure-socket-timeout
@@ -126,7 +127,5 @@ HOOK: send-secure-handshake secure-socket-backend ( -- )
 
 HOOK: accept-secure-handshake secure-socket-backend ( -- )
 
 
 HOOK: accept-secure-handshake secure-socket-backend ( -- )
 
-{
-    { [ os unix? ] [ "io.sockets.secure.unix" require ] }
-    { [ os windows? ] [ "io.sockets.secure.windows" require ] }
-} cond
+USE-UNIX: io.sockets.secure.unix
+USE-WINDOWS: io.sockets.secure.windows
index 8c40b0d980c1914d855c04869d5d46bb77044553..fea6277febe60f78478536f3157a7969e0dc1ff8 100644 (file)
@@ -4,17 +4,15 @@
 USING: accessors alien.c-types alien.data alien.strings arrays
 byte-arrays classes classes.struct combinators
 combinators.short-circuit continuations destructors endian fry
 USING: accessors alien.c-types alien.data alien.strings arrays
 byte-arrays classes classes.struct combinators
 combinators.short-circuit continuations destructors endian fry
-grouping init io.backend io.encodings.ascii
-io.encodings.binary io.pathnames io.ports io.streams.duplex
-kernel locals math math.parser memoize namespaces present
-sequences sequences.private splitting strings summary system
-vocabs vocabs.parser ip-parser ip-parser.private random ;
+grouping init io.backend io.encodings.ascii io.encodings.binary
+io.pathnames io.ports io.streams.duplex ip-parser
+ip-parser.private kernel locals math math.parser
+memoize namespaces present random sequences sequences.private
+splitting strings summary system vocabs vocabs.parser
+vocabs.platforms ;
 IN: io.sockets
 
 IN: io.sockets
 
-<< {
-    { [ os windows? ] [ "windows.winsock" ] }
-    { [ os unix? ] [ "unix.ffi" ] }
-} cond use-vocab >>
+USE-UNIX: unix.ffi
 
 GENERIC#: with-port 1 ( addrspec port -- addrspec )
 
 
 GENERIC#: with-port 1 ( addrspec port -- addrspec )
 
@@ -486,7 +484,6 @@ M: inet6 <any-port-local-inet> drop f 0 <inet6> ;
 : broadcast-once ( bytes addrspec -- )
     [ send ] with-any-port-local-broadcast ;
 
 : broadcast-once ( bytes addrspec -- )
     [ send ] with-any-port-local-broadcast ;
 
-{
-    { [ os unix? ] [ "io.sockets.unix" require ] }
-    { [ os windows? ] [ "io.sockets.windows" require ] }
-} cond
+USE-UNIX: io.sockets.unix
+USE-WINDOWS: io.sockets.windows
+USE-WINDOWS: windows.winsock
index b7c615e0b84abf02da7e535a1d33d1218d87aaea..23d83bc6b7f8c40175830d1bd5d87abd6702ef98 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors alien alien.c-types alien.data alien.strings
 byte-arrays classes.struct combinators destructors io.backend.unix
 io.encodings.ascii io.encodings.utf8 io.files io.pathnames io.sockets
 io.sockets.private kernel libc locals math namespaces sequences system
 byte-arrays classes.struct combinators destructors io.backend.unix
 io.encodings.ascii io.encodings.utf8 io.files io.pathnames io.sockets
 io.sockets.private kernel libc locals math namespaces sequences system
-unix unix.ffi vocabs ;
+unix unix.ffi vocabs vocabs.platforms ;
 IN: io.sockets.unix
 
 : socket-fd ( domain type protocol -- fd )
 IN: io.sockets.unix
 
 : socket-fd ( domain type protocol -- fd )
@@ -180,4 +180,4 @@ M: unix host-name
     256 [ <byte-array> dup ] keep gethostname io-error
     ascii alien>string ;
 
     256 [ <byte-array> dup ] keep gethostname io-error
     ascii alien>string ;
 
-os linux? [ "io.sockets.unix.linux" require ] when
+USE-LINUX: io.sockets.unix.linux
\ No newline at end of file
index e56e8ca473ac02523a3a3057610a70009a8d77c0..d8f56136ec1a4833ceb5ed1f7734d97b5c8d5c3c 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2011 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators io.pathnames kernel sequences system
 ! Copyright (C) 2011 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators io.pathnames kernel sequences system
-vocabs ;
+vocabs vocabs.platforms ;
 IN: io.standard-paths
 
 HOOK: find-native-bundle os ( string -- path )
 IN: io.standard-paths
 
 HOOK: find-native-bundle os ( string -- path )
@@ -30,9 +30,6 @@ M: object find-in-standard-login-path*
         [ append-path ] [ 2drop f ] if
     ] if-empty ;
 
         [ append-path ] [ 2drop f ] if
     ] if-empty ;
 
-{
-    { [ os windows? ] [ "io.standard-paths.windows" ] }
-    { [ os unix? ] [ "io.standard-paths.unix" ] }
-} cond require
-
-os macosx? [ "io.standard-paths.macosx" require ] when
+USE-MACOSX: io.standard-paths.macosx
+USE-UNIX: io.standard-paths.unix
+USE-WINDOWS: io.standard-paths.windows
index 5490070397e0202909bb50bb8d1dadea17981b71..1e5824800af4b4960ae705474cefd45d45338f91 100644 (file)
@@ -4,7 +4,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.destructors
 alien.syntax destructors destructors.private kernel math
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.destructors
 alien.syntax destructors destructors.private kernel math
-namespaces sequences sets summary system vocabs ;
+namespaces sequences sets summary system vocabs vocabs.platforms ;
 IN: libc
 
 HOOK: strerror os ( errno -- str )
 IN: libc
 
 HOOK: strerror os ( errno -- str )
@@ -122,4 +122,4 @@ FUNCTION: int system ( c-string command )
 DESTRUCTOR: free
 
 ! For libc.linux, libc.windows, libc.macosx...
 DESTRUCTOR: free
 
 ! For libc.linux, libc.windows, libc.macosx...
-<< "libc." os name>> append require >>
+USE-OS-SUFFIX: libc
index 208c8af8b1aece5c4c67e9d33a591182489e2d3d..566567f2ef7c2c8931aca2738eb13cd914f3a873 100644 (file)
@@ -63,4 +63,4 @@ M: linked-assoc equal?
 
 SYNTAX: LH{ \ } [ check-hashtable >linked-hash ] parse-literal ;
 
 
 SYNTAX: LH{ \ } [ check-hashtable >linked-hash ] parse-literal ;
 
-{ "linked-assocs" "prettyprint" } "linked-assocs.prettyprint" require-when
+USE-WHEN-LOADED: linked-assocs.prettyprint { "linked-assocs" "prettyprint" }
index d019d1ee0e379c640303cc581589e6d4dedf21b2..175a6c813e26d789c21ef9105c188763b111e5d5 100644 (file)
@@ -153,6 +153,9 @@ PRIVATE>
 : without-fp-traps ( quot -- )
     { } swap with-fp-traps ; inline
 
 : without-fp-traps ( quot -- )
     { } swap with-fp-traps ; inline
 
+! USE-X86: math.floats.env.x86
+! USE-PPC: math.floats.env.ppc
+
 {
     { [ cpu x86? ] [ "math.floats.env.x86" require ] }
     { [ cpu ppc? ] [ "math.floats.env.ppc" require ] }
 {
     { [ cpu x86? ] [ "math.floats.env.x86" require ] }
     { [ cpu ppc? ] [ "math.floats.env.ppc" require ] }
index 133f6f8785b6d363152c8032d1f3b2db70a525cc..d6fdadb7e1320f9dec3a9b11ac3906ba5a2facf6 100644 (file)
@@ -130,7 +130,5 @@ M: x87-env (get-denormal-mode)
 M: x87-env (set-denormal-mode)
     drop ;
 
 M: x87-env (set-denormal-mode)
     drop ;
 
-cpu {
-    { x86.32 [ "math.floats.env.x86.32" ] }
-    { x86.64 [ "math.floats.env.x86.64" ] }
-} case require
+USE-X86-32: math.floats.env.x86.32
+USE-X86-64: math.floats.env.x86.64
\ No newline at end of file
index 8714bdfb1a3864e6e2816ce7a73e8bed16fa387d..56992160f83d33433bd84d155069f6716952c04b 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel arrays sequences math math.vectors accessors
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel arrays sequences math math.vectors accessors
-parser ;
+parser vocabs.loader ;
 IN: math.rectangles
 
 TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ;
 IN: math.rectangles
 
 TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ;
@@ -62,6 +62,4 @@ M: rect contains-point?
     [ [ dim>> ] dip dim<< ]
     2bi ; inline
 
     [ [ dim>> ] dip dim<< ]
     2bi ; inline
 
-USE: vocabs.loader
-
-{ "math.rectangles" "prettyprint" } "math.rectangles.prettyprint" require-when
+USE-WHEN-LOADED: math.rectangles.prettyprint { "math.rectangles" "prettyprint" }
index a3728d5175f3996a4115ff8d4302dd5ab5d7a655..8a25fb7afe4a43890f82a349f9ea17d687580956 100644 (file)
@@ -1,15 +1,16 @@
 USING: alien alien.syntax alien.parser combinators
 kernel parser sequences system words namespaces hashtables init
 USING: alien alien.syntax alien.parser combinators
 kernel parser sequences system words namespaces hashtables init
-math arrays assocs continuations lexer fry locals vocabs.parser ;
+math arrays assocs continuations lexer fry locals vocabs.parser
+vocabs.platforms ;
 IN: opengl.gl.extensions
 
 IN: opengl.gl.extensions
 
-ERROR: unknown-gl-platform ;
-<< {
-    { [ os windows? ] [ "opengl.gl.windows" ] }
-    { [ os macosx? ]  [ "opengl.gl.macosx" ] }
-    { [ os unix? ] [ "opengl.gl.gtk" ] }
-    [ unknown-gl-platform ]
-} cond use-vocab >>
+USE-WINDOWS: opengl.gl.windows
+USE-MACOSX: opengl.gl.macosx
+! We can't have two gl-function-context in scope here
+! so load either macosx or unix
+<!MACOSX
+    USE-UNIX: opengl.gl.gtk
+!MACOSX>
 
 SYMBOL: +gl-function-counter+
 SYMBOL: +gl-function-pointers+
 
 SYMBOL: +gl-function-counter+
 SYMBOL: +gl-function-pointers+
index 90d23b24cc12baff6e5edde27baf6ff2e0681ae1..7e448d8a7c1aa242dd27faef4ca584fd35d32e60 100644 (file)
@@ -5,11 +5,9 @@ alien.syntax classes.struct combinators system ;
 
 IN: openssl.libcrypto
 
 
 IN: openssl.libcrypto
 
-<< "libcrypto" {
-    { [ os windows? ] [ "libcrypto-37.dll" ] }
-    { [ os macosx? ] [ "libcrypto.35.dylib" ] }
-    { [ os unix? ] [ "libcrypto.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: libcrypto cdecl "libcrypto.so"
+LIBRARY-MACOSX: libcrypto cdecl "libcrypto.35.dylib"
+LIBRARY-WINDOWS: libcrypto cdecl "libcrypto-37.dll"
 
 STRUCT: bio-method
     { type int }
 
 STRUCT: bio-method
     { type int }
index b22ff130a08d7c7971bc775357a44dd4397e97d4..44bc1e09e27205f77fe106df906337e5f3e24cb5 100644 (file)
@@ -7,11 +7,9 @@ literals namespaces openssl.libcrypto system ;
 SLOT: alpn-supported-protocols
 IN: openssl.libssl
 
 SLOT: alpn-supported-protocols
 IN: openssl.libssl
 
-<< "libssl" {
-    { [ os windows? ] [ "libssl-38.dll" ] }
-    { [ os macosx? ] [ "libssl.35.dylib" ] }
-    { [ os unix? ] [ "libssl.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: libssl cdecl "libssl.so"
+LIBRARY-MACOSX: libssl cdecl "libssl.35.dylib"
+LIBRARY-WINDOWS: libssl cdecl "libssl-38.dll"
 
 CONSTANT: X509_FILETYPE_PEM       1
 CONSTANT: X509_FILETYPE_ASN1      2
 
 CONSTANT: X509_FILETYPE_PEM       1
 CONSTANT: X509_FILETYPE_ASN1      2
index 2be68acdd52038ccb5f93d228273a7827fa8faf4..704aced93308c7e3c0023f35819c42c2c6b3049b 100644 (file)
@@ -9,11 +9,9 @@ IN: pango.cairo.ffi
 
 LIBRARY: pango.cairo
 
 
 LIBRARY: pango.cairo
 
-<< "pango.cairo" {
-    { [ os windows? ] [ "libpangocairo-1.0-0.dll" ] }
-    { [ os macosx? ] [ "libpangocairo-1.0.dylib" ] }
-    { [ os unix? ] [ "libpangocairo-1.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: pango.cairo cdecl "libpangocairo-1.0.so"
+LIBRARY-MACOSX: pango.cairo cdecl "libpangocairo-1.0.dylib"
+LIBRARY-WINDOWS: pango.cairo cdecl "libpangocairo-1.0-0.dll"
 
 FOREIGN-RECORD-TYPE: cairo.Context cairo_t
 FOREIGN-RECORD-TYPE: cairo.ScaledFont cairo_scaled_font_t
 
 FOREIGN-RECORD-TYPE: cairo.Context cairo_t
 FOREIGN-RECORD-TYPE: cairo.ScaledFont cairo_scaled_font_t
index eae53faed1d94a147005ec6398fb9558017ee036..809b02301d421b84253efbe5e8b787183ed2b579 100644 (file)
@@ -9,11 +9,9 @@ IN: pango.ffi
 
 LIBRARY: pango
 
 
 LIBRARY: pango
 
-<< "pango" {
-    { [ os windows? ] [ "libpango-1.0-0.dll" ] }
-    { [ os macosx? ] [ "libpango-1.0.dylib" ] }
-    { [ os unix? ] [ "libpango-1.0.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: pango cdecl "libpango-1.0.so"
+LIBRARY-MACOSX: pango cdecl "libpango-1.0.dylib"
+LIBRARY-WINDOWS: pango cdecl "libpango-1.0-0.dll"
 
 IMPLEMENT-STRUCTS: PangoRectangle ;
 
 
 IMPLEMENT-STRUCTS: PangoRectangle ;
 
index 5168230588fe5c5350e7178f47eed9c219cfcbd5..4729e56d39f576d55df679f27c528367f8809a9b 100644 (file)
@@ -592,4 +592,4 @@ SYNTAX: PEG:
         ] append!
     ] ;
 
         ] append!
     ] ;
 
-{ "debugger" "peg" } "peg.debugger" require-when
+USE-WHEN-LOADED: peg.debugger { "debugger" "peg" }
index 4c91bf3af97997e54dfa592ef8d5621c1673ebe0..e0fc2d786cde19272c11cdac678760f77d288a95 100644 (file)
@@ -5,7 +5,7 @@ byte-vectors combinators combinators.short-circuit endian fry
 hashtables hashtables.private hash-sets hints io.backend kernel
 locals math math.bitwise math.constants math.functions
 math.order ranges namespaces sequences sequences.private
 hashtables hashtables.private hash-sets hints io.backend kernel
 locals math math.bitwise math.constants math.functions
 math.order ranges namespaces sequences sequences.private
-sets summary system typed vocabs ;
+sets summary system typed vocabs vocabs.platforms ;
 QUALIFIED-WITH: alien.c-types c
 QUALIFIED-WITH: sets sets
 IN: random
 QUALIFIED-WITH: alien.c-types c
 QUALIFIED-WITH: sets sets
 IN: random
@@ -345,9 +345,7 @@ PRIVATE>
         [ 1 + ] 2dip [ _ (random-unit) log neg + ] dip
     ] while 2drop ;
 
         [ 1 + ] 2dip [ _ (random-unit) log neg + ] dip
     ] while 2drop ;
 
-{
-    { [ os windows? ] [ "random.windows" require ] }
-    { [ os unix? ] [ "random.unix" require ] }
-} cond
+USE-WINDOWS: random.windows
+USE-UNIX: random.unix
 
 "random.mersenne-twister" require
 
 "random.mersenne-twister" require
index ab723bb7e063c4a20248c4f8c062371342774d90..db8591e9fda87b37068692e268a1c0254f82e5a9 100644 (file)
@@ -17,10 +17,10 @@ M: unix-random random-bytes*
 
 HINTS: M\ unix-random random-bytes* { fixnum unix-random } ;
 
 
 HINTS: M\ unix-random random-bytes* { fixnum unix-random } ;
 
-STARTUP-HOOK: [
-    "/dev/random" <unix-random> &dispose
-    secure-random-generator set-global
+STARTUP-HOOK: [
+    "/dev/random" <unix-random> &dispose
+    secure-random-generator set-global
 
 
-    "/dev/urandom" <unix-random> &dispose
-    system-random-generator set-global
-]
+    "/dev/urandom" <unix-random> &dispose
+    system-random-generator set-global
+]
index b243f16f588d1fdc2992eeaad51040f5ada91ae0..a3039b272fae7fa5d92fe4663b176f5fa40901b7 100644 (file)
@@ -217,5 +217,4 @@ PRIVATE>
 
 SYNTAX: R/ parse-regexp ;
 
 
 SYNTAX: R/ parse-regexp ;
 
-
-{ "prettyprint" "regexp" } "regexp.prettyprint" require-when
+USE-WHEN-LOADED: regexp.prettyprint { "prettyprint" "regexp" }
index 88145dc90623bd99186d8ac90b566bca855cdd75..ec6e8dd2f84f377af6c2d277bf8ea4b8b6eedda1 100644 (file)
@@ -174,8 +174,8 @@ SYNTAX: SPECIALIZED-ARRAYS:
 SYNTAX: SPECIALIZED-ARRAY:
     scan-c-type define-array-vocab use-vocab ;
 
 SYNTAX: SPECIALIZED-ARRAY:
     scan-c-type define-array-vocab use-vocab ;
 
-{ "specialized-arrays" "prettyprint" } "specialized-arrays.prettyprint" require-when
+USE-WHEN-LOADED: specialized-arrays.prettyprint { "specialized-arrays" "prettyprint" }
 
 
-{ "specialized-arrays" "mirrors" } "specialized-arrays.mirrors" require-when
+USE-WHEN-LOADED: specialized-arrays.mirrors { "specialized-arrays" "mirrors" }
 
 uchar define-array-vocab drop
 
 uchar define-array-vocab drop
index 721aeef9072973662fa2468f5b1b428fc9d20f09..3cd99f462613c1bdbb37c70e0005c46217341875 100644 (file)
@@ -88,4 +88,4 @@ SYNTAX: SPECIALIZED-VECTOR:
     [ define-array-vocab use-vocab ]
     [ define-vector-vocab use-vocab ] bi ;
 
     [ define-array-vocab use-vocab ]
     [ define-vector-vocab use-vocab ] bi ;
 
-{ "specialized-vectors" "mirrors" } "specialized-vectors.mirrors" require-when
+USE-WHEN-LOADED: specialized-vectors.mirrors { "specialized-vectors" "mirrors" }
index f3aeb7bb648e2cc0b9892e2af3b9285a6a1f5f17..b1ab6bf3d44d38a4333a41b82ff6790f70b3bad3 100644 (file)
@@ -35,4 +35,4 @@ ERROR: bad-declaration-error < inference-error declaration ;
 
 ERROR: unbalanced-branches-error < inference-error word quots declareds actuals ;
 
 
 ERROR: unbalanced-branches-error < inference-error word quots declareds actuals ;
 
-{ "stack-checker.errors" "debugger" } "stack-checker.errors.prettyprint" require-when
+USE-WHEN-LOADED: stack-checker.errors.prettyprint { "stack-checker.errors" "debugger" }
index ba52b23003a5a1e612136bb5ad2d239cd53148a4..74089f9eb67ae928f2b21082183813f9a3372e65 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors io kernel math math.parser sequences system
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors io kernel math math.parser sequences system
-vocabs ;
+vocabs vocabs.platforms ;
 IN: system-info
 
 HOOK: os-version os ( -- version )
 IN: system-info
 
 HOOK: os-version os ( -- version )
@@ -31,4 +31,4 @@ HOOK: username os ( -- string )
     "CPU Speed: " write cpu-mhz ghz nl
     "Physical RAM: " write physical-mem megs nl ;
 
     "CPU Speed: " write cpu-mhz ghz nl
     "Physical RAM: " write physical-mem megs nl ;
 
-"system-info." os name>> append require
+USE-OS-SUFFIX: system-info
index e0154cdb1626e54fce93044b2c0846ba2e2a7b03..822a51be2d560b219ec5887ebd34ad4db59bfd10 100644 (file)
@@ -131,6 +131,7 @@ PRIVATE>
     {
         "IN:" "USE:" "UNUSE:" "QUALIFIED:"
         "QUALIFIED-WITH:" "FROM:" "EXCLUDE:"
     {
         "IN:" "USE:" "UNUSE:" "QUALIFIED:"
         "QUALIFIED-WITH:" "FROM:" "EXCLUDE:"
+        "REUSE:"
     } member? ; inline
 
 : complete-single-vocab? ( tokens -- ? )
     } member? ; inline
 
 : complete-single-vocab? ( tokens -- ? )
index 07104a8c059527518b54a11cbe1078acc35d6d62..e16292d072e5859a963a30b81f3f303861526c01 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators command-line io.directories kernel namespaces
 sequences system tools.deploy.backend tools.deploy.config
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators command-line io.directories kernel namespaces
 sequences system tools.deploy.backend tools.deploy.config
-tools.deploy.config.editor vocabs vocabs.loader ;
+tools.deploy.config.editor vocabs vocabs.loader vocabs.platforms ;
 IN: tools.deploy
 
 ERROR: no-vocab-main vocab ;
 IN: tools.deploy
 
 ERROR: no-vocab-main vocab ;
@@ -23,11 +23,9 @@ ERROR: no-vocab-main vocab ;
     [ vm-path ] 2dip
     swap dup deploy-config make-deploy-image drop ;
 
     [ vm-path ] 2dip
     swap dup deploy-config make-deploy-image drop ;
 
-{
-    { [ os macosx? ] [ "tools.deploy.macosx" ] }
-    { [ os windows? ] [ "tools.deploy.windows" ] }
-    { [ os unix? ] [ "tools.deploy.unix" ] }
-} cond require
+USE-MACOSX: tools.deploy.macosx
+USE-UNIX: tools.deploy.unix
+USE-WINDOWS: tools.deploy.windows
 
 : deploy-main ( -- )
     command-line get [ [ require ] [ deploy ] bi ] each ;
 
 : deploy-main ( -- )
     command-line get [ [ require ] [ deploy ] bi ] each ;
index f7565edc7cba43859f1befe946f3edac329f17e4..b26b3de5b53267a3db45a27dfc6fe7101240b5d7 100644 (file)
@@ -6,11 +6,9 @@ math.order math.parser namespaces sequences splitting system
 tools.disassembler.private tools.disassembler.utils tools.memory ;
 IN: tools.disassembler.udis
 
 tools.disassembler.private tools.disassembler.utils tools.memory ;
 IN: tools.disassembler.udis
 
-<< "libudis86" {
-    { [ os windows? ] [ "libudis86.dll" ] }
-    { [ os macosx? ] [ "libudis86.dylib" ] }
-    { [ os unix? ] [ "libudis86.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: libudis86 cdecl "libudis86.so"
+LIBRARY-MACOSX: libudis86 cdecl "libudis86.dylib"
+LIBRARY-WINDOWS: libudis86 cdecl "libudis86.dll"
 
 LIBRARY: libudis86
 
 
 LIBRARY: libudis86
 
index fbf1ac86e72e89903e0c0d2d0e62f1b3adb85016..63b519f0cf66d711011bd356012447b93db5e665 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors arrays calendar calendar.english
 calendar.format combinators io.directories io.files.info kernel
 math math.parser prettyprint sequences sorting.slots splitting
 USING: accessors arrays calendar calendar.english
 calendar.format combinators io.directories io.files.info kernel
 math math.parser prettyprint sequences sorting.slots splitting
-system vocabs ;
+system vocabs vocabs.platforms ;
 IN: tools.files
 
 <PRIVATE
 IN: tools.files
 
 <PRIVATE
@@ -125,7 +125,5 @@ CONSTANT: default-file-systems-spec
 : file-systems. ( -- )
     default-file-systems-spec print-file-systems ;
 
 : file-systems. ( -- )
     default-file-systems-spec print-file-systems ;
 
-{
-    { [ os unix? ] [ "tools.files.unix" ] }
-    { [ os windows? ] [ "tools.files.windows" ] }
-} cond require
+USE-UNIX: tools.files.unix
+USE-WINDOWS: tools.files.unix
index c8ae57823dbc93ed34c791cfeb1cb89a5e071e04..162ce115a1930bb0765e9d122540c61c5a046060 100644 (file)
@@ -1,11 +1,12 @@
 ! Copyright (C) 2012-2013 Doug Coleman, John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2012-2013 Doug Coleman, John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors prettyprint sequences sorting system vocabs ;
+USING: accessors prettyprint sequences sorting system vocabs
+vocabs.platforms ;
 IN: tools.ps
 
 HOOK: ps os ( -- assoc )
 
 IN: tools.ps
 
 HOOK: ps os ( -- assoc )
 
-"tools.ps." os name>> append require
+USE-OS-SUFFIX: tools.ps
 
 : ps. ( -- )
     ps sort-keys { "PID" "CMD" } prefix simple-table. ;
 
 : ps. ( -- )
     ps sort-keys { "PID" "CMD" } prefix simple-table. ;
index 9ec7b87c3b33fbf3188b34980e4b32f546fbb457..2bbf0ef39fcfd387bfd51b2a0849f4f7a978393b 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors arrays classes classes.algebra classes.tuple
 classes.struct combinators combinators.short-circuit definitions
 effects effects.parser fry generalizations kernel kernel.private
 locals locals.parser macros quotations sequences slots
 classes.struct combinators combinators.short-circuit definitions
 effects effects.parser fry generalizations kernel kernel.private
 locals locals.parser macros quotations sequences slots
-stack-checker.dependencies words ;
+stack-checker.dependencies vocabs.loader words ;
 FROM: classes.tuple.private => tuple-layout ;
 IN: typed
 
 FROM: classes.tuple.private => tuple-layout ;
 IN: typed
 
@@ -166,7 +166,5 @@ SYNTAX: TYPED:
 SYNTAX: TYPED::
     (::) define-typed ;
 
 SYNTAX: TYPED::
     (::) define-typed ;
 
-USE: vocabs.loader
-
-{ "typed" "prettyprint" } "typed.prettyprint" require-when
-{ "typed" "compiler.cfg.debugger" } "typed.debugger" require-when
+USE-WHEN-LOADED: typed.prettyprint { "typed" "prettyprint" }
+USE-WHEN-LOADED: typed.debugger { "typed" "compiler.cfg.debugger" }
index 6ec1c80ab5de227a38b6e5d7bdb6e5e6a3bfa521..12eeae82a19ef98adb6445690441633f0a4a226c 100644 (file)
@@ -519,8 +519,7 @@ os { linux freebsd } member? [
     gtk-ui-backend ui-backend set-global
 ] when
 
     gtk-ui-backend ui-backend set-global
 ] when
 
-{ "ui.backend.gtk" "ui.gadgets.editors" }
-"ui.backend.gtk.input-methods.editors" require-when
-
 M: gtk-ui-backend ui-backend-available?
     "DISPLAY" os-env >boolean ;
 M: gtk-ui-backend ui-backend-available?
     "DISPLAY" os-env >boolean ;
+
+USE-WHEN-LOADED: ui.backend.gtk.input-methods.editors { "ui.backend.gtk" "ui.gadgets.editors" }
index a6c9888b31259ad51ca4aa1328bde57209019afd..b02f427aae9fab5a162658266f138d38e0475000 100644 (file)
@@ -406,4 +406,4 @@ GENERIC: preedit? ( gadget -- ? )
 
 M: gadget preedit? drop f ;
 
 
 M: gadget preedit? drop f ;
 
-{ "ui.gadgets" "prettyprint" } "ui.gadgets.prettyprint" require-when
+USE-WHEN-LOADED: ui.gadgets.prettyprint { "ui.gadgets" "prettyprint" }
index 135d00970e7bd2eb33edd911bf8b5e192dbc01ba..5ff59ff9d1092f9026810fc58ed428807d46b900 100644 (file)
@@ -60,4 +60,6 @@ M: core-text-renderer line-metrics
     [ cached-line metrics>> scale-metrics ]
     if-empty ;
 
     [ cached-line metrics>> scale-metrics ]
     if-empty ;
 
-core-text-renderer font-renderer set-global
+STARTUP-HOOK: [
+    core-text-renderer font-renderer set-global
+]
\ No newline at end of file
index 416630670b18392145aa9af757abe96f52623683..f4aa3497dd4e1cf16d49d3594d310c040b8844b1 100644 (file)
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs cache combinators fonts kernel
 math math.order namespaces opengl opengl.gl opengl.textures
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs cache combinators fonts kernel
 math math.order namespaces opengl opengl.gl opengl.textures
-sequences strings system ui.gadgets.worlds vocabs ;
+sequences strings system ui.gadgets.worlds vocabs
+vocabs.platforms ;
 IN: ui.text
 
 <PRIVATE
 IN: ui.text
 
 <PRIVATE
@@ -79,8 +80,8 @@ M: array draw-text
         ] with each
     ] do-matrix ;
 
         ] with each
     ] do-matrix ;
 
-{
-    { [ os macosx? ] [ "core-text" ] }
-    { [ os windows? ] [ "uniscribe" ] }
-    { [ os unix? ] [ "pango" ] }
-} cond "ui.text." prepend require
+USE-MACOSX: ui.text.core-text
+<!MACOSX
+    USE-UNIX: ui.text.pango
+!MACOSX>
+USE-WINDOWS: ui.text.uniscribe
\ No newline at end of file
index 7c0080f6e8e6cc29863abab3e590de8ad24d8cdf..07cf6e785b5e5e1499fc60b87c0a513c89c8916a 100644 (file)
@@ -2,10 +2,10 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.data alien.libraries
 alien.syntax classes.struct sequences system unix.time
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.data alien.libraries
 alien.syntax classes.struct sequences system unix.time
-unix.types vocabs ;
+unix.types vocabs vocabs.platforms ;
 IN: unix.ffi
 
 IN: unix.ffi
 
-<< "unix.ffi." os name>> append require >>
+USE-OS-SUFFIX: unix.ffi
 
 CONSTANT: PROT_NONE   0
 CONSTANT: PROT_READ   1
 
 CONSTANT: PROT_NONE   0
 CONSTANT: PROT_READ   1
index ef09c56d2f78b4b87c1a1f9e1693062280c1304f..fc964f82c8473139fde0ea957d7dca4e59f87d23 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types alien.syntax system sequences vocabs.loader words
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types alien.syntax system sequences vocabs.loader words
-accessors vocabs ;
+accessors vocabs vocabs.platforms ;
 IN: unix.kqueue
 
 IN: unix.kqueue
 
-<< "unix.kqueue." os name>> append require >>
+USE-OS-SUFFIX: unix.kqueue
 
 FUNCTION: int kqueue ( )
 
 
 FUNCTION: int kqueue ( )
 
index 926740f1baaab91b13486fca49fb7a57ca2a8f32..427ec6f4453ccf7d327acf6e7fae8414f1647a80 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2022 Cat Stevens.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2022 Cat Stevens.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors sequences system vocabs ;
+USING: accessors sequences system vocabs vocabs.platforms ;
 IN: unix.scheduler
 
 IN: unix.scheduler
 
-<< "unix.scheduler." os name>> append require >>
+USE-OS-SUFFIX: unix.scheduler
index 67efa45e9c2ad704c0fcf52b18c22aa7d9d61393..4769bd1533cb5276972531f02ba9ecbbece34ef3 100644 (file)
@@ -1,5 +1,5 @@
 USING: accessors alien.c-types alien.syntax classes.struct
 USING: accessors alien.c-types alien.syntax classes.struct
-kernel sequences system unix vocabs ;
+kernel sequences system unix vocabs vocabs.platforms ;
 IN: unix.stat
 
 ! File Types
 IN: unix.stat
 
 ! File Types
@@ -21,7 +21,7 @@ STRUCT: fsid
 TYPEDEF: fsid __fsid_t
 TYPEDEF: fsid fsid_t
 
 TYPEDEF: fsid __fsid_t
 TYPEDEF: fsid fsid_t
 
-<< "unix.stat." os name>> append require >>
+USE-OS-SUFFIX: unix.stat
 
 : file-status ( pathname -- stat )
     \ stat new [ [ stat-func ] unix-system-call drop ] keep ;
 
 : file-status ( pathname -- stat )
     \ stat new [ [ stat-func ] unix-system-call drop ] keep ;
index 898ba167653b8a5ad49d9d9111c4d0d7f01c1fda..aa8a9c245f1864e42599411b6647e7cee3289dc8 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors sequences system vocabs ;
+USING: accessors sequences system vocabs vocabs.platforms ;
 IN: unix.statvfs
 
 IN: unix.statvfs
 
-"unix.statvfs." os name>> append require
+USE-OS-SUFFIX: unix.statvfs
index c0bc34e9f105ec1af0cf16457ffd489ab7016ec7..31141a179c40b40920dc24634756fe30600153a9 100644 (file)
@@ -1,4 +1,5 @@
-USING: accessors alien.c-types alien.syntax system vocabs ;
+USING: accessors alien.c-types alien.syntax system vocabs
+vocabs.platforms ;
 QUALIFIED: sequences
 IN: unix.types
 
 QUALIFIED: sequences
 IN: unix.types
 
@@ -35,4 +36,4 @@ C-TYPE: rlimit
 C-TYPE: rusage
 C-TYPE: sockaddr
 
 C-TYPE: rusage
 C-TYPE: sockaddr
 
-"unix.types." os name>> sequences:append require
+USE-OS-SUFFIX: unix.types
index da7b8a1594ca1c613a50a015dcd3f97b904eec33..491b0c4f647ae497d883d0cb9883c28288b37e51 100644 (file)
@@ -89,4 +89,4 @@ M: unix open-file [ open ] unix-system-call ;
 
 : unlink-file ( path -- ) [ unlink ] unix-system-call drop ;
 
 
 : unlink-file ( path -- ) [ unlink ] unix-system-call drop ;
 
-{ "unix" "debugger" } "unix.debugger" require-when
+USE-WHEN-LOADED: unix.debugger { "unix" "debugger" }
index 8b81c25c268e9594d02e5def491675a225b4161a..6dfc2ce7c134293e358b8e2d49eadfc6c6c1fc75 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators continuations kernel math
 math.parser namespaces sequences strings system unix unix.ffi
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators continuations kernel math
 math.parser namespaces sequences strings system unix unix.ffi
-vocabs ;
+vocabs vocabs.platforms ;
 QUALIFIED: unix.ffi
 IN: unix.users
 
 QUALIFIED: unix.ffi
 IN: unix.users
 
@@ -132,4 +132,4 @@ ERROR: no-such-user obj ;
 : user-home ( name/uid -- path )
     dup user-passwd [ nip dir>> ] [ no-such-user ] if* ;
 
 : user-home ( name/uid -- path )
     dup user-passwd [ nip dir>> ] [ no-such-user ] if* ;
 
-os macosx? [ "unix.users.macosx" require ] when
+USE-MACOSX: unix.users.macosx
index c61f88d8c76e10e8bbab10747dca148ec5b7b06e..84d5468a22bbf19a3814c1ee52679c535ee0ef34 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.data alien.syntax
 continuations io.encodings.string io.encodings.utf8 kernel
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.data alien.syntax
 continuations io.encodings.string io.encodings.utf8 kernel
-sequences system unix.ffi vocabs ;
+sequences system unix.ffi vocabs vocabs.platforms ;
 IN: unix.utmpx
 
 CONSTANT: EMPTY 0
 IN: unix.utmpx
 
 CONSTANT: EMPTY 0
@@ -47,4 +47,4 @@ M: unix new-utmpx-record
         produce nip
     ] with-utmpx ;
 
         produce nip
     ] with-utmpx ;
 
-"unix.utmpx." os name>> append require
+USE-OS-SUFFIX: unix.utmpx
index 6d1d23255423670651e62c23f8ad9a74661ad250..a4ad98214cc347cd8c8fa66158130f08fef34380 100644 (file)
@@ -218,4 +218,4 @@ PRIVATE>
 ! Literal syntax
 SYNTAX: URL" lexer get skip-blank parse-string >url suffix! ;
 
 ! Literal syntax
 SYNTAX: URL" lexer get skip-blank parse-string >url suffix! ;
 
-{ "urls" "prettyprint" } "urls.prettyprint" require-when
+USE-WHEN-LOADED: urls.prettyprint { "urls" "prettyprint" }
index 62d71c32c97cab2e2d828d74c953ead2241cd9cc..b7a4b35e9612768051cf8ab227981fc8c8f3f7fc 100644 (file)
@@ -86,4 +86,4 @@ INSTANCE: valist assoc
 
 SYNTAX: VA{ \ } [ >valist ] parse-literal ;
 
 
 SYNTAX: VA{ \ } [ >valist ] parse-literal ;
 
-{ "vlists" "prettyprint" } "vlists.prettyprint" require-when
+USE-WHEN-LOADED: vlists.prettyprint { "vlists" "prettyprint" }
index 4f91ab1c72c4ec4114707d73f2ef9bb9a20c699e..5374da3221214f1db787c133bf8155fa5c2b4d5d 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2018 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2018 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors compiler.units kernel lexer multiline parser
-sequences splitting system vocabs.parser ;
+USING: accessors arrays compiler.units kernel lexer multiline
+namespaces parser sequences sets splitting system vocabs
+vocabs.loader.private vocabs.parser ;
 IN: vocabs.platforms
 
 : with-vocabulary ( quot suffix -- )
 IN: vocabs.platforms
 
 : with-vocabulary ( quot suffix -- )
@@ -56,10 +57,28 @@ SYNTAX: USE-FREEBSD: scan-token os freebsd? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-LINUX: scan-token os linux? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-MACOSX: scan-token os macosx? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-WINDOWS: scan-token os windows? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-LINUX: scan-token os linux? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-MACOSX: scan-token os macosx? [ use-vocab ] [ drop ] if ;
 SYNTAX: USE-WINDOWS: scan-token os windows? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-OS-SUFFIX: scan-token os name>> "." glue require ;
 
 
-SYNTAX: USE-X86-32: scan-token os x86.32? [ use-vocab ] [ drop ] if ;
-SYNTAX: USE-X86-64: scan-token os x86.64? [ use-vocab ] [ drop ] if ;
-SYNTAX: USE-ARM-32: scan-token os arm.32? [ use-vocab ] [ drop ] if ;
-SYNTAX: USE-ARM-64: scan-token os arm.64? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-X86: scan-token cpu x86? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-X86-32: scan-token cpu x86.32? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-X86-64: scan-token cpu x86.64? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-ARM: scan-token cpu arm? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-ARM-32: scan-token cpu arm.32? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-ARM-64: scan-token cpu arm.64? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-PPC: scan-token cpu ppc? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-PPC-32: scan-token cpu ppc.32? [ use-vocab ] [ drop ] if ;
+SYNTAX: USE-PPC-64: scan-token cpu ppc.64? [ use-vocab ] [ drop ] if ;
 
 SYNTAX: USE-IF: scan-token scan-object call( -- ? ) [ use-vocab ] [ drop ] if ;
 
 SYNTAX: USE-IF: scan-token scan-object call( -- ? ) [ use-vocab ] [ drop ] if ;
+
+SYNTAX: WHEN-UNIX: scan-object os unix? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-FREEBSD: scan-object os freebsd? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-LINUX: scan-object os linux? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-MACOSX: scan-object os macosx? [ call( -- ) ] [ drop ] if ;
+SYNTAX: WHEN-WINDOWS: scan-object os windows? [ call( -- ) ] [ drop ] if ;
+
+SYNTAX: IF-UNIX: scan-object scan-object os unix? -rot ? call( -- ) ;
+SYNTAX: IF-FREEBSD: scan-object scan-object os freebsd? -rot ? call( -- ) ;
+SYNTAX: IF-LINUX: scan-object scan-object os linux? -rot ? call( -- ) ;
+SYNTAX: IF-MACOSX: scan-object scan-object os macosx? -rot ? call( -- ) ;
+SYNTAX: IF-WINDOWS: scan-object scan-object os windows? -rot ? call( -- ) ;
index 9b6986d7107f95a2b633bc096d1b52391ca43fb6..e3bde98e88cb23a41370792b2051ee82828ab7f6 100644 (file)
@@ -1,12 +1,12 @@
 ! Copyright (C) 2011 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 USING: accessors command-line io.pathnames kernel namespaces
 ! Copyright (C) 2011 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 USING: accessors command-line io.pathnames kernel namespaces
-sequences strings system ui.operations urls vocabs ;
+sequences strings system ui.operations urls vocabs vocabs.platforms ;
 IN: webbrowser
 
 HOOK: open-item os ( item -- )
 
 IN: webbrowser
 
 HOOK: open-item os ( item -- )
 
-"webbrowser." os name>> append require
+USE-OS-SUFFIX: webbrowser
 
 : open-url ( url -- )
     >url open-item ;
 
 : open-url ( url -- )
     >url open-item ;
index 4fffe99e155fcb6630fc26b0e47cdfbe2c405522..d1770889c63a601b82a82c1679a09f4e185c2764 100644 (file)
@@ -2,7 +2,7 @@ USING: alien alien.c-types alien.data alien.accessors
 alien.parser effects kernel windows.ole32 parser lexer splitting
 grouping sequences namespaces assocs quotations generalizations
 accessors words macros alien.syntax fry arrays layouts math
 alien.parser effects kernel windows.ole32 parser lexer splitting
 grouping sequences namespaces assocs quotations generalizations
 accessors words macros alien.syntax fry arrays layouts math
-classes.struct windows.kernel32 locals ;
+classes.struct windows.kernel32 locals vocabs.loader ;
 FROM: alien.parser.private => parse-pointers ;
 IN: windows.com.syntax
 
 FROM: alien.parser.private => parse-pointers ;
 IN: windows.com.syntax
 
@@ -94,6 +94,4 @@ SYNTAX: COM-INTERFACE:
 
 SYNTAX: GUID: scan-token string>guid suffix! ;
 
 
 SYNTAX: GUID: scan-token string>guid suffix! ;
 
-USE: vocabs.loader
-
-{ "windows.com" "prettyprint" } "windows.com.prettyprint" require-when
+USE-WHEN-LOADED: windows.com.prettyprint { "windows.com" "prettyprint" }
index e548959c4f0b03340d65df7efacc681c08e97fa8..20287b63af185a7798dd77344a205098bfe0e2d2 100644 (file)
@@ -7,10 +7,8 @@ windows.errors windows.kernel32 windows.types ;
 FROM: alien.c-types => short ;
 IN: windows.winsock
 
 FROM: alien.c-types => short ;
 IN: windows.winsock
 
-<<
-! Some differences between Win32 and Win64
-cpu x86.64? "windows.winsock.64" "windows.winsock.32" ? use-vocab
->>
+USE-X86-64: windows.winsock.64
+USE-X86-32: windows.winsock.32
 
 TYPEDEF: int* SOCKET
 
 
 TYPEDEF: int* SOCKET
 
index fc749012ab2ee2507929ad083999057cf0505349..fe97b2d838b80db190ab4385137e8de361f01e98 100644 (file)
@@ -32,4 +32,4 @@ SYMBOL: root
 : with-x ( display-string quot -- )
     [ init-x ] dip [ close-x ] finally ; inline
 
 : with-x ( display-string quot -- )
     [ init-x ] dip [ close-x ] finally ; inline
 
-{ "x11" "io.backend.unix" } "x11.io.unix" require-when
+USE-WHEN-LOADED: x11.io.unix { "x11" "io.backend.unix" }
index 7640822d9cae7921b94905c26d583f7f6a5480c9..751a0ddc6fd916ad9c9a098fe0ea64616d840503 100644 (file)
@@ -107,4 +107,4 @@ XML-ERROR: bad-encoding encoding ;
 UNION: xml-error
     unclosed multitags notags pre/post-content generated-xml-error ;
 
 UNION: xml-error
     unclosed multitags notags pre/post-content generated-xml-error ;
 
-{ "xml.errors" "debugger" } "xml.errors.debugger" require-when
+USE-WHEN-LOADED: xml.errors.debugger { "xml.errors" "debugger" }
index aeebe98bbe66cc65d38bf71a6d352e2dfa107ed6..b91a8530f885ade8dcf843a683264ce81c9a6d42 100644 (file)
@@ -177,4 +177,4 @@ SYNTAX: [XML
 
 USE: vocabs.loader
 
 
 USE: vocabs.loader
 
-{ "xml.syntax" "inverse" } "xml.syntax.inverse" require-when
+USE-WHEN-LOADED: xml.syntax.inverse { "xml.syntax" "inverse" }
index 5d7354b5776087b8617523b3611d7872ebce29d6..8b8fa94cf69c7534069e5f9051d06d4ce1a47d25 100644 (file)
@@ -44,3 +44,6 @@ M: identity-hashtable new-assoc drop <identity-hashtable> ;
 
 { "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when
 { "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when
 
 { "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when
 { "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when
+
+! USE-WHEN-LOADED: hashtables.identity.prettyprint { "hashtables.identity" "prettyprint" }
+! USE-WHEN-LOADED: hashtables.identity.mirrors { "hashtables.identity" "mirrors" }
index e2e00e05168f8e755c73d848f52acce04f4221b4..34a4ba10b00193f8560e997bf2be8beb0b8ae45c 100644 (file)
@@ -48,3 +48,5 @@ M: wrapped-hashtable equal?
 INSTANCE: wrapped-hashtable assoc
 
 { "hashtables.wrapped" "prettyprint" } "hashtables.wrapped.prettyprint" require-when
 INSTANCE: wrapped-hashtable assoc
 
 { "hashtables.wrapped" "prettyprint" } "hashtables.wrapped.prettyprint" require-when
+
+! USE-WHEN-LOADED: hashtables.wrapped.prettyprint { "hashtables.wrapped" "prettyprint" }
index da5f49f9c6b95cc22861c60b907cdd79cc52f2cb..678ae359176ca9a2adffad60591a4fc2434394ff 100644 (file)
@@ -13,3 +13,5 @@ IN: locals
 
 { "locals" "prettyprint" } "locals.definitions" require-when
 { "locals" "prettyprint" } "locals.prettyprint" require-when
 
 { "locals" "prettyprint" } "locals.definitions" require-when
 { "locals" "prettyprint" } "locals.prettyprint" require-when
+! USE-WHEN-LOADED: locals.definitions { "locals" "prettyprint" }
+! USE-WHEN-LOADED: locals.prettyprint { "locals" "prettyprint" }
index 5814657aee82d36edf24ed973a5ab1ee7fbc4c0b..75c651607369c4cdec6cecd95f42fdc2cb11595e 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2007, 2010 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs combinators continuations
 ! Copyright (C) 2007, 2010 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs combinators continuations
-definitions init io io.files io.pathnames kernel make namespaces
-parser sequences sets splitting strings vocabs words ;
+definitions init io io.files io.pathnames kernel lexer make
+namespaces parser sequences sets splitting strings vocabs words ;
 IN: vocabs.loader
 
 SYMBOL: vocab-roots
 IN: vocabs.loader
 
 SYMBOL: vocab-roots
@@ -184,5 +184,16 @@ PRIVATE>
 
 M: vocab-spec where vocab-source-path dup [ 1 2array ] when ;
 
 
 M: vocab-spec where vocab-source-path dup [ 1 2array ] when ;
 
+SYNTAX: USE-WHEN-LOADED:
+    scan-token
+    scan-object
+    dup [ lookup-vocab ] all? [
+        drop require
+    ] [
+        [ nip require-when-vocabs get adjoin-all ]
+        [ swap 2array require-when-table get push ] 2bi
+    ] if ;
+
 ! put here to avoid circularity between vocabs.loader and source-files.errors
 { "source-files.errors" "debugger" } "source-files.errors.debugger" require-when
 ! put here to avoid circularity between vocabs.loader and source-files.errors
 { "source-files.errors" "debugger" } "source-files.errors.debugger" require-when
+! USE-WHEN-LOADED: source-files.errors.debugger { "source-files.errors" "debugger" }
index cd35d83e4f2f04faf6afad11f304fbafc7ded364..5dde497df5b99e41e081e2d0bac6ca14ce2956f6 100644 (file)
@@ -3,3 +3,5 @@ IN: vocabs.loader.test.m
 
 { "vocabs.loader.test.o" "vocabs.loader.test.m" }
 "vocabs.loader.test.n" require-when
 
 { "vocabs.loader.test.o" "vocabs.loader.test.m" }
 "vocabs.loader.test.n" require-when
+
+! USE-WHEN-LOADED: vocabs.loader.test.n { "vocabs.loader.test.o" "vocabs.loader.test.m" }
index 231795530dc373cf97523c9765a8680f26759761..c07128f097bf648cc95ec5f02b5f4efafc406791 100644 (file)
@@ -6,15 +6,12 @@ kernel math math.order sequences typed specialized-arrays system ;
 SPECIALIZED-ARRAY: void*
 IN: chipmunk.ffi
 
 SPECIALIZED-ARRAY: void*
 IN: chipmunk.ffi
 
-<<
-"chipmunk" {
-    { [ os windows? ] [ "chipmunk.dll" ] }
-    { [ os macosx? ] [ "libchipmunk.dylib"  ] }
-    { [ os unix?  ] [ "libchipmunk.so" ] }
-} cond cdecl add-library
-
-"chipmunk" deploy-library
->>
+LIBRARY-WINDOWS: chipmunk cdecl "chipmunk.dll"
+LIBRARY-UNIX: chipmunk cdecl "libchipmunk.so"
+LIBRARY-MACOSX: chipmunk cdecl "libchipmunk.dylib"
+
+DEPLOY-LIBRARY: chipmunk
+
 LIBRARY: chipmunk
 
 ! chipmunk_types.h
 LIBRARY: chipmunk
 
 ! chipmunk_types.h
index 8cd4b36e9b6960511da47b683dfa36f556fefa4f..dc933192b23d8c6e2c47620eddb4c833b4c6c5ca 100644 (file)
@@ -11,12 +11,6 @@ IN: clutter.cally.ffi
 
 LIBRARY: clutter.cally
 
 
 LIBRARY: clutter.cally
 
-<<
-"clutter.cally" {
-    { [ os windows? ] [ drop ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
-} cond
->>
+LIBRARY-UNIX: clutter.cally cdecl "libclutter-glx-1.0.so"
 
 GIR: Cally-1.0.gir
 
 GIR: Cally-1.0.gir
index 23fcc1297732d717bfdea6a1f400afea7e93f571..8650e0313987d951baa267f0701a92334e5195ca 100644 (file)
@@ -10,13 +10,7 @@ IN: clutter.cogl.ffi
 
 LIBRARY: clutter.cogl
 
 
 LIBRARY: clutter.cogl
 
-<<
-"clutter.cogl" {
-    { [ os windows? ] [ drop ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
-} cond
->>
+LIBRARY-UNIX: clutter.cogl cdecl "libclutter-glx-1.0.so"
 
 FOREIGN-ATOMIC-TYPE: GL.uint GLuint
 FOREIGN-ATOMIC-TYPE: GL.enum GLenum
 
 FOREIGN-ATOMIC-TYPE: GL.uint GLuint
 FOREIGN-ATOMIC-TYPE: GL.enum GLenum
index c099fdd03bde878122d4025d30f6d3e0291e40a6..9538d7f9f603804d5baefd017240a7876df76160 100644 (file)
@@ -14,13 +14,7 @@ IN: clutter.ffi
 
 LIBRARY: clutter
 
 
 LIBRARY: clutter
 
-<<
-"clutter" {
-    { [ os windows? ] [ drop ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
-} cond
->>
+LIBRARY-UNIX: clutter cdecl "libclutter-glx-1.0.so"
 
 FOREIGN-RECORD-TYPE: cairo.Path cairo_path_t
 
 
 FOREIGN-RECORD-TYPE: cairo.Path cairo_path_t
 
index ae60b18f64016ac78913a4b33fd1ba037c83f665..7cd0ff6d3130c65f89c9ae9046377fa5966b95b5 100644 (file)
@@ -11,12 +11,6 @@ IN: clutter.gtk.ffi
 
 LIBRARY: clutter.gtk
 
 
 LIBRARY: clutter.gtk
 
-<<
-"clutter.gtk" {
-    { [ os windows? ] [ drop ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libclutter-gtk-1.0.so" cdecl add-library ] }
-} cond
->>
+LIBRARY-UNIX: clutter.gtk cdecl "libclutter-gtk-1.0.so"
 
 GIR: GtkClutter-1.0.gir
 
 GIR: GtkClutter-1.0.gir
index 1e7301e4f90f6d42c79e25bd499f8f6e2681d5af..b9e3f8f5ca7e714e8813c37685ba3904014aadd1 100644 (file)
@@ -11,12 +11,6 @@ IN: clutter.json.ffi
 
 LIBRARY: clutter.json
 
 
 LIBRARY: clutter.json
 
-<<
-"clutter.json" {
-    { [ os windows? ] [ drop ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
-} cond
->>
+LIBRARY-UNIX: clutter.json cdecl "libclutter-glx-1.0.so"
 
 GIR: Json-1.0.gir
 
 GIR: Json-1.0.gir
index 8a9d40fcbb675e7f2db0e48e5564bb1d4ed926b7..0777fb0d9441ff2c54515e665e25d0ac36c5e163 100644 (file)
@@ -4,13 +4,9 @@ USING: accessors alien alien.c-types alien.libraries alien.syntax
 classes.struct combinators kernel system ;
 IN: cuda.ffi
 
 classes.struct combinators kernel system ;
 IN: cuda.ffi
 
-<<
-"cuda" {
-    { [ os windows? ] [ "nvcuda.dll" stdcall ] }
-    { [ os macosx? ] [ "/usr/local/cuda/lib/libcuda.dylib" cdecl ] }
-    { [ os unix? ] [ "libcuda.so" cdecl ] }
-} cond add-library
->>
+LIBRARY-UNIX: cuda cdecl "libcuda.so"
+LIBRARY-MACOSX: cuda cdecl "/usr/local/cuda/lib/libcuda.dylib"
+LIBRARY-WINDOWS: cuda stdcall "nvcuda.dll"
 
 LIBRARY: cuda
 
 
 LIBRARY: cuda
 
index 52759458b3f5e41faaf5a258e3e81eac4731b6d8..3e6f6d275684193cfbdb87d144f8145e9455f26d 100644 (file)
@@ -199,4 +199,4 @@ ERROR: bad-cuda-abi abi ;
     normalize-path <cuda-library>
     dup name>> cuda-libraries get-global set-at ;
 
     normalize-path <cuda-library>
     dup name>> cuda-libraries get-global set-at ;
 
-{ "cuda.libraries" "prettyprint" } "cuda.prettyprint" require-when
+USE-WHEN-LOADED: cuda.prettyprint { "cuda.libraries" "prettyprint" }
index c0eb146a6afa0529faccd3e3100ab451a2eb483a..79ff97eacade4ecef2f5b2ab0332a814fe77eb16 100644 (file)
@@ -4,10 +4,8 @@ system words ;
 
 IN: curl.ffi
 
 
 IN: curl.ffi
 
-<< "curl" {
-    { [ os macosx? ] [ "libcurl.dylib" ] }
-    { [ os unix? ] [ "libcurl.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: curl cdecl "libcurl.so"
+LIBRARY-MACOSX: curl cdecl "libcurl.dylib"
 
 LIBRARY: curl
 
 
 LIBRARY: curl
 
index 88e85538fa849c8bf52e48880178963681906d23..daa0bfe8e55419dc6778d01d0331d03ff24bdaf2 100644 (file)
@@ -10,6 +10,12 @@ IN: curses.ffi
     { [ os unix?  ]  [ "ncursesw" find-library ] }
 } cond cdecl add-library >>
 
     { [ os unix?  ]  [ "ncursesw" find-library ] }
 } cond cdecl add-library >>
 
+<!MACOSX
+LIBRARY-UNIX: curses cdecl $[ "ncursesw" find-library ]
+!MACOSX>
+LIBRARY-MACOSX: curses cdecl "libcurses.dylib"
+LIBRARY-WINDOWS: curses cdecl "libcurses.dll"
+
 C-TYPE: SCREEN
 TYPEDEF: void* va_list
 
 C-TYPE: SCREEN
 TYPEDEF: void* va_list
 
index 439ed145fdc74e732448d69fcd20c7dbcffe6b24..576351bf1b6cdd028cd522abfd70d5c27c5b4750 100644 (file)
@@ -1,6 +1,7 @@
 USING: accessors arrays assocs combinators command-line
 environment formatting fry io.launcher kernel locals math
 USING: accessors arrays assocs combinators command-line
 environment formatting fry io.launcher kernel locals math
-namespaces sequences splitting strings system ui vocabs ;
+namespaces sequences splitting strings system ui vocabs
+vocabs.platforms ;
 IN: elevate
 
 <PRIVATE
 IN: elevate
 
 <PRIVATE
@@ -27,10 +28,7 @@ HOOK: lowered  os ( -- )
 
 : elevate ( win-console? posix-graphical? -- ) [ (command-line) t ] 2dip elevated drop ;
 
 
 : elevate ( win-console? posix-graphical? -- ) [ (command-line) t ] 2dip elevated drop ;
 
-os unix? [ "elevate.unix" require ] when
-
-{
-    { [ os windows? ] [ "elevate.windows" require ] }
-    { [ os linux? ] [ "elevate.linux" require ] }
-    { [ os macosx? ] [ "elevate.macosx" require ] }
-} cond
+USE-UNIX: elevate.unix
+USE-WINDOWS: elevate.windows
+USE-LINUX: elevate.linux
+USE-MACOSX: elevate.macosx
index 3713354426d2ebbdc99d25b11b3faad62155a125..22d5b2b9ad18662f2c36942740f76e4236642622 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2014 John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
 ! Copyright (C) 2014 John Benediktsson.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors sequences system vocabs ;
+USING: accessors sequences system vocabs vocabs.platforms ;
 IN: file-picker
 
 HOOK: open-file-dialog os ( -- paths )
 HOOK: save-file-dialog os ( path -- paths )
 
 IN: file-picker
 
 HOOK: open-file-dialog os ( -- paths )
 HOOK: save-file-dialog os ( path -- paths )
 
-os name>> "file-picker." prepend require
+USE-OS-SUFFIX: file-picker
index 19de40e32a5a1e21e0536965ed48289cf6652499..09bf1ffb0db661a1ef14d997d7493c447ae65304 100644 (file)
@@ -1,11 +1,11 @@
-USING: kernel listener system vocabs ;
+USING: kernel listener system vocabs vocabs.platforms ;
 IN: fuel.listener
 
 HOOK: fuel-pty-setup os ( -- )
 
 M: object fuel-pty-setup ;
 
 IN: fuel.listener
 
 HOOK: fuel-pty-setup os ( -- )
 
 M: object fuel-pty-setup ;
 
-os linux? [ "fuel.listener.linux" require ] when
+USE-LINUX: fuel.listener.linux
 
 : fuel-listener ( -- )
     fuel-pty-setup listener-main ;
 
 : fuel-listener ( -- )
     fuel-pty-setup listener-main ;
index a037a4dff682655c3e7c65dca83cbf7616e4f26f..6d151ee71ae8db22b196ca99d80064dab8e1bdef 100644 (file)
@@ -97,5 +97,5 @@ PRIVATE>
 M: game-loop dispose
     stop-loop ;
 
 M: game-loop dispose
     stop-loop ;
 
-{ "game.loop" "prettyprint" } "game.loop.prettyprint" require-when
-{ "game.loop" "tools.memory" } "game.loop.benchmark" require-when
+USE-WHEN-LOADED: game.loop.prettyprint { "game.loop" "prettyprint" }
+USE-WHEN-LOADED: game.loop.benchmark { "game.loop" "tools.memory" }
index 33b62f5078f116a9ce8ab13e32dd4a87439311a5..f33ec8117b8b52b9ca0b3fbce5ff5fdb9a9ecbe7 100644 (file)
@@ -633,4 +633,4 @@ M: program-instance dispose
     [ world>> ] [ program>> instances>> ] [ ] tri ?delete-at
     reset-memos ;
 
     [ world>> ] [ program>> instances>> ] [ ] tri ?delete-at
     reset-memos ;
 
-{ "gpu.shaders" "prettyprint" } "gpu.shaders.prettyprint" require-when
+USE-WHEN-LOADED: gpu.shaders.prettyprint { "gpu.shaders" "prettyprint" }
index 4f2ed5a84a553e3a229856be9f56e7aa67901784..94651b0a992dde821fb98318ba7ec893b0a00cf3 100644 (file)
@@ -5,7 +5,7 @@ graphviz.dot images.viewer io.backend io.directories
 io.encodings.latin1 io.encodings.utf8 io.files
 io.files.temp io.files.unique io.launcher io.standard-paths
 kernel locals make namespaces sequences summary system threads
 io.encodings.latin1 io.encodings.utf8 io.files
 io.files.temp io.files.unique io.launcher io.standard-paths
 kernel locals make namespaces sequences summary system threads
-unicode vocabs webbrowser words ;
+unicode vocabs webbrowser words vocabs.platforms ;
 IN: graphviz.render
 
 <PRIVATE
 IN: graphviz.render
 
 <PRIVATE
@@ -202,4 +202,4 @@ PRIVATE>
     standard-formats [ define-graphviz-by-format ] each
 ] with-compilation-unit
 
     standard-formats [ define-graphviz-by-format ] each
 ] with-compilation-unit
 
-os windows? [ "graphviz.render.windows" require ] when
+USE-WINDOWS: graphviz.render.windows
index 95e729106fc866df1c7980a09710fb20623524a5..7729546987acb5180b70d1fdb8f65e044a2ad3df 100644 (file)
@@ -7,8 +7,6 @@ IN: io.files.trash
 
 HOOK: send-to-trash os ( path -- )
 
 
 HOOK: send-to-trash os ( path -- )
 
-{
-    { [ os windows? ] [ "io.files.trash.windows" ] }
-    { [ os macosx? ] [ "io.files.trash.macosx" ] }
-    { [ os unix? ] [ "io.files.trash.unix" ] }
-} cond require
+USE-MACOSX: io.files.trash.macosx
+USE-UNIX: io.files.trash.unix
+USE-WINDOWS: io.files.trash.windows
index f62c0c396d8ab24bfc6e9dde8a02e96340b1b723..9bfb678b24391cc9a13c01d2023bdc6a012db519 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors destructors io.streams.duplex kernel
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors destructors io.streams.duplex kernel
-math.parser sequences summary system vocabs ;
+math.parser sequences summary system vocabs vocabs.platforms ;
 IN: io.serial
 
 TUPLE: serial-port < disposable stream path baud
 IN: io.serial
 
 TUPLE: serial-port < disposable stream path baud
@@ -26,4 +26,4 @@ M: serial-port dispose* ( serial -- ) stream>> dispose ;
 : with-serial-port ( serial-port quot -- )
     [ open-serial ] dip with-stream ; inline
 
 : with-serial-port ( serial-port quot -- )
     [ open-serial ] dip with-stream ; inline
 
-"io.serial." os name>> append require
+USE-OS-SUFFIX: io.serial
index d44ac811ea598bc2504cce8166f964b85d553407..449239c93910a019f024c159a67420c464760cf4 100644 (file)
@@ -1,12 +1,10 @@
 USING: alien alien.c-types alien.libraries alien.syntax
 USING: alien alien.c-types alien.libraries alien.syntax
-classes.struct combinators system ;
+classes.struct combinators system vocabs.platforms ;
 IN: pcre.ffi
 
 IN: pcre.ffi
 
-<< "pcre" {
-    { [ os windows? ] [ "pcre.dll" ] }
-    { [ os macosx? ] [ "libpcre.dylib" ] }
-    { [ os unix? ] [ "libpcre.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: pcre cdecl "pcre.so"
+LIBRARY-MACOSX: pcre cdecl "libpcre.dylib"
+LIBRARY-WINDOWS: pcre cdecl "libpcre.dll"
 
 LIBRARY: pcre
 
 
 LIBRARY: pcre
 
index 2895c2bdf1dc95d5cdbeb36147199b1d0f829955..1ced8c9049e13d05dc92e192981c1d9cc1c9e059 100644 (file)
@@ -1,10 +1,10 @@
 USING: alien alien.c-types alien.destructors alien.libraries
 USING: alien alien.c-types alien.destructors alien.libraries
-alien.libraries.finder alien.syntax classes.struct ;
+alien.libraries.finder alien.syntax classes.struct vocabs.platforms ;
 IN: python.ffi
 
 IN: python.ffi
 
-<< "python"
-{ "python3.10" "python3.9" "python3.8" "python3.7" } find-library-from-list
-cdecl add-library >>
+ADD-FIRST-LIBRARY: python cdecl {
+    "python3.12" "python3.11" "python3.10" "python3.9" "python3.8" "python3.7"
+}
 
 ! Functions that return borrowed references needs to be called like this:
 ! Py_Func dup Py_IncRef &Py_DecRef
 
 ! Functions that return borrowed references needs to be called like this:
 ! Py_Func dup Py_IncRef &Py_DecRef
index 49f816c18b6b2d6525d274c27ab7abd68a1f57ad..9ddd028c53d82ce0808b5684f63e079b5295b0c2 100644 (file)
@@ -9,15 +9,11 @@ raylib.util sequences sequences.private system ;
 IN: raylib
 FROM: alien.c-types => float ;
 
 IN: raylib
 FROM: alien.c-types => float ;
 
-<<
-"raylib" {
-    { [ os windows? ] [ "raylib.dll" ] }
-    { [ os macosx? ] [ "libraylib.dylib" ] }
-    { [ os unix? ] [ "libraylib.so" ] }
-} cond cdecl add-library
-
-"raylib" deploy-library
->>
+LIBRARY-UNIX: raylib cdecl "libraylib.so"
+LIBRARY-MACOSX: raylib cdecl "libraylib.dylib"
+LIBRARY-WINDOWS: raylib cdecl "raylib.dll"
+
+DEPLOY-LIBRARY: raylib
 
 LIBRARY: raylib
 
 
 LIBRARY: raylib
 
index 0aec267b439a4b84cb5c4367befd9850bb3f0f4c..30eb3aeb5208e89a2ae211cf025a8544581720d8 100644 (file)
@@ -5,11 +5,9 @@ classes.struct combinators literals math.order
 sodium.ffi.const sodium.ffi.const.size_max system ;
 IN: sodium.ffi
 
 sodium.ffi.const sodium.ffi.const.size_max system ;
 IN: sodium.ffi
 
-<< "sodium" {
-    { [ os windows? ] [ "libsodium.dll" ] }
-    { [ os macosx? ] [ "libsodium.dylib" ] }
-    { [ os unix? ] [ "libsodium.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: sodium cdecl "libsodium.so"
+LIBRARY-MACOSX: sodium cdecl "libsodium.dylib"
+LIBRARY-WINDOWS: sodium cdecl "libsodium.dll"
 
 LIBRARY: sodium
 
 
 LIBRARY: sodium
 
index 996220b6cc3eafea2e894137b6161935704c6442..cf780a3e6ca180f8895899d0dfe38c11dff6e0de 100644 (file)
@@ -2,13 +2,13 @@
 ! See http://factorcode.org/license.txt for BSD license
 
 USING: accessors arrays environment kernel math math.parser
 ! See http://factorcode.org/license.txt for BSD license
 
 USING: accessors arrays environment kernel math math.parser
-sequences system vocabs ;
+sequences system vocabs vocabs.platforms ;
 
 IN: terminal
 
 HOOK: (terminal-size) os ( -- columns lines )
 
 
 IN: terminal
 
 HOOK: (terminal-size) os ( -- columns lines )
 
-"terminal." os name>> append require
+USE-OS-SUFFIX: terminal
 
 : terminal-size ( -- dim )
     "COLUMNS" "LINES"
 
 : terminal-size ( -- dim )
     "COLUMNS" "LINES"
index 5e72d506903b81528efddd5a97e279994ba21865..3736a86ff083d3f32b044bc71f816c4a8d2eb015 100644 (file)
@@ -14,11 +14,9 @@ IN: text-to-speech
 
 HOOK: speak-text os ( str -- )
 
 
 HOOK: speak-text os ( str -- )
 
-{
-    { [ os macosx?  ] [ "text-to-speech.macosx"  ] }
-    { [ os linux?   ] [ "text-to-speech.linux"   ] }
-    { [ os windows? ] [ "text-to-speech.windows" ] }
-} cond require
+USE-LINUX: text-to-speech.linux
+USE-MACOSX: text-to-speech.macosx
+USE-WINDOWS: text-to-speech.windows
 
 GENERIC: speak ( obj -- )
 
 
 GENERIC: speak ( obj -- )
 
index cd076e50d90a6c518b00b8f9f6f66b1f90f954a4..33a84a28c2f1fc2fea507c100083be34d2b1e436 100644 (file)
@@ -6,8 +6,6 @@ IN: time
 HOOK: set-system-time os ( timestamp -- )
 HOOK: adjust-time-monotonic os ( timestamp -- seconds )
 
 HOOK: set-system-time os ( timestamp -- )
 HOOK: adjust-time-monotonic os ( timestamp -- seconds )
 
-{
-    { [ os windows? ] [ "time.windows" ] }
-    { [ os macosx? ] [ "time.macosx" ] }
-    { [ os unix? ] [ "time.unix" ] }
-} cond require
+USE-MACOSX: time.macosx
+USE-UNIX: time.unix
+USE-WINDOWS: time.windows
index fce11ac660f26ec06c57eff4a29cedb4aa9bf4a8..322fd91456112e811c2d410dd48463f0e6e2be6e 100644 (file)
@@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax
 combinators system tokyo.alien.tcutil tokyo.alien.tctdb ;
 IN: tokyo.alien.tcrdb
 
 combinators system tokyo.alien.tcutil tokyo.alien.tctdb ;
 IN: tokyo.alien.tcrdb
 
-<< "tokyotyrant" {
-    { [ os macosx? ] [ "libtokyotyrant.dylib" ] }
-    { [ os unix? ] [ "libtokyotyrant.so" ] }
-    { [ os windows? ] [ "tokyotyrant.dll" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: tokyotyrant cdecl "libtokyotyrant.so"
+LIBRARY-MACOSX: tokyotyrant cdecl "libtokyotyrant.dylib"
+LIBRARY-WINDOWS: tokyotyrant cdecl "libtokyotyrant.dll"
 
 LIBRARY: tokyotyrant
 
 
 LIBRARY: tokyotyrant
 
index 39e9b48d67d9a2e889ab21c0261fe9f08255e2c3..feb1a1168fc1cfe21086b95716099a32c67a0e8a 100644 (file)
@@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax
 combinators system ;
 IN: tokyo.alien.tcutil
 
 combinators system ;
 IN: tokyo.alien.tcutil
 
-<< "tokyocabinet" {
-    { [ os macosx? ] [ "libtokyocabinet.dylib" ] }
-    { [ os unix? ] [ "libtokyocabinet.so" ] }
-    { [ os windows? ] [ "tokyocabinet.dll" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: tokyocabinet cdecl "tokyocabinet.so"
+LIBRARY-MACOSX: tokyocabinet cdecl "tokyocabinet.dylib"
+LIBRARY-WINDOWS: tokyocabinet cdecl "tokyocabinet.dll"
 
 LIBRARY: tokyocabinet
 
 
 LIBRARY: tokyocabinet
 
index f6fe6072412fb07d8a85b8d3ed37ba252938b3ab..d48623cb19ee3687390f0b766853bfc89bf05e0a 100644 (file)
@@ -1,6 +1,6 @@
 USING: accessors assocs classes.struct io locals math.bitwise
 namespaces system tools.image-analyzer.utils tools.image-analyzer.vm
 USING: accessors assocs classes.struct io locals math.bitwise
 namespaces system tools.image-analyzer.utils tools.image-analyzer.vm
-vm vocabs.parser ;
+vm vocabs.parser vocabs.platforms ;
 IN: tools.image-analyzer.data-heap-reader
 FROM: alien.c-types => uchar heap-size ;
 FROM: arrays => 2array ;
 IN: tools.image-analyzer.data-heap-reader
 FROM: alien.c-types => uchar heap-size ;
 FROM: arrays => 2array ;
@@ -8,13 +8,8 @@ FROM: kernel => ? boa bi dup keep nip swap ;
 FROM: layouts => data-alignment ;
 FROM: math => + - * align neg shift ;
 
 FROM: layouts => data-alignment ;
 FROM: math => + - * align neg shift ;
 
-<<
-! For the two annoying structs that differ on 32 and 64 bit.
-cpu x86.32?
-"tools.image-analyzer.vm.32"
-"tools.image-analyzer.vm.64"
-? use-vocab
->>
+USE-X86-64: tools.image-analyzer.vm.64
+USE-X86-32: tools.image-analyzer.vm.32
 
 : tag>class ( tag -- class )
     {
 
 : tag>class ( tag -- class )
     {
index 1f50fb7cddc22f61a21000a7dc2523fa3719989b..2aa92d1026fbe2a8a579e7c627c92315abc46fe8 100644 (file)
@@ -3,20 +3,15 @@
 USING: accessors alien.strings assocs classes fry graphviz
 graphviz.attributes graphviz.notation math.bitwise sequences sets
 system tools.image-analyzer.references tools.image-analyzer.utils
 USING: accessors alien.strings assocs classes fry graphviz
 graphviz.attributes graphviz.notation math.bitwise sequences sets
 system tools.image-analyzer.references tools.image-analyzer.utils
-tools.image-analyzer.vm vocabs.parser ;
+tools.image-analyzer.vm vocabs.parser vocabs.platforms ;
 IN: tools.image-analyzer.graphviz
 FROM: arrays => 1array 2array ;
 FROM: byte-arrays => >byte-array ;
 FROM: kernel => ? = 2drop bi bi* dup if keep nip object over swap tri with ;
 FROM: math => <= - shift ;
 
 IN: tools.image-analyzer.graphviz
 FROM: arrays => 1array 2array ;
 FROM: byte-arrays => >byte-array ;
 FROM: kernel => ? = 2drop bi bi* dup if keep nip object over swap tri with ;
 FROM: math => <= - shift ;
 
-<<
-! For the two annoying structs that differ on 32 and 64 bit.
-cpu x86.32?
-"tools.image-analyzer.vm.32"
-"tools.image-analyzer.vm.64"
-? use-vocab
->>
+USE-X86-64: tools.image-analyzer.vm.64
+USE-X86-32: tools.image-analyzer.vm.32
 
 : array>string ( array -- str )
     0 suffix >byte-array alien>native-string ;
 
 : array>string ( array -- str )
     0 suffix >byte-array alien>native-string ;
index e3574cd95b837541895c66ae67e4c50c803ff633..f378c1b5b7972951e8bd3b87b0668c4f1f86b1fc 100644 (file)
@@ -7,9 +7,7 @@ alien.syntax classes.struct combinators literals system
 alien.libraries.finder ;
 IN: yaml.ffi
 
 alien.libraries.finder ;
 IN: yaml.ffi
 
-<<
-"libyaml" { "yaml" "yaml-0" "libyaml-0-2" } find-library-from-list cdecl add-library
->>
+ADD-FIRST-LIBRARY: libyaml cdecl { "yaml" "yaml-0" "libyaml-0-2" } 
 
 C-TYPE: FILE
 
 
 C-TYPE: FILE
 
index 8ff66536d91179d591b93d3c36d19b214a225c50..e231f9cadda0347eee98f414dea2f6d49e2751c1 100644 (file)
@@ -3,15 +3,13 @@
 
 USING: alien alien.accessors alien.c-types alien.data
 alien.libraries alien.syntax assocs byte-arrays classes.struct
 
 USING: alien alien.accessors alien.c-types alien.data
 alien.libraries alien.syntax assocs byte-arrays classes.struct
-combinators kernel literals math system ;
+combinators kernel literals math system vocabs.platforms ;
 
 IN: zeromq.ffi
 
 
 IN: zeromq.ffi
 
-<< "zmq" {
-    { [ os windows? ] [ "libzmq.dll" ] }
-    { [ os macosx? ] [ "libzmq.dylib" ] }
-    { [ os unix? ] [ "libzmq.so" ] }
-} cond cdecl add-library >>
+LIBRARY-UNIX: zmq cdecl "libzmq.so"
+LIBRARY-MACOSX: zmq cdecl "libzmq.dylib"
+LIBRARY-WINDOWS: zmq cdecl "libzmq.dll"
 
 LIBRARY: zmq
 
 
 LIBRARY: zmq