basis/extra: switch to "vocab." os name>> append require.

db4
John Benediktsson 2014-11-13 13:00:44 -08:00
parent 74eecb78f9
commit d6b6f3893d
8 changed files with 22 additions and 59 deletions

View File

@ -1,5 +1,4 @@
USING: combinators kernel sequences system vocabs
alien.libraries ;
USING: accessors kernel sequences system vocabs ;
IN: alien.libraries.finder
HOOK: find-library* os ( name -- path/f )
@ -14,8 +13,4 @@ HOOK: find-library* os ( name -- path/f )
dup [ find-library* ] map-find drop
[ nip ] [ ?first "library_not_found" or ] if* ;
{
{ [ os macosx? ] [ "alien.libraries.finder.macosx" ] }
{ [ os linux? ] [ "alien.libraries.finder.linux" ] }
{ [ os windows? ] [ "alien.libraries.finder.windows" ] }
} cond require
"alien.libraries.finder." os name>> append require

View File

@ -1,9 +1,8 @@
! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: io.backend kernel continuations destructors namespaces
sequences assocs hashtables sorting arrays threads boxes
io.timeouts accessors concurrency.mailboxes fry
system vocabs combinators ;
USING: accessors concurrency.mailboxes continuations destructors
fry io.backend io.timeouts kernel namespaces sequences system
vocabs ;
IN: io.monitors
HOOK: init-monitors io-backend ( -- )
@ -74,8 +73,4 @@ SYMBOL: +rename-file+
: run-monitor ( path recursive? quot -- )
'[ [ @ t ] loop ] with-monitor ; inline
{
{ [ os macosx? ] [ "io.monitors.macosx" require ] }
{ [ os linux? ] [ "io.monitors.linux" require ] }
{ [ os windows? ] [ "io.monitors.windows" require ] }
} cond
"io.monitors." os name>> append require

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators io kernel math math.parser system
USING: accessors io kernel math math.parser sequences system
vocabs ;
IN: system-info
@ -29,8 +29,4 @@ HOOK: available-virtual-extended-mem os ( -- n )
"CPU Speed: " write cpu-mhz ghz nl
"Physical RAM: " write physical-mem megs nl ;
<< {
{ [ os windows? ] [ "system-info.windows" ] }
{ [ os linux? ] [ "system-info.linux" ] }
{ [ os macosx? ] [ "system-info.macosx" ] }
} cond [ require ] when* >>
"system-info." os name>> append require

View File

@ -1,15 +1,11 @@
! Copyright (C) 2012-2013 Doug Coleman, John Benediktsson.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators prettyprint sequences sorting system vocabs ;
USING: accessors prettyprint sequences sorting system vocabs ;
IN: tools.ps
HOOK: ps os ( -- assoc )
{
{ [ os macosx? ] [ "tools.ps.macosx" ] }
{ [ os linux? ] [ "tools.ps.linux" ] }
{ [ os windows? ] [ "tools.ps.windows" ] }
} cond require
"tools.ps." os name>> append require
: ps. ( -- )
ps sort-keys { "PID" "CMD" } prefix simple-table. ;

View File

@ -1,18 +1,11 @@
! Copyright (C) 2010 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types alien.data alien.libraries
alien.syntax classes.struct combinators system unix.time
USING: accessors alien alien.c-types alien.data alien.libraries
alien.syntax classes.struct sequences system unix.time
unix.types vocabs ;
IN: unix.ffi
<<
{
{ [ os linux? ] [ "unix.ffi.linux" require ] }
{ [ os macosx? ] [ "unix.ffi.macosx" require ] }
} cond
>>
<< "unix.ffi." os name>> append require >>
CONSTANT: PROT_NONE 0
CONSTANT: PROT_READ 1

View File

@ -1,18 +1,14 @@
! Copyright (C) 2011 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: combinators combinators.short-circuit io.pathnames
present sequences strings system ui.operations urls vocabs ;
USING: accessors combinators.short-circuit io.pathnames
sequences strings system ui.operations urls vocabs ;
IN: webbrowser
HOOK: open-file os ( path -- )
{
{ [ os macosx? ] [ "webbrowser.macosx" ] }
{ [ os linux? ] [ "webbrowser.linux" ] }
{ [ os windows? ] [ "webbrowser.windows" ] }
} cond require
"webbrowser." os name>> append require
: open-url ( url -- )
>url open-file ;

View File

@ -1,8 +1,7 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types assocs combinators destructors
kernel math math.bitwise math.parser sequences summary system
vocabs io ;
USING: accessors destructors io kernel math.parser sequences
summary system vocabs ;
IN: io.serial
TUPLE: serial-port < disposable stream path baud
@ -30,7 +29,4 @@ M: serial-port dispose* ( serial -- ) stream>> dispose ;
: with-serial-port ( serial-port quot -- )
[ open-serial ] dip with-duplex-stream ; inline
{
{ [ os linux? ] [ "io.serial.linux" ] }
{ [ os windows? ] [ "io.serial.windows" ] }
} cond require
"io.serial." os name>> append require

View File

@ -1,18 +1,14 @@
! Copyright (C) 2012 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: arrays combinators environment kernel math math.parser
USING: accessors arrays environment kernel math math.parser
sequences system vocabs ;
IN: terminal
HOOK: (terminal-size) os ( -- columns lines )
{
{ [ os macosx? ] [ "terminal.macosx" ] }
{ [ os linux? ] [ "terminal.linux" ] }
{ [ os windows? ] [ "terminal.windows" ] }
} cond require
"terminal." os name>> append require
: terminal-size ( -- dim )
"COLUMNS" "LINES"