From bf3f03f55c303de6d6a887e7a4815aba392fe748 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 3 Feb 2022 20:47:41 -0600 Subject: [PATCH] factor: more top level forms. Depends on fixing https://github.com/factor/factor/issues/2572 first --- basis/alien/libraries/finder/finder.factor | 10 ++++-- basis/alien/libraries/libraries.factor | 16 ++++++---- basis/atk/ffi/ffi.factor | 10 +++--- basis/bit-arrays/bit-arrays.factor | 2 +- basis/bit-vectors/bit-vectors.factor | 2 +- basis/bootstrap/compiler/compiler.factor | 1 + basis/bootstrap/handbook/handbook.factor | 2 +- basis/bootstrap/ui/tools/tools.factor | 2 +- basis/cairo/ffi/ffi.factor | 8 ++--- basis/calendar/calendar.factor | 10 +++--- basis/classes/struct/struct.factor | 2 +- basis/colors/colors.factor | 2 +- basis/command-line/command-line.factor | 2 +- basis/compiler/compiler.factor | 4 +-- basis/compression/snappy/ffi/ffi.factor | 8 ++--- basis/compression/zlib/ffi/ffi.factor | 8 ++--- basis/compression/zstd/ffi/ffi.factor | 8 ++--- basis/concurrency/mailboxes/mailboxes.factor | 2 +- basis/cpu/x86/64/64.factor | 9 +++--- basis/db/postgresql/ffi/ffi.factor | 8 ++--- basis/db/sqlite/ffi/ffi.factor | 8 ++--- basis/debugger/debugger.factor | 6 ++-- basis/dlists/dlists.factor | 2 +- basis/dns/dns.factor | 8 ++--- basis/editors/brackets/brackets.factor | 4 +-- basis/environment/environment.factor | 8 ++--- basis/environment/unix/unix.factor | 4 +-- basis/fixups/fixups.factor | 7 +++-- basis/game/input/input.factor | 9 ++---- basis/gdk/ffi/ffi.factor | 9 ++---- basis/gdk/gl/ffi/ffi.factor | 9 ++---- basis/gdk/pixbuf/ffi/ffi.factor | 8 ++--- basis/gio/ffi/ffi.factor | 8 ++--- basis/glib/ffi/ffi.factor | 8 ++--- basis/gmodule/ffi/ffi.factor | 8 ++--- basis/gobject/ffi/ffi.factor | 8 ++--- basis/gtk/ffi/ffi.factor | 12 +++---- basis/gtk/gl/ffi/ffi.factor | 10 ++---- basis/hash-sets/identity/identity.factor | 2 +- basis/hash-sets/numbers/numbers.factor | 2 +- basis/hash-sets/sequences/sequences.factor | 3 +- basis/hash-sets/wrapped/wrapped.factor | 2 +- basis/hashtables/numbers/numbers.factor | 2 +- basis/hashtables/sequences/sequences.factor | 2 +- basis/http/client/client.factor | 2 +- basis/io/backend/unix/freebsd/freebsd.factor | 4 ++- basis/io/directories/directories.factor | 8 ++--- basis/io/directories/unix/unix.factor | 4 +-- basis/io/files/info/info.factor | 8 ++--- basis/io/files/info/unix/unix.factor | 4 +-- basis/io/files/links/links.factor | 6 ++-- basis/io/files/temp/temp.factor | 10 +++--- basis/io/files/unique/unique.factor | 8 ++--- basis/io/launcher/launcher.factor | 9 +++--- basis/io/mmap/mmap.factor | 9 +++--- basis/io/monitors/monitors.factor | 4 +-- basis/io/pipes/pipes.factor | 9 ++---- basis/io/sockets/icmp/icmp.factor | 8 ++--- .../io/sockets/secure/openssl/openssl.factor | 4 ++- basis/io/sockets/secure/secure.factor | 11 +++---- basis/io/sockets/sockets.factor | 23 ++++++-------- basis/io/sockets/unix/unix.factor | 4 +-- basis/io/standard-paths/standard-paths.factor | 11 +++---- basis/libc/libc.factor | 4 +-- basis/linked-assocs/linked-assocs.factor | 2 +- basis/math/floats/env/env.factor | 3 ++ basis/math/floats/env/x86/x86.factor | 6 ++-- basis/math/rectangles/rectangles.factor | 6 ++-- basis/opengl/gl/extensions/extensions.factor | 17 +++++----- basis/openssl/libcrypto/libcrypto.factor | 8 ++--- basis/openssl/libssl/libssl.factor | 8 ++--- basis/pango/cairo/ffi/ffi.factor | 8 ++--- basis/pango/ffi/ffi.factor | 8 ++--- basis/peg/peg.factor | 2 +- basis/random/random.factor | 8 ++--- basis/random/unix/unix.factor | 12 +++---- basis/regexp/regexp.factor | 3 +- .../specialized-arrays.factor | 4 +-- .../specialized-vectors.factor | 2 +- basis/stack-checker/errors/errors.factor | 2 +- basis/system-info/system-info.factor | 4 +-- basis/tools/completion/completion.factor | 1 + basis/tools/deploy/deploy.factor | 10 +++--- basis/tools/disassembler/udis/udis.factor | 8 ++--- basis/tools/files/files.factor | 8 ++--- basis/tools/ps/ps.factor | 5 +-- basis/typed/typed.factor | 8 ++--- basis/ui/backend/gtk/gtk.factor | 5 ++- basis/ui/gadgets/gadgets.factor | 2 +- basis/ui/text/core-text/core-text.factor | 4 ++- basis/ui/text/text.factor | 13 ++++---- basis/unix/ffi/ffi.factor | 4 +-- basis/unix/kqueue/kqueue.factor | 4 +-- basis/unix/scheduler/scheduler.factor | 4 +-- basis/unix/stat/stat.factor | 4 +-- basis/unix/statvfs/statvfs.factor | 4 +-- basis/unix/types/types.factor | 5 +-- basis/unix/unix.factor | 2 +- basis/unix/users/users.factor | 4 +-- basis/unix/utmpx/utmpx.factor | 4 +-- basis/urls/urls.factor | 2 +- basis/vlists/vlists.factor | 2 +- basis/vocabs/platforms/platforms.factor | 31 +++++++++++++++---- basis/webbrowser/webbrowser.factor | 4 +-- basis/windows/com/syntax/syntax.factor | 6 ++-- basis/windows/winsock/winsock.factor | 6 ++-- basis/x11/x11.factor | 2 +- basis/xml/errors/errors.factor | 2 +- basis/xml/syntax/syntax.factor | 2 +- core/hashtables/identity/identity.factor | 3 ++ core/hashtables/wrapped/wrapped.factor | 2 ++ core/locals/locals.factor | 2 ++ core/vocabs/loader/loader.factor | 15 +++++++-- core/vocabs/loader/test/m/m.factor | 2 ++ extra/chipmunk/ffi/ffi.factor | 15 ++++----- extra/clutter/cally/ffi/ffi.factor | 8 +---- extra/clutter/cogl/ffi/ffi.factor | 8 +---- extra/clutter/ffi/ffi.factor | 8 +---- extra/clutter/gtk/ffi/ffi.factor | 8 +---- extra/clutter/json/ffi/ffi.factor | 8 +---- extra/cuda/ffi/ffi.factor | 10 ++---- extra/cuda/libraries/libraries.factor | 2 +- extra/curl/ffi/ffi.factor | 6 ++-- extra/curses/ffi/ffi.factor | 6 ++++ extra/elevate/elevate.factor | 14 ++++----- extra/file-picker/file-picker.factor | 4 +-- extra/fuel/listener/listener.factor | 4 +-- extra/game/loop/loop.factor | 4 +-- extra/gpu/shaders/shaders.factor | 2 +- extra/graphviz/render/render.factor | 4 +-- extra/io/files/trash/trash.factor | 8 ++--- extra/io/serial/serial.factor | 4 +-- extra/pcre/ffi/ffi.factor | 10 +++--- extra/python/ffi/ffi.factor | 8 ++--- extra/raylib/raylib.factor | 14 +++------ extra/sodium/ffi/ffi.factor | 8 ++--- extra/terminal/terminal.factor | 4 +-- extra/text-to-speech/text-to-speech.factor | 8 ++--- extra/time/time.factor | 8 ++--- extra/tokyo/alien/tcrdb/tcrdb.factor | 8 ++--- extra/tokyo/alien/tcutil/tcutil.factor | 8 ++--- .../data-heap-reader/data-heap-reader.factor | 11 ++----- .../image-analyzer/graphviz/graphviz.factor | 11 ++----- extra/yaml/ffi/ffi.factor | 4 +-- extra/zeromq/ffi/ffi.factor | 10 +++--- 145 files changed, 414 insertions(+), 519 deletions(-) diff --git a/basis/alien/libraries/finder/finder.factor b/basis/alien/libraries/finder/finder.factor index 8c26d23973..4fabc29e3b 100644 --- a/basis/alien/libraries/finder/finder.factor +++ b/basis/alien/libraries/finder/finder.factor @@ -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 ) @@ -21,4 +21,8 @@ HOOK: find-library* os ( name -- path/f ) 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 diff --git a/basis/alien/libraries/libraries.factor b/basis/alien/libraries/libraries.factor index cb67a66f03..77b368403b 100644 --- a/basis/alien/libraries/libraries.factor +++ b/basis/alien/libraries/libraries.factor @@ -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 -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 -- ? ) @@ -100,9 +100,13 @@ deploy-libraries [ V{ } clone ] initialize [ 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' ) -{ - { [ 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 diff --git a/basis/atk/ffi/ffi.factor b/basis/atk/ffi/ffi.factor index 4082c4a04b..2ed15e754c 100644 --- a/basis/atk/ffi/ffi.factor +++ b/basis/atk/ffi/ffi.factor @@ -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 -gobject-introspection system vocabs ; +gobject-introspection system vocabs vocabs.platforms ; 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 diff --git a/basis/bit-arrays/bit-arrays.factor b/basis/bit-arrays/bit-arrays.factor index c71dc243d8..e9a14b5729 100644 --- a/basis/bit-arrays/bit-arrays.factor +++ b/basis/bit-arrays/bit-arrays.factor @@ -98,4 +98,4 @@ SYNTAX: ?{ \ } [ >bit-array ] parse-literal ; INSTANCE: bit-array sequence -{ "bit-arrays" "prettyprint" } "bit-arrays.prettyprint" require-when +USE-WHEN-LOADED: bit-arrays.prettyprint { "bit-arrays" "prettyprint" } diff --git a/basis/bit-vectors/bit-vectors.factor b/basis/bit-vectors/bit-vectors.factor index d589d35415..76ddfadc26 100644 --- a/basis/bit-vectors/bit-vectors.factor +++ b/basis/bit-vectors/bit-vectors.factor @@ -10,4 +10,4 @@ SYNTAX: ?V{ \ } [ >bit-vector ] parse-literal ; M: bit-vector contract 2drop ; -{ "bit-vectors" "prettyprint" } "bit-vectors.prettyprint" require-when +USE-WHEN-LOADED: bit-vectors.prettyprint { "bit-vectors" "prettyprint" } diff --git a/basis/bootstrap/compiler/compiler.factor b/basis/bootstrap/compiler/compiler.factor index 80ed054bcf..f60f5b0db0 100644 --- a/basis/bootstrap/compiler/compiler.factor +++ b/basis/bootstrap/compiler/compiler.factor @@ -16,6 +16,7 @@ IN: bootstrap.compiler ] unless { "boostrap.compiler" "prettyprint" } "alien.prettyprint" require-when +! USE-WHEN-LOADED: alien.prettyprint { "boostrap.compiler" "prettyprint" } "cpu." cpu name>> append require diff --git a/basis/bootstrap/handbook/handbook.factor b/basis/bootstrap/handbook/handbook.factor index 5e153a38f2..4fc7f58f42 100644 --- a/basis/bootstrap/handbook/handbook.factor +++ b/basis/bootstrap/handbook/handbook.factor @@ -1,4 +1,4 @@ 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" } diff --git a/basis/bootstrap/ui/tools/tools.factor b/basis/bootstrap/ui/tools/tools.factor index c5fd8f2e15..ea068b7f62 100644 --- a/basis/bootstrap/ui/tools/tools.factor +++ b/basis/bootstrap/ui/tools/tools.factor @@ -3,6 +3,6 @@ IN: bootstrap.ui.tools "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 diff --git a/basis/cairo/ffi/ffi.factor b/basis/cairo/ffi/ffi.factor index 1db2527d5b..e0b943f808 100644 --- a/basis/cairo/ffi/ffi.factor +++ b/basis/cairo/ffi/ffi.factor @@ -8,11 +8,9 @@ IN: cairo.ffi ! 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 diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index df7349d65e..44f9cb7a26 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -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 -system vocabs vocabs.loader ; +system vocabs vocabs.loader vocabs.platforms ; 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 ? ; -{ - { [ 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" } diff --git a/basis/classes/struct/struct.factor b/basis/classes/struct/struct.factor index c5930697c2..527ec48612 100644 --- a/basis/classes/struct/struct.factor +++ b/basis/classes/struct/struct.factor @@ -441,4 +441,4 @@ FUNCTOR-SYNTAX: STRUCT: [ 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" } diff --git a/basis/colors/colors.factor b/basis/colors/colors.factor index 7b3844c301..bff673aceb 100644 --- a/basis/colors/colors.factor +++ b/basis/colors/colors.factor @@ -91,4 +91,4 @@ M: parsed-color >rgba value>> >rgba ; SYNTAX: COLOR: scan-token dup parse-color parsed-color boa suffix! ; -{ "colors" "prettyprint" } "colors.prettyprint" require-when +USE-WHEN-LOADED: colors.prettyprint { "colors" "prettyprint" } diff --git a/basis/command-line/command-line.factor b/basis/command-line/command-line.factor index 48518fe9d8..912aaf0ee4 100644 --- a/basis/command-line/command-line.factor +++ b/basis/command-line/command-line.factor @@ -106,4 +106,4 @@ STARTUP-HOOK: [ default-cli-args ] -{ "debugger" "command-line" } "command-line.debugger" require-when +USE-WHEN-LOADED: command-line.debugger { "debugger" "command-line" } diff --git a/basis/compiler/compiler.factor b/basis/compiler/compiler.factor index 5b6bed1343..af8b36186c 100644 --- a/basis/compiler/compiler.factor +++ b/basis/compiler/compiler.factor @@ -178,5 +178,5 @@ M: optimizing-compiler process-forgotten-words : 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" } diff --git a/basis/compression/snappy/ffi/ffi.factor b/basis/compression/snappy/ffi/ffi.factor index a010eeb490..34cf8a630c 100644 --- a/basis/compression/snappy/ffi/ffi.factor +++ b/basis/compression/snappy/ffi/ffi.factor @@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax 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 diff --git a/basis/compression/zlib/ffi/ffi.factor b/basis/compression/zlib/ffi/ffi.factor index a2c4eb555e..152e1aedf6 100644 --- a/basis/compression/zlib/ffi/ffi.factor +++ b/basis/compression/zlib/ffi/ffi.factor @@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax 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 diff --git a/basis/compression/zstd/ffi/ffi.factor b/basis/compression/zstd/ffi/ffi.factor index 8bbe820ac6..b4760f820f 100644 --- a/basis/compression/zstd/ffi/ffi.factor +++ b/basis/compression/zstd/ffi/ffi.factor @@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax 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 diff --git a/basis/concurrency/mailboxes/mailboxes.factor b/basis/concurrency/mailboxes/mailboxes.factor index 546a6489af..6d2690c517 100644 --- a/basis/concurrency/mailboxes/mailboxes.factor +++ b/basis/concurrency/mailboxes/mailboxes.factor @@ -89,4 +89,4 @@ M: linked-thread error-in-thread : spawn-linked-to ( quot name mailbox -- thread ) [ (spawn) ] keep ; -{ "concurrency.mailboxes" "debugger" } "concurrency.mailboxes.debugger" require-when +USE-WHEN-LOADED: concurrency.mailboxes.debugger { "concurrency.mailboxes" "debugger" } diff --git a/basis/cpu/x86/64/64.factor b/basis/cpu/x86/64/64.factor index 1e19b39fd7..7b9fb06329 100644 --- a/basis/cpu/x86/64/64.factor +++ b/basis/cpu/x86/64/64.factor @@ -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 -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 @@ -134,7 +135,5 @@ M: x86.64 (cpuid) 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 diff --git a/basis/db/postgresql/ffi/ffi.factor b/basis/db/postgresql/ffi/ffi.factor index 0ad686c8ce..ce4ecf7cc5 100644 --- a/basis/db/postgresql/ffi/ffi.factor +++ b/basis/db/postgresql/ffi/ffi.factor @@ -5,11 +5,9 @@ USING: alien alien.c-types alien.libraries alien.syntax 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 diff --git a/basis/db/sqlite/ffi/ffi.factor b/basis/db/sqlite/ffi/ffi.factor index 2371b790ac..4d9e351bfd 100644 --- a/basis/db/sqlite/ffi/ffi.factor +++ b/basis/db/sqlite/ffi/ffi.factor @@ -6,11 +6,9 @@ USING: alien alien.c-types alien.libraries alien.syntax 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 diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index cfeeac6c0a..cf5c7d5045 100644 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -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 -vocabs.loader vocabs.parser words ; +vocabs.loader vocabs.parser vocabs.platforms words ; 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" ; -{ "threads" "debugger" } "debugger.threads" require-when +USE-UNIX: debugger.unix -os unix? [ "debugger.unix" require ] when +USE-WHEN-LOADED: debugger.threads { "threads" "debugger" } diff --git a/basis/dlists/dlists.factor b/basis/dlists/dlists.factor index cab11dd042..62dfc88915 100644 --- a/basis/dlists/dlists.factor +++ b/basis/dlists/dlists.factor @@ -215,4 +215,4 @@ INSTANCE: dlist deque SYNTAX: DL{ \ } [ >dlist ] parse-literal ; -{ "dlists" "prettyprint" } "dlists.prettyprint" require-when +USE-WHEN-LOADED: dlists.prettyprint { "dlists" "prettyprint" } diff --git a/basis/dns/dns.factor b/basis/dns/dns.factor index c6bcfb37ad..6c71a7ae91 100644 --- a/basis/dns/dns.factor +++ b/basis/dns/dns.factor @@ -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 -system vectors vocabs ; +system vectors vocabs vocabs.platforms ; IN: dns : with-input-seek ( n seek-type quot -- ) @@ -448,10 +448,8 @@ M: TXT rdata>byte-array 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 diff --git a/basis/editors/brackets/brackets.factor b/basis/editors/brackets/brackets.factor index e6ef60561c..9e1d1304c2 100644 --- a/basis/editors/brackets/brackets.factor +++ b/basis/editors/brackets/brackets.factor @@ -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 -namespaces system vocabs ; +namespaces system vocabs vocabs.platforms ; IN: editors.brackets SINGLETON: brackets @@ -19,4 +19,4 @@ M: macosx brackets-path M: brackets editor-command [ brackets-path "brackets" or , drop , ] { } make ; -os windows? [ "editors.brackets.windows" require ] when +USE-WINDOWS: editors.brackets.windows diff --git a/basis/environment/environment.factor b/basis/environment/environment.factor index 4647fb4578..a66a0d1539 100644 --- a/basis/environment/environment.factor +++ b/basis/environment/environment.factor @@ -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 -splitting system vocabs vocabs.loader ; +splitting system vocabs vocabs.loader vocabs.platforms ; 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 -{ - { [ 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 [ diff --git a/basis/environment/unix/unix.factor b/basis/environment/unix/unix.factor index 2309fba1a2..f77a3c874e 100644 --- a/basis/environment/unix/unix.factor +++ b/basis/environment/unix/unix.factor @@ -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 -kernel libc system unix.ffi vocabs ; +kernel libc system unix.ffi vocabs vocabs.platforms ; 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 ; -os macosx? [ "environment.unix.macosx" require ] when +USE-MACOSX: environment.unix.macosx \ No newline at end of file diff --git a/basis/fixups/fixups.factor b/basis/fixups/fixups.factor index 9f2b4ce761..bb870801a6 100644 --- a/basis/fixups/fixups.factor +++ b/basis/fixups/fixups.factor @@ -1,7 +1,7 @@ ! 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 { @@ -60,6 +60,9 @@ M: object compute-fixups M: f compute-fixups 2drop { } ; +M: undefined-word compute-fixups + 2drop { } ; + M: no-vocab compute-fixups [ name>> vocab-renames compute-assoc-fixups ] [ drop { } ] if* ; diff --git a/basis/game/input/input.factor b/basis/game/input/input.factor index 3f92333cc5..fc52ab8062 100644 --- a/basis/game/input/input.factor +++ b/basis/game/input/input.factor @@ -106,9 +106,6 @@ SYMBOLS: pressed released ; : 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 diff --git a/basis/gdk/ffi/ffi.factor b/basis/gdk/ffi/ffi.factor index b4fb9b94de..d7b52b2aa6 100644 --- a/basis/gdk/ffi/ffi.factor +++ b/basis/gdk/ffi/ffi.factor @@ -13,13 +13,8 @@ IN: gdk.ffi 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" ! > +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 diff --git a/basis/gdk/pixbuf/ffi/ffi.factor b/basis/gdk/pixbuf/ffi/ffi.factor index bd69437bbb..c74fb3463d 100644 --- a/basis/gdk/pixbuf/ffi/ffi.factor +++ b/basis/gdk/pixbuf/ffi/ffi.factor @@ -10,11 +10,9 @@ IN: gdk.pixbuf.ffi 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 diff --git a/basis/gio/ffi/ffi.factor b/basis/gio/ffi/ffi.factor index 7b21154eeb..fdc968ac77 100644 --- a/basis/gio/ffi/ffi.factor +++ b/basis/gio/ffi/ffi.factor @@ -8,10 +8,8 @@ IN: gio.ffi 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 diff --git a/basis/glib/ffi/ffi.factor b/basis/glib/ffi/ffi.factor index 3474a2a66c..16a648ea4b 100644 --- a/basis/glib/ffi/ffi.factor +++ b/basis/glib/ffi/ffi.factor @@ -8,11 +8,9 @@ IN: glib.ffi 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 ; diff --git a/basis/gmodule/ffi/ffi.factor b/basis/gmodule/ffi/ffi.factor index 118b5bdc12..fb0c3f40e8 100644 --- a/basis/gmodule/ffi/ffi.factor +++ b/basis/gmodule/ffi/ffi.factor @@ -8,10 +8,8 @@ IN: gmodule.ffi 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 diff --git a/basis/gobject/ffi/ffi.factor b/basis/gobject/ffi/ffi.factor index b6d31cf514..c9b3fe24eb 100644 --- a/basis/gobject/ffi/ffi.factor +++ b/basis/gobject/ffi/ffi.factor @@ -11,11 +11,9 @@ USE: glib.ffi 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 ; diff --git a/basis/gtk/ffi/ffi.factor b/basis/gtk/ffi/ffi.factor index cf1977513f..1ae406c31f 100644 --- a/basis/gtk/ffi/ffi.factor +++ b/basis/gtk/ffi/ffi.factor @@ -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 -gobject-introspection.standard-types kernel pango.ffi system vocabs ; +gobject-introspection.standard-types kernel pango.ffi system +vocabs ; IN: gtk.ffi << @@ -12,13 +13,8 @@ IN: gtk.ffi 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 ; diff --git a/basis/gtk/gl/ffi/ffi.factor b/basis/gtk/gl/ffi/ffi.factor index 50d3936693..e08bd05219 100644 --- a/basis/gtk/gl/ffi/ffi.factor +++ b/basis/gtk/gl/ffi/ffi.factor @@ -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 -gobject-introspection kernel system vocabs ; +gobject-introspection kernel system vocabs vocabs.platforms ; IN: gtk.gl.ffi << @@ -11,12 +11,6 @@ IN: gtk.gl.ffi 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 diff --git a/basis/hash-sets/identity/identity.factor b/basis/hash-sets/identity/identity.factor index afc2fff077..a02d90f414 100644 --- a/basis/hash-sets/identity/identity.factor +++ b/basis/hash-sets/identity/identity.factor @@ -39,4 +39,4 @@ M: identity-hash-set set-like 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" } diff --git a/basis/hash-sets/numbers/numbers.factor b/basis/hash-sets/numbers/numbers.factor index 72b313754f..6e6e491ec2 100644 --- a/basis/hash-sets/numbers/numbers.factor +++ b/basis/hash-sets/numbers/numbers.factor @@ -38,4 +38,4 @@ M: number-hash-set clone 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" } diff --git a/basis/hash-sets/sequences/sequences.factor b/basis/hash-sets/sequences/sequences.factor index 0fbe0424db..9e4a7239ab 100644 --- a/basis/hash-sets/sequences/sequences.factor +++ b/basis/hash-sets/sequences/sequences.factor @@ -38,4 +38,5 @@ M: sequence-hash-set clone 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" } + diff --git a/basis/hash-sets/wrapped/wrapped.factor b/basis/hash-sets/wrapped/wrapped.factor index 92d724e97e..82d322207e 100644 --- a/basis/hash-sets/wrapped/wrapped.factor +++ b/basis/hash-sets/wrapped/wrapped.factor @@ -47,4 +47,4 @@ M: wrapped-hash-set equal? 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" } diff --git a/basis/hashtables/numbers/numbers.factor b/basis/hashtables/numbers/numbers.factor index 42b162d84a..1ea0902734 100644 --- a/basis/hashtables/numbers/numbers.factor +++ b/basis/hashtables/numbers/numbers.factor @@ -40,4 +40,4 @@ M: number-hashtable new-assoc drop ; SYNTAX: NH{ \ } [ >number-hashtable ] parse-literal ; -{ "hashtables.numbers" "prettyprint" } "hashtables.numbers.prettyprint" require-when +USE-WHEN-LOADED: hashtables.numbers.prettyprint { "hashtables.numbers" "prettyprint" } diff --git a/basis/hashtables/sequences/sequences.factor b/basis/hashtables/sequences/sequences.factor index b8edcc419f..5ea9ef7106 100644 --- a/basis/hashtables/sequences/sequences.factor +++ b/basis/hashtables/sequences/sequences.factor @@ -40,4 +40,4 @@ M: sequence-hashtable new-assoc drop ; SYNTAX: SH{ \ } [ >sequence-hashtable ] parse-literal ; -{ "hashtables.sequences" "prettyprint" } "hashtables.sequences.prettyprint" require-when +USE-WHEN-LOADED: hashtables.sequences.prettyprint { "hashtables.sequences" "prettyprint" } diff --git a/basis/http/client/client.factor b/basis/http/client/client.factor index 236a203bc8..928ab20d09 100644 --- a/basis/http/client/client.factor +++ b/basis/http/client/client.factor @@ -353,4 +353,4 @@ PRIVATE> : http-trace* ( url -- response data ) http-request* ; -{ "http.client" "debugger" } "http.client.debugger" require-when +USE-WHEN-LOADED: http.client.debugger { "http.client" "debugger" } diff --git a/basis/io/backend/unix/freebsd/freebsd.factor b/basis/io/backend/unix/freebsd/freebsd.factor index 38a66e0467..7f29a86166 100644 --- a/basis/io/backend/unix/freebsd/freebsd.factor +++ b/basis/io/backend/unix/freebsd/freebsd.factor @@ -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 diff --git a/basis/io/directories/directories.factor b/basis/io/directories/directories.factor index 11c000b229..e3e488b646 100644 --- a/basis/io/directories/directories.factor +++ b/basis/io/directories/directories.factor @@ -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 -system unicode vocabs ; +system unicode vocabs vocabs.platforms ; IN: io.directories : set-current-directory ( path -- ) @@ -262,7 +262,5 @@ DEFER: copy-trees-into : 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 diff --git a/basis/io/directories/unix/unix.factor b/basis/io/directories/unix/unix.factor index 32b9df10b4..413ec5a3ca 100644 --- a/basis/io/directories/unix/unix.factor +++ b/basis/io/directories/unix/unix.factor @@ -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 -unix.ffi vocabs ; +unix.ffi vocabs vocabs.platforms ; 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 ; -os linux? [ "io.directories.unix.linux" require ] when +USE-LINUX: io.directories.unix.linux \ No newline at end of file diff --git a/basis/io/files/info/info.factor b/basis/io/files/info/info.factor index a329835e09..c5dc4ffbba 100644 --- a/basis/io/files/info/info.factor +++ b/basis/io/files/info/info.factor @@ -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 -vocabs ; +vocabs vocabs.platforms ; IN: io.files.info ! File info @@ -66,7 +66,5 @@ M: object mount-points : 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 diff --git a/basis/io/files/info/unix/unix.factor b/basis/io/files/info/unix/unix.factor index c6cdfd846c..5c19855030 100644 --- a/basis/io/files/info/unix/unix.factor +++ b/basis/io/files/info/unix/unix.factor @@ -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 -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 @@ -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? ; -"io.files.info.unix." os name>> append require +USE-OS-SUFFIX: io.files.info.unix diff --git a/basis/io/files/links/links.factor b/basis/io/files/links/links.factor index 42a5535cca..d276bc2d1c 100644 --- a/basis/io/files/links/links.factor +++ b/basis/io/files/links/links.factor @@ -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 -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 -- ) @@ -13,8 +13,6 @@ HOOK: read-link os ( symlink -- path ) : 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 ; @@ -35,3 +33,5 @@ PRIVATE> : follow-links ( path -- path' ) [ symlink-depth get ] dip normalize-path (follow-links) ; + +USE-UNIX: io.files.links.unix diff --git a/basis/io/files/temp/temp.factor b/basis/io/files/temp/temp.factor index f6eb7b9f96..428829bfc1 100644 --- a/basis/io/files/temp/temp.factor +++ b/basis/io/files/temp/temp.factor @@ -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 -namespaces system vocabs ; +namespaces system vocabs vocabs.platforms ; 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 -{ - { [ 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 diff --git a/basis/io/files/unique/unique.factor b/basis/io/files/unique/unique.factor index e0452567ef..1a61aac3fc 100644 --- a/basis/io/files/unique/unique.factor +++ b/basis/io/files/unique/unique.factor @@ -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 -system vocabs ; +system vocabs vocabs.platforms ; IN: io.files.unique [ 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 diff --git a/basis/io/launcher/launcher.factor b/basis/io/launcher/launcher.factor index 7e5aac1e45..d2336c6cbc 100644 --- a/basis/io/launcher/launcher.factor +++ b/basis/io/launcher/launcher.factor @@ -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 -namespaces prettyprint sequences strings system threads vocabs ; +namespaces prettyprint sequences strings system threads vocabs +vocabs.platforms ; 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 ; -{ - { [ os unix? ] [ "io.launcher.unix" require ] } - { [ os windows? ] [ "io.launcher.windows" require ] } -} cond +USE-UNIX: io.launcher.unix +USE-WINDOWS: io.launcher.windows diff --git a/basis/io/mmap/mmap.factor b/basis/io/mmap/mmap.factor index 1d6a3344e2..58dbcf055d 100644 --- a/basis/io/mmap/mmap.factor +++ b/basis/io/mmap/mmap.factor @@ -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 -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 ; @@ -56,7 +57,5 @@ PRIVATE> : with-mapped-array-reader ( path c-type quot -- ) [ ] 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 diff --git a/basis/io/monitors/monitors.factor b/basis/io/monitors/monitors.factor index 6891f9983f..526325d56b 100644 --- a/basis/io/monitors/monitors.factor +++ b/basis/io/monitors/monitors.factor @@ -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 -vocabs ; +vocabs vocabs.platforms ; 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 -"io.monitors." os name>> append require +USE-OS-SUFFIX: io.monitors diff --git a/basis/io/pipes/pipes.factor b/basis/io/pipes/pipes.factor index 9df6c52a5f..9bad0ebdaa 100644 --- a/basis/io/pipes/pipes.factor +++ b/basis/io/pipes/pipes.factor @@ -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 -strings system vocabs ; +strings system vocabs vocabs.platforms ; IN: io.pipes TUPLE: pipe in out ; @@ -64,8 +64,5 @@ PRIVATE> 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 diff --git a/basis/io/sockets/icmp/icmp.factor b/basis/io/sockets/icmp/icmp.factor index b1f62cb19b..ebb9dca597 100644 --- a/basis/io/sockets/icmp/icmp.factor +++ b/basis/io/sockets/icmp/icmp.factor @@ -3,14 +3,12 @@ USING: accessors arrays combinators io.sockets io.sockets.private kernel sequences system -vocabs.parser ; +vocabs.parser vocabs.platforms ; IN: io.sockets.icmp -<< { - { [ os windows? ] [ "windows.winsock" ] } - { [ os unix? ] [ "unix.ffi" ] } -} cond use-vocab >> +USE-WINDOWS: windows.winsock +USE-UNIX: unix.ffi > +USE-UNIX: unix.ffi GENERIC#: with-port 1 ( addrspec port -- addrspec ) @@ -486,7 +484,6 @@ M: inet6 drop f 0 ; : 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 diff --git a/basis/io/sockets/unix/unix.factor b/basis/io/sockets/unix/unix.factor index b7c615e0b8..23d83bc6b7 100644 --- a/basis/io/sockets/unix/unix.factor +++ b/basis/io/sockets/unix/unix.factor @@ -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 -unix unix.ffi vocabs ; +unix unix.ffi vocabs vocabs.platforms ; IN: io.sockets.unix : socket-fd ( domain type protocol -- fd ) @@ -180,4 +180,4 @@ M: unix host-name 256 [ 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 diff --git a/basis/io/standard-paths/standard-paths.factor b/basis/io/standard-paths/standard-paths.factor index e56e8ca473..d8f56136ec 100644 --- a/basis/io/standard-paths/standard-paths.factor +++ b/basis/io/standard-paths/standard-paths.factor @@ -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 -vocabs ; +vocabs vocabs.platforms ; 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 ; -{ - { [ 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 diff --git a/basis/libc/libc.factor b/basis/libc/libc.factor index 5490070397..1e5824800a 100644 --- a/basis/libc/libc.factor +++ b/basis/libc/libc.factor @@ -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 -namespaces sequences sets summary system vocabs ; +namespaces sequences sets summary system vocabs vocabs.platforms ; 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... -<< "libc." os name>> append require >> +USE-OS-SUFFIX: libc diff --git a/basis/linked-assocs/linked-assocs.factor b/basis/linked-assocs/linked-assocs.factor index 208c8af8b1..566567f2ef 100644 --- a/basis/linked-assocs/linked-assocs.factor +++ b/basis/linked-assocs/linked-assocs.factor @@ -63,4 +63,4 @@ M: linked-assoc equal? 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" } diff --git a/basis/math/floats/env/env.factor b/basis/math/floats/env/env.factor index d019d1ee0e..175a6c813e 100644 --- a/basis/math/floats/env/env.factor +++ b/basis/math/floats/env/env.factor @@ -153,6 +153,9 @@ PRIVATE> : 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 ] } diff --git a/basis/math/floats/env/x86/x86.factor b/basis/math/floats/env/x86/x86.factor index 133f6f8785..d6fdadb7e1 100644 --- a/basis/math/floats/env/x86/x86.factor +++ b/basis/math/floats/env/x86/x86.factor @@ -130,7 +130,5 @@ M: x87-env (get-denormal-mode) 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 diff --git a/basis/math/rectangles/rectangles.factor b/basis/math/rectangles/rectangles.factor index 8714bdfb1a..56992160f8 100644 --- a/basis/math/rectangles/rectangles.factor +++ b/basis/math/rectangles/rectangles.factor @@ -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 -parser ; +parser vocabs.loader ; 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 -USE: vocabs.loader - -{ "math.rectangles" "prettyprint" } "math.rectangles.prettyprint" require-when +USE-WHEN-LOADED: math.rectangles.prettyprint { "math.rectangles" "prettyprint" } diff --git a/basis/opengl/gl/extensions/extensions.factor b/basis/opengl/gl/extensions/extensions.factor index a3728d5175..8a25fb7afe 100644 --- a/basis/opengl/gl/extensions/extensions.factor +++ b/basis/opengl/gl/extensions/extensions.factor @@ -1,15 +1,16 @@ 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 -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 + SYMBOL: +gl-function-counter+ SYMBOL: +gl-function-pointers+ diff --git a/basis/openssl/libcrypto/libcrypto.factor b/basis/openssl/libcrypto/libcrypto.factor index 90d23b24cc..7e448d8a7c 100644 --- a/basis/openssl/libcrypto/libcrypto.factor +++ b/basis/openssl/libcrypto/libcrypto.factor @@ -5,11 +5,9 @@ alien.syntax classes.struct combinators system ; 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 } diff --git a/basis/openssl/libssl/libssl.factor b/basis/openssl/libssl/libssl.factor index b22ff130a0..44bc1e09e2 100644 --- a/basis/openssl/libssl/libssl.factor +++ b/basis/openssl/libssl/libssl.factor @@ -7,11 +7,9 @@ literals namespaces openssl.libcrypto system ; 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 diff --git a/basis/pango/cairo/ffi/ffi.factor b/basis/pango/cairo/ffi/ffi.factor index 2be68acdd5..704aced933 100644 --- a/basis/pango/cairo/ffi/ffi.factor +++ b/basis/pango/cairo/ffi/ffi.factor @@ -9,11 +9,9 @@ IN: pango.cairo.ffi 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 diff --git a/basis/pango/ffi/ffi.factor b/basis/pango/ffi/ffi.factor index eae53faed1..809b02301d 100644 --- a/basis/pango/ffi/ffi.factor +++ b/basis/pango/ffi/ffi.factor @@ -9,11 +9,9 @@ IN: pango.ffi 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 ; diff --git a/basis/peg/peg.factor b/basis/peg/peg.factor index 5168230588..4729e56d39 100644 --- a/basis/peg/peg.factor +++ b/basis/peg/peg.factor @@ -592,4 +592,4 @@ SYNTAX: PEG: ] append! ] ; -{ "debugger" "peg" } "peg.debugger" require-when +USE-WHEN-LOADED: peg.debugger { "debugger" "peg" } diff --git a/basis/random/random.factor b/basis/random/random.factor index 4c91bf3af9..e0fc2d786c 100644 --- a/basis/random/random.factor +++ b/basis/random/random.factor @@ -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 -sets summary system typed vocabs ; +sets summary system typed vocabs vocabs.platforms ; 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 ; -{ - { [ os windows? ] [ "random.windows" require ] } - { [ os unix? ] [ "random.unix" require ] } -} cond +USE-WINDOWS: random.windows +USE-UNIX: random.unix "random.mersenne-twister" require diff --git a/basis/random/unix/unix.factor b/basis/random/unix/unix.factor index ab723bb7e0..db8591e9fd 100644 --- a/basis/random/unix/unix.factor +++ b/basis/random/unix/unix.factor @@ -17,10 +17,10 @@ M: unix-random random-bytes* HINTS: M\ unix-random random-bytes* { fixnum unix-random } ; -STARTUP-HOOK: [ - "/dev/random" &dispose - secure-random-generator set-global +! STARTUP-HOOK: [ +! "/dev/random" &dispose +! secure-random-generator set-global - "/dev/urandom" &dispose - system-random-generator set-global -] +! "/dev/urandom" &dispose +! system-random-generator set-global +! ] diff --git a/basis/regexp/regexp.factor b/basis/regexp/regexp.factor index b243f16f58..a3039b272f 100644 --- a/basis/regexp/regexp.factor +++ b/basis/regexp/regexp.factor @@ -217,5 +217,4 @@ PRIVATE> SYNTAX: R/ parse-regexp ; - -{ "prettyprint" "regexp" } "regexp.prettyprint" require-when +USE-WHEN-LOADED: regexp.prettyprint { "prettyprint" "regexp" } diff --git a/basis/specialized-arrays/specialized-arrays.factor b/basis/specialized-arrays/specialized-arrays.factor index 88145dc906..ec6e8dd2f8 100644 --- a/basis/specialized-arrays/specialized-arrays.factor +++ b/basis/specialized-arrays/specialized-arrays.factor @@ -174,8 +174,8 @@ SYNTAX: SPECIALIZED-ARRAYS: 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 diff --git a/basis/specialized-vectors/specialized-vectors.factor b/basis/specialized-vectors/specialized-vectors.factor index 721aeef907..3cd99f4626 100644 --- a/basis/specialized-vectors/specialized-vectors.factor +++ b/basis/specialized-vectors/specialized-vectors.factor @@ -88,4 +88,4 @@ SYNTAX: SPECIALIZED-VECTOR: [ 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" } diff --git a/basis/stack-checker/errors/errors.factor b/basis/stack-checker/errors/errors.factor index f3aeb7bb64..b1ab6bf3d4 100644 --- a/basis/stack-checker/errors/errors.factor +++ b/basis/stack-checker/errors/errors.factor @@ -35,4 +35,4 @@ ERROR: bad-declaration-error < inference-error declaration ; 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" } diff --git a/basis/system-info/system-info.factor b/basis/system-info/system-info.factor index ba52b23003..74089f9eb6 100644 --- a/basis/system-info/system-info.factor +++ b/basis/system-info/system-info.factor @@ -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 -vocabs ; +vocabs vocabs.platforms ; 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 ; -"system-info." os name>> append require +USE-OS-SUFFIX: system-info diff --git a/basis/tools/completion/completion.factor b/basis/tools/completion/completion.factor index e0154cdb16..822a51be2d 100644 --- a/basis/tools/completion/completion.factor +++ b/basis/tools/completion/completion.factor @@ -131,6 +131,7 @@ PRIVATE> { "IN:" "USE:" "UNUSE:" "QUALIFIED:" "QUALIFIED-WITH:" "FROM:" "EXCLUDE:" + "REUSE:" } member? ; inline : complete-single-vocab? ( tokens -- ? ) diff --git a/basis/tools/deploy/deploy.factor b/basis/tools/deploy/deploy.factor index 07104a8c05..e16292d072 100644 --- a/basis/tools/deploy/deploy.factor +++ b/basis/tools/deploy/deploy.factor @@ -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 -tools.deploy.config.editor vocabs vocabs.loader ; +tools.deploy.config.editor vocabs vocabs.loader vocabs.platforms ; 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 ; -{ - { [ 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 ; diff --git a/basis/tools/disassembler/udis/udis.factor b/basis/tools/disassembler/udis/udis.factor index f7565edc7c..b26b3de5b5 100644 --- a/basis/tools/disassembler/udis/udis.factor +++ b/basis/tools/disassembler/udis/udis.factor @@ -6,11 +6,9 @@ math.order math.parser namespaces sequences splitting system 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 diff --git a/basis/tools/files/files.factor b/basis/tools/files/files.factor index fbf1ac86e7..63b519f0cf 100644 --- a/basis/tools/files/files.factor +++ b/basis/tools/files/files.factor @@ -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 -system vocabs ; +system vocabs vocabs.platforms ; IN: tools.files > append require +USE-OS-SUFFIX: tools.ps : ps. ( -- ) ps sort-keys { "PID" "CMD" } prefix simple-table. ; diff --git a/basis/typed/typed.factor b/basis/typed/typed.factor index 9ec7b87c3b..2bbf0ef39f 100644 --- a/basis/typed/typed.factor +++ b/basis/typed/typed.factor @@ -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 -stack-checker.dependencies words ; +stack-checker.dependencies vocabs.loader words ; FROM: classes.tuple.private => tuple-layout ; IN: typed @@ -166,7 +166,5 @@ SYNTAX: 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" } diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index 6ec1c80ab5..12eeae82a1 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -519,8 +519,7 @@ os { linux freebsd } member? [ 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 ; + +USE-WHEN-LOADED: ui.backend.gtk.input-methods.editors { "ui.backend.gtk" "ui.gadgets.editors" } diff --git a/basis/ui/gadgets/gadgets.factor b/basis/ui/gadgets/gadgets.factor index a6c9888b31..b02f427aae 100644 --- a/basis/ui/gadgets/gadgets.factor +++ b/basis/ui/gadgets/gadgets.factor @@ -406,4 +406,4 @@ GENERIC: preedit? ( gadget -- ? ) M: gadget preedit? drop f ; -{ "ui.gadgets" "prettyprint" } "ui.gadgets.prettyprint" require-when +USE-WHEN-LOADED: ui.gadgets.prettyprint { "ui.gadgets" "prettyprint" } diff --git a/basis/ui/text/core-text/core-text.factor b/basis/ui/text/core-text/core-text.factor index 135d00970e..5ff59ff9d1 100644 --- a/basis/ui/text/core-text/core-text.factor +++ b/basis/ui/text/core-text/core-text.factor @@ -60,4 +60,6 @@ M: core-text-renderer line-metrics [ 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 diff --git a/basis/ui/text/text.factor b/basis/ui/text/text.factor index 416630670b..f4aa3497dd 100644 --- a/basis/ui/text/text.factor +++ b/basis/ui/text/text.factor @@ -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 -sequences strings system ui.gadgets.worlds vocabs ; +sequences strings system ui.gadgets.worlds vocabs +vocabs.platforms ; IN: ui.text +USE-WINDOWS: ui.text.uniscribe \ No newline at end of file diff --git a/basis/unix/ffi/ffi.factor b/basis/unix/ffi/ffi.factor index 7c0080f6e8..07cf6e785b 100644 --- a/basis/unix/ffi/ffi.factor +++ b/basis/unix/ffi/ffi.factor @@ -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 -unix.types vocabs ; +unix.types vocabs vocabs.platforms ; IN: unix.ffi -<< "unix.ffi." os name>> append require >> +USE-OS-SUFFIX: unix.ffi CONSTANT: PROT_NONE 0 CONSTANT: PROT_READ 1 diff --git a/basis/unix/kqueue/kqueue.factor b/basis/unix/kqueue/kqueue.factor index ef09c56d2f..fc964f82c8 100644 --- a/basis/unix/kqueue/kqueue.factor +++ b/basis/unix/kqueue/kqueue.factor @@ -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 -accessors vocabs ; +accessors vocabs vocabs.platforms ; IN: unix.kqueue -<< "unix.kqueue." os name>> append require >> +USE-OS-SUFFIX: unix.kqueue FUNCTION: int kqueue ( ) diff --git a/basis/unix/scheduler/scheduler.factor b/basis/unix/scheduler/scheduler.factor index 926740f1ba..427ec6f445 100644 --- a/basis/unix/scheduler/scheduler.factor +++ b/basis/unix/scheduler/scheduler.factor @@ -1,6 +1,6 @@ ! 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 -<< "unix.scheduler." os name>> append require >> +USE-OS-SUFFIX: unix.scheduler diff --git a/basis/unix/stat/stat.factor b/basis/unix/stat/stat.factor index 67efa45e9c..4769bd1533 100644 --- a/basis/unix/stat/stat.factor +++ b/basis/unix/stat/stat.factor @@ -1,5 +1,5 @@ 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 @@ -21,7 +21,7 @@ STRUCT: fsid 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 ; diff --git a/basis/unix/statvfs/statvfs.factor b/basis/unix/statvfs/statvfs.factor index 898ba16765..aa8a9c245f 100644 --- a/basis/unix/statvfs/statvfs.factor +++ b/basis/unix/statvfs/statvfs.factor @@ -1,6 +1,6 @@ ! 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 -"unix.statvfs." os name>> append require +USE-OS-SUFFIX: unix.statvfs diff --git a/basis/unix/types/types.factor b/basis/unix/types/types.factor index c0bc34e9f1..31141a179c 100644 --- a/basis/unix/types/types.factor +++ b/basis/unix/types/types.factor @@ -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 @@ -35,4 +36,4 @@ C-TYPE: rlimit C-TYPE: rusage C-TYPE: sockaddr -"unix.types." os name>> sequences:append require +USE-OS-SUFFIX: unix.types diff --git a/basis/unix/unix.factor b/basis/unix/unix.factor index da7b8a1594..491b0c4f64 100644 --- a/basis/unix/unix.factor +++ b/basis/unix/unix.factor @@ -89,4 +89,4 @@ M: unix open-file [ open ] unix-system-call ; : unlink-file ( path -- ) [ unlink ] unix-system-call drop ; -{ "unix" "debugger" } "unix.debugger" require-when +USE-WHEN-LOADED: unix.debugger { "unix" "debugger" } diff --git a/basis/unix/users/users.factor b/basis/unix/users/users.factor index 8b81c25c26..6dfc2ce7c1 100644 --- a/basis/unix/users/users.factor +++ b/basis/unix/users/users.factor @@ -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 -vocabs ; +vocabs vocabs.platforms ; 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* ; -os macosx? [ "unix.users.macosx" require ] when +USE-MACOSX: unix.users.macosx diff --git a/basis/unix/utmpx/utmpx.factor b/basis/unix/utmpx/utmpx.factor index c61f88d8c7..84d5468a22 100644 --- a/basis/unix/utmpx/utmpx.factor +++ b/basis/unix/utmpx/utmpx.factor @@ -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 -sequences system unix.ffi vocabs ; +sequences system unix.ffi vocabs vocabs.platforms ; IN: unix.utmpx CONSTANT: EMPTY 0 @@ -47,4 +47,4 @@ M: unix new-utmpx-record produce nip ] with-utmpx ; -"unix.utmpx." os name>> append require +USE-OS-SUFFIX: unix.utmpx diff --git a/basis/urls/urls.factor b/basis/urls/urls.factor index 6d1d232554..a4ad98214c 100644 --- a/basis/urls/urls.factor +++ b/basis/urls/urls.factor @@ -218,4 +218,4 @@ PRIVATE> ! 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" } diff --git a/basis/vlists/vlists.factor b/basis/vlists/vlists.factor index 62d71c32c9..b7a4b35e96 100644 --- a/basis/vlists/vlists.factor +++ b/basis/vlists/vlists.factor @@ -86,4 +86,4 @@ INSTANCE: valist assoc SYNTAX: VA{ \ } [ >valist ] parse-literal ; -{ "vlists" "prettyprint" } "vlists.prettyprint" require-when +USE-WHEN-LOADED: vlists.prettyprint { "vlists" "prettyprint" } diff --git a/basis/vocabs/platforms/platforms.factor b/basis/vocabs/platforms/platforms.factor index 4f91ab1c72..5374da3221 100644 --- a/basis/vocabs/platforms/platforms.factor +++ b/basis/vocabs/platforms/platforms.factor @@ -1,7 +1,8 @@ ! 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 -- ) @@ -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-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: 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( -- ) ; diff --git a/basis/webbrowser/webbrowser.factor b/basis/webbrowser/webbrowser.factor index 9b6986d710..e3bde98e88 100644 --- a/basis/webbrowser/webbrowser.factor +++ b/basis/webbrowser/webbrowser.factor @@ -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 -sequences strings system ui.operations urls vocabs ; +sequences strings system ui.operations urls vocabs vocabs.platforms ; IN: webbrowser HOOK: open-item os ( item -- ) -"webbrowser." os name>> append require +USE-OS-SUFFIX: webbrowser : open-url ( url -- ) >url open-item ; diff --git a/basis/windows/com/syntax/syntax.factor b/basis/windows/com/syntax/syntax.factor index 4fffe99e15..d1770889c6 100644 --- a/basis/windows/com/syntax/syntax.factor +++ b/basis/windows/com/syntax/syntax.factor @@ -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 -classes.struct windows.kernel32 locals ; +classes.struct windows.kernel32 locals vocabs.loader ; FROM: alien.parser.private => parse-pointers ; IN: windows.com.syntax @@ -94,6 +94,4 @@ SYNTAX: COM-INTERFACE: 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" } diff --git a/basis/windows/winsock/winsock.factor b/basis/windows/winsock/winsock.factor index e548959c4f..20287b63af 100644 --- a/basis/windows/winsock/winsock.factor +++ b/basis/windows/winsock/winsock.factor @@ -7,10 +7,8 @@ windows.errors windows.kernel32 windows.types ; 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 diff --git a/basis/x11/x11.factor b/basis/x11/x11.factor index fc749012ab..fe97b2d838 100644 --- a/basis/x11/x11.factor +++ b/basis/x11/x11.factor @@ -32,4 +32,4 @@ SYMBOL: root : 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" } diff --git a/basis/xml/errors/errors.factor b/basis/xml/errors/errors.factor index 7640822d9c..751a0ddc6f 100644 --- a/basis/xml/errors/errors.factor +++ b/basis/xml/errors/errors.factor @@ -107,4 +107,4 @@ XML-ERROR: bad-encoding encoding ; 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" } diff --git a/basis/xml/syntax/syntax.factor b/basis/xml/syntax/syntax.factor index aeebe98bbe..b91a8530f8 100644 --- a/basis/xml/syntax/syntax.factor +++ b/basis/xml/syntax/syntax.factor @@ -177,4 +177,4 @@ SYNTAX: [XML USE: vocabs.loader -{ "xml.syntax" "inverse" } "xml.syntax.inverse" require-when +USE-WHEN-LOADED: xml.syntax.inverse { "xml.syntax" "inverse" } diff --git a/core/hashtables/identity/identity.factor b/core/hashtables/identity/identity.factor index 5d7354b577..8b8fa94cf6 100644 --- a/core/hashtables/identity/identity.factor +++ b/core/hashtables/identity/identity.factor @@ -44,3 +44,6 @@ M: identity-hashtable new-assoc drop ; { "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" } diff --git a/core/hashtables/wrapped/wrapped.factor b/core/hashtables/wrapped/wrapped.factor index e2e00e0516..34a4ba10b0 100644 --- a/core/hashtables/wrapped/wrapped.factor +++ b/core/hashtables/wrapped/wrapped.factor @@ -48,3 +48,5 @@ M: wrapped-hashtable equal? INSTANCE: wrapped-hashtable assoc { "hashtables.wrapped" "prettyprint" } "hashtables.wrapped.prettyprint" require-when + +! USE-WHEN-LOADED: hashtables.wrapped.prettyprint { "hashtables.wrapped" "prettyprint" } diff --git a/core/locals/locals.factor b/core/locals/locals.factor index da5f49f9c6..678ae35917 100644 --- a/core/locals/locals.factor +++ b/core/locals/locals.factor @@ -13,3 +13,5 @@ IN: locals { "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" } diff --git a/core/vocabs/loader/loader.factor b/core/vocabs/loader/loader.factor index 5814657aee..75c6516073 100644 --- a/core/vocabs/loader/loader.factor +++ b/core/vocabs/loader/loader.factor @@ -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 -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 @@ -184,5 +184,16 @@ PRIVATE> 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 +! USE-WHEN-LOADED: source-files.errors.debugger { "source-files.errors" "debugger" } diff --git a/core/vocabs/loader/test/m/m.factor b/core/vocabs/loader/test/m/m.factor index cd35d83e4f..5dde497df5 100644 --- a/core/vocabs/loader/test/m/m.factor +++ b/core/vocabs/loader/test/m/m.factor @@ -3,3 +3,5 @@ IN: vocabs.loader.test.m { "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" } diff --git a/extra/chipmunk/ffi/ffi.factor b/extra/chipmunk/ffi/ffi.factor index 231795530d..c07128f097 100644 --- a/extra/chipmunk/ffi/ffi.factor +++ b/extra/chipmunk/ffi/ffi.factor @@ -6,15 +6,12 @@ kernel math math.order sequences typed specialized-arrays system ; 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 diff --git a/extra/clutter/cally/ffi/ffi.factor b/extra/clutter/cally/ffi/ffi.factor index 8cd4b36e9b..dc933192b2 100644 --- a/extra/clutter/cally/ffi/ffi.factor +++ b/extra/clutter/cally/ffi/ffi.factor @@ -11,12 +11,6 @@ IN: clutter.cally.ffi 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 diff --git a/extra/clutter/cogl/ffi/ffi.factor b/extra/clutter/cogl/ffi/ffi.factor index 23fcc12977..8650e03139 100644 --- a/extra/clutter/cogl/ffi/ffi.factor +++ b/extra/clutter/cogl/ffi/ffi.factor @@ -10,13 +10,7 @@ IN: clutter.cogl.ffi 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 diff --git a/extra/clutter/ffi/ffi.factor b/extra/clutter/ffi/ffi.factor index c099fdd03b..9538d7f9f6 100644 --- a/extra/clutter/ffi/ffi.factor +++ b/extra/clutter/ffi/ffi.factor @@ -14,13 +14,7 @@ IN: clutter.ffi 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 diff --git a/extra/clutter/gtk/ffi/ffi.factor b/extra/clutter/gtk/ffi/ffi.factor index ae60b18f64..7cd0ff6d31 100644 --- a/extra/clutter/gtk/ffi/ffi.factor +++ b/extra/clutter/gtk/ffi/ffi.factor @@ -11,12 +11,6 @@ IN: clutter.gtk.ffi 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 diff --git a/extra/clutter/json/ffi/ffi.factor b/extra/clutter/json/ffi/ffi.factor index 1e7301e4f9..b9e3f8f5ca 100644 --- a/extra/clutter/json/ffi/ffi.factor +++ b/extra/clutter/json/ffi/ffi.factor @@ -11,12 +11,6 @@ IN: clutter.json.ffi 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 diff --git a/extra/cuda/ffi/ffi.factor b/extra/cuda/ffi/ffi.factor index 8a9d40fcbb..0777fb0d94 100644 --- a/extra/cuda/ffi/ffi.factor +++ b/extra/cuda/ffi/ffi.factor @@ -4,13 +4,9 @@ USING: accessors alien alien.c-types alien.libraries alien.syntax 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 diff --git a/extra/cuda/libraries/libraries.factor b/extra/cuda/libraries/libraries.factor index 52759458b3..3e6f6d2756 100644 --- a/extra/cuda/libraries/libraries.factor +++ b/extra/cuda/libraries/libraries.factor @@ -199,4 +199,4 @@ ERROR: bad-cuda-abi abi ; normalize-path dup name>> cuda-libraries get-global set-at ; -{ "cuda.libraries" "prettyprint" } "cuda.prettyprint" require-when +USE-WHEN-LOADED: cuda.prettyprint { "cuda.libraries" "prettyprint" } diff --git a/extra/curl/ffi/ffi.factor b/extra/curl/ffi/ffi.factor index c0eb146a6a..79ff97eaca 100644 --- a/extra/curl/ffi/ffi.factor +++ b/extra/curl/ffi/ffi.factor @@ -4,10 +4,8 @@ system words ; 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 diff --git a/extra/curses/ffi/ffi.factor b/extra/curses/ffi/ffi.factor index 88e85538fa..daa0bfe8e5 100644 --- a/extra/curses/ffi/ffi.factor +++ b/extra/curses/ffi/ffi.factor @@ -10,6 +10,12 @@ IN: curses.ffi { [ os unix? ] [ "ncursesw" find-library ] } } cond cdecl add-library >> + +LIBRARY-MACOSX: curses cdecl "libcurses.dylib" +LIBRARY-WINDOWS: curses cdecl "libcurses.dll" + C-TYPE: SCREEN TYPEDEF: void* va_list diff --git a/extra/elevate/elevate.factor b/extra/elevate/elevate.factor index 439ed145fd..576351bf1b 100644 --- a/extra/elevate/elevate.factor +++ b/extra/elevate/elevate.factor @@ -1,6 +1,7 @@ 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 > "file-picker." prepend require +USE-OS-SUFFIX: file-picker diff --git a/extra/fuel/listener/listener.factor b/extra/fuel/listener/listener.factor index 19de40e32a..09bf1ffb0d 100644 --- a/extra/fuel/listener/listener.factor +++ b/extra/fuel/listener/listener.factor @@ -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 ; -os linux? [ "fuel.listener.linux" require ] when +USE-LINUX: fuel.listener.linux : fuel-listener ( -- ) fuel-pty-setup listener-main ; diff --git a/extra/game/loop/loop.factor b/extra/game/loop/loop.factor index a037a4dff6..6d151ee71a 100644 --- a/extra/game/loop/loop.factor +++ b/extra/game/loop/loop.factor @@ -97,5 +97,5 @@ PRIVATE> 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" } diff --git a/extra/gpu/shaders/shaders.factor b/extra/gpu/shaders/shaders.factor index 33b62f5078..f33ec8117b 100644 --- a/extra/gpu/shaders/shaders.factor +++ b/extra/gpu/shaders/shaders.factor @@ -633,4 +633,4 @@ M: program-instance dispose [ 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" } diff --git a/extra/graphviz/render/render.factor b/extra/graphviz/render/render.factor index 4f2ed5a84a..94651b0a99 100644 --- a/extra/graphviz/render/render.factor +++ b/extra/graphviz/render/render.factor @@ -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 -unicode vocabs webbrowser words ; +unicode vocabs webbrowser words vocabs.platforms ; IN: graphviz.render standard-formats [ define-graphviz-by-format ] each ] with-compilation-unit -os windows? [ "graphviz.render.windows" require ] when +USE-WINDOWS: graphviz.render.windows diff --git a/extra/io/files/trash/trash.factor b/extra/io/files/trash/trash.factor index 95e729106f..7729546987 100644 --- a/extra/io/files/trash/trash.factor +++ b/extra/io/files/trash/trash.factor @@ -7,8 +7,6 @@ IN: io.files.trash 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 diff --git a/extra/io/serial/serial.factor b/extra/io/serial/serial.factor index f62c0c396d..9bfb678b24 100644 --- a/extra/io/serial/serial.factor +++ b/extra/io/serial/serial.factor @@ -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 -math.parser sequences summary system vocabs ; +math.parser sequences summary system vocabs vocabs.platforms ; 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 -"io.serial." os name>> append require +USE-OS-SUFFIX: io.serial diff --git a/extra/pcre/ffi/ffi.factor b/extra/pcre/ffi/ffi.factor index d44ac811ea..449239c939 100644 --- a/extra/pcre/ffi/ffi.factor +++ b/extra/pcre/ffi/ffi.factor @@ -1,12 +1,10 @@ USING: alien alien.c-types alien.libraries alien.syntax -classes.struct combinators system ; +classes.struct combinators system vocabs.platforms ; 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 diff --git a/extra/python/ffi/ffi.factor b/extra/python/ffi/ffi.factor index 2895c2bdf1..1ced8c9049 100644 --- a/extra/python/ffi/ffi.factor +++ b/extra/python/ffi/ffi.factor @@ -1,10 +1,10 @@ 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 -<< "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 diff --git a/extra/raylib/raylib.factor b/extra/raylib/raylib.factor index 49f816c18b..9ddd028c53 100644 --- a/extra/raylib/raylib.factor +++ b/extra/raylib/raylib.factor @@ -9,15 +9,11 @@ raylib.util sequences sequences.private system ; 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 diff --git a/extra/sodium/ffi/ffi.factor b/extra/sodium/ffi/ffi.factor index 0aec267b43..30eb3aeb52 100644 --- a/extra/sodium/ffi/ffi.factor +++ b/extra/sodium/ffi/ffi.factor @@ -5,11 +5,9 @@ classes.struct combinators literals math.order 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 diff --git a/extra/terminal/terminal.factor b/extra/terminal/terminal.factor index 996220b6cc..cf780a3e6c 100644 --- a/extra/terminal/terminal.factor +++ b/extra/terminal/terminal.factor @@ -2,13 +2,13 @@ ! 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 ) -"terminal." os name>> append require +USE-OS-SUFFIX: terminal : terminal-size ( -- dim ) "COLUMNS" "LINES" diff --git a/extra/text-to-speech/text-to-speech.factor b/extra/text-to-speech/text-to-speech.factor index 5e72d50690..3736a86ff0 100644 --- a/extra/text-to-speech/text-to-speech.factor +++ b/extra/text-to-speech/text-to-speech.factor @@ -14,11 +14,9 @@ IN: text-to-speech 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 -- ) diff --git a/extra/time/time.factor b/extra/time/time.factor index cd076e50d9..33a84a28c2 100644 --- a/extra/time/time.factor +++ b/extra/time/time.factor @@ -6,8 +6,6 @@ IN: time 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 diff --git a/extra/tokyo/alien/tcrdb/tcrdb.factor b/extra/tokyo/alien/tcrdb/tcrdb.factor index fce11ac660..322fd91456 100644 --- a/extra/tokyo/alien/tcrdb/tcrdb.factor +++ b/extra/tokyo/alien/tcrdb/tcrdb.factor @@ -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 -<< "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 diff --git a/extra/tokyo/alien/tcutil/tcutil.factor b/extra/tokyo/alien/tcutil/tcutil.factor index 39e9b48d67..feb1a1168f 100644 --- a/extra/tokyo/alien/tcutil/tcutil.factor +++ b/extra/tokyo/alien/tcutil/tcutil.factor @@ -4,11 +4,9 @@ USING: alien alien.c-types alien.libraries alien.syntax 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 diff --git a/extra/tools/image-analyzer/data-heap-reader/data-heap-reader.factor b/extra/tools/image-analyzer/data-heap-reader/data-heap-reader.factor index f6fe607241..d48623cb19 100644 --- a/extra/tools/image-analyzer/data-heap-reader/data-heap-reader.factor +++ b/extra/tools/image-analyzer/data-heap-reader/data-heap-reader.factor @@ -1,6 +1,6 @@ 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 ; @@ -8,13 +8,8 @@ FROM: kernel => ? boa bi dup keep nip swap ; 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 ) { diff --git a/extra/tools/image-analyzer/graphviz/graphviz.factor b/extra/tools/image-analyzer/graphviz/graphviz.factor index 1f50fb7cdd..2aa92d1026 100644 --- a/extra/tools/image-analyzer/graphviz/graphviz.factor +++ b/extra/tools/image-analyzer/graphviz/graphviz.factor @@ -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 -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 ; -<< -! 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 ; diff --git a/extra/yaml/ffi/ffi.factor b/extra/yaml/ffi/ffi.factor index e3574cd95b..f378c1b5b7 100644 --- a/extra/yaml/ffi/ffi.factor +++ b/extra/yaml/ffi/ffi.factor @@ -7,9 +7,7 @@ alien.syntax classes.struct combinators literals system 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 diff --git a/extra/zeromq/ffi/ffi.factor b/extra/zeromq/ffi/ffi.factor index 8ff66536d9..e231f9cadd 100644 --- a/extra/zeromq/ffi/ffi.factor +++ b/extra/zeromq/ffi/ffi.factor @@ -3,15 +3,13 @@ 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 -<< "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 -- 2.34.1