Merge branch 'master' into new_ui

db4
Slava Pestov 2008-12-17 18:15:01 -06:00
commit 0643cf3a44
657 changed files with 9401 additions and 8790 deletions

View File

@ -1,26 +0,0 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel words help.markup help.syntax ;
IN: alias
HELP: ALIAS:
{ $syntax "ALIAS: new-word existing-word" }
{ $values { "new-word" word } { "existing-word" word } }
{ $description "Creates a " { $snippet "new" } " inlined word that calls the " { $snippet "existing" } " word." }
{ $examples
{ $example "USING: alias prettyprint sequences ;"
"IN: alias.test"
"ALIAS: sequence-nth nth"
"0 { 10 20 30 } sequence-nth ."
"10"
}
} ;
ARTICLE: "alias" "Word aliasing"
"The " { $vocab-link "alias" } " vocabulary implements a way to make many different names for the same word. Although creating new names for words is generally frowned upon, aliases are useful for the Win32 API and other cases where words need to be renamed for symmetry." $nl
"Make a new word that aliases another word:"
{ $subsection define-alias }
"Make an alias at parse-time:"
{ $subsection POSTPONE: ALIAS: } ;
ABOUT: "alias"

View File

@ -234,17 +234,16 @@ M: long-long-type box-return ( type -- )
f swap box-parameter ;
: define-deref ( name -- )
[ CHAR: * prefix "alien.c-types" create ]
[ c-getter 0 prefix ] bi
define-inline ;
[ CHAR: * prefix "alien.c-types" create ] [ c-getter 0 prefix ] bi
(( c-ptr -- value )) define-inline ;
: define-out ( name -- )
[ "alien.c-types" constructor-word ]
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ]
bi define-inline ;
[ dup c-setter '[ _ <c-object> [ 0 @ ] keep ] ] bi
(( value -- c-ptr )) define-inline ;
: c-bool> ( int -- ? )
zero? not ;
0 = not ; inline
: define-primitive-type ( type name -- )
[ typedef ]

View File

@ -52,8 +52,8 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ;
[ (>>offset) ] [ type>> heap-size + ] 2bi
] reduce ;
: define-struct-slot-word ( word quot spec -- )
offset>> prefix define-inline ;
: define-struct-slot-word ( word quot spec effect -- )
[ offset>> prefix ] dip define-inline ;
: define-getter ( type spec -- )
[ set-reader-props ] keep
@ -62,11 +62,13 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ;
type>>
[ c-getter ] [ c-type-boxer-quot ] bi append
]
[ ] tri define-struct-slot-word ;
[ ] tri
(( c-ptr -- value )) define-struct-slot-word ;
: define-setter ( type spec -- )
[ set-writer-props ] keep
[ writer>> ] [ type>> c-setter ] [ ] tri define-struct-slot-word ;
[ writer>> ] [ type>> c-setter ] [ ] tri
(( value c-ptr -- )) define-struct-slot-word ;
: define-field ( type spec -- )
[ define-getter ] [ define-setter ] 2bi ;

View File

@ -4,7 +4,7 @@ USING: accessors arrays alien alien.c-types alien.structs
alien.arrays alien.strings kernel math namespaces parser
sequences words quotations math.parser splitting grouping
effects assocs combinators lexer strings.parser alien.parser
fry ;
fry vocabs.parser ;
IN: alien.syntax
: DLL" lexer get skip-blank parse-string dlopen parsed ; parsing

View File

@ -11,7 +11,7 @@ TUPLE: bit-array
<PRIVATE
: n>byte -3 shift ; inline
: n>byte ( m -- n ) -3 shift ; inline
: byte/bit ( n alien -- byte bit )
over n>byte alien-unsigned-1 swap 7 bitand ; inline
@ -19,9 +19,9 @@ TUPLE: bit-array
: set-bit ( ? byte bit -- byte )
2^ rot [ bitor ] [ bitnot bitand ] if ; inline
: bits>cells 31 + -5 shift ; inline
: bits>cells ( m -- n ) 31 + -5 shift ; inline
: bits>bytes 7 + n>byte ; inline
: bits>bytes ( m -- n ) 7 + n>byte ; inline
: (set-bits) ( bit-array n -- )
[ [ length bits>cells ] keep ] dip swap underlying>>

View File

@ -1,4 +1,4 @@
USING: help.markup help.syntax io io.files ;
USING: help.markup help.syntax io io.files io.pathnames ;
IN: bootstrap.image
ARTICLE: "bootstrap.image" "Bootstrapping new images"

View File

@ -1,14 +1,15 @@
! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien arrays byte-arrays generic assocs hashtables assocs
hashtables.private io kernel kernel.private math namespaces make
parser prettyprint sequences sequences.private strings sbufs
hashtables.private io io.binary io.files io.encodings.binary
io.pathnames kernel kernel.private math namespaces make parser
prettyprint sequences sequences.private strings sbufs
vectors words quotations assocs system layouts splitting
grouping growable classes classes.builtin classes.tuple
classes.tuple.private words.private io.binary io.files vocabs
classes.tuple.private words.private vocabs
vocabs.loader source-files definitions debugger
quotations.private sequences.private combinators
io.encodings.binary math.order math.private accessors
math.order math.private accessors
slots.private compiler.units ;
IN: bootstrap.image
@ -65,7 +66,7 @@ M: id equal?
SYMBOL: objects
: (objects) <id> objects get ; inline
: (objects) ( obj -- id assoc ) <id> objects get ; inline
: lookup-object ( obj -- n/f ) (objects) at ;

View File

@ -2,7 +2,8 @@
! See http://factorcode.org/license.txt for BSD license.
USING: checksums checksums.openssl splitting assocs
kernel io.files bootstrap.image sequences io namespaces make
io.launcher math io.encodings.ascii ;
io.launcher math io.encodings.ascii io.files.temp io.pathnames
io.directories ;
IN: bootstrap.image.upload
SYMBOL: upload-images-destination

View File

@ -1,12 +1,11 @@
USING: system vocabs vocabs.loader kernel combinators
namespaces sequences io.backend ;
namespaces sequences io.backend accessors ;
IN: bootstrap.io
"bootstrap.compiler" vocab [
"io." {
"io.backend." {
{ [ "io-backend" get ] [ "io-backend" get ] }
{ [ os unix? ] [ "unix" ] }
{ [ os unix? ] [ "unix." os name>> append ] }
{ [ os winnt? ] [ "windows.nt" ] }
{ [ os wince? ] [ "windows.ce" ] }
} cond append require
] when

View File

@ -1,11 +1,11 @@
! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors init namespaces words io
USING: accessors init namespaces words words.symbol io
kernel.private math memory continuations kernel io.files
io.backend system parser vocabs sequences
io.pathnames io.backend system parser vocabs sequences
vocabs.loader combinators splitting source-files strings
definitions assocs compiler.errors compiler.units
math.parser generic sets command-line ;
definitions assocs compiler.errors compiler.units math.parser
generic sets command-line ;
IN: bootstrap.stage2
SYMBOL: core-bootstrap-time

View File

@ -211,7 +211,7 @@ M: real +minute ( timestamp n -- timestamp )
M: number +second ( timestamp n -- timestamp )
[ over second>> + seconds/minutes [ >>second ] dip +minute ] unless-zero ;
: (time+)
: (time+) ( timestamp duration -- timestamp' duration )
[ second>> +second ] keep
[ minute>> +minute ] keep
[ hour>> +hour ] keep
@ -219,7 +219,8 @@ M: number +second ( timestamp n -- timestamp )
[ month>> +month ] keep
[ year>> +year ] keep ; inline
: +slots [ bi@ + ] curry 2keep ; inline
: +slots ( obj1 obj2 quot -- n obj1 obj2 )
[ bi@ + ] curry 2keep ; inline
PRIVATE>

View File

@ -6,6 +6,7 @@ IN: channels.remote
HELP: <remote-channel>
{ $values { "node" "a node object" }
{ "id" "the id of the published channel on the node" }
{ "remote-channel" remote-channel }
}
{ $description "Create a remote channel that acts as a proxy for a "
"channel on another node. The remote node's channel must have been "

View File

@ -3,7 +3,7 @@
USING: kernel io io.binary io.files io.streams.byte-array math
math.functions math.parser namespaces splitting grouping strings
sequences byte-arrays locals sequences.private
io.encodings.binary symbols math.bitwise checksums
io.encodings.binary math.bitwise checksums
checksums.common checksums.stream ;
IN: checksums.md5

View File

@ -4,8 +4,8 @@ USING: help.syntax help.markup ;
HELP: openssl-checksum
{ $class-description "The class of checksum algorithms implemented by OpenSSL. The exact set of algorithms supported depends on how the OpenSSL library was compiled; " { $snippet "md5" } " and " { $snippet "sha1" } " should be universally available." } ;
HELP: <openssl-checksum> ( name -- checksum )
{ $values { "name" "an EVP message digest name" } { "checksum" openssl-checksum } }
HELP: <openssl-checksum>
{ $values { "name" "an EVP message digest name" } { "openssl-checksum" openssl-checksum } }
{ $description "Creates a new OpenSSL checksum object." } ;
HELP: openssl-md5

View File

@ -3,7 +3,7 @@
USING: arrays combinators kernel io io.encodings.binary io.files
io.streams.byte-array math.vectors strings sequences namespaces
make math parser sequences assocs grouping vectors io.binary
hashtables symbols math.bitwise checksums checksums.common
hashtables math.bitwise checksums checksums.common
checksums.stream ;
IN: checksums.sha1

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel splitting grouping math sequences namespaces make
io.binary symbols math.bitwise checksums checksums.common
io.binary math.bitwise checksums checksums.common
sbufs strings ;
IN: checksums.sha2

View File

@ -30,10 +30,6 @@ HELP: cocoa-app
{ $values { "quot" quotation } }
{ $description "Initializes Cocoa, calls the quotation, and starts the Cocoa event loop." } ;
HELP: do-event
{ $values { "app" "an " { $snippet "NSApplication" } } { "?" "a boolean" } }
{ $description "Processes a pending event in the queue, if any, returning a boolean indicating if there was one. Does not block." } ;
HELP: add-observer
{ $values { "observer" "an " { $snippet "NSObject" } } { "selector" string } { "name" "an " { $snippet "NSString" } } { "object" "an " { $snippet "NSObject" } } }
{ $description "Registers an observer with the " { $snippet "NSNotificationCenter" } " singleton." } ;
@ -52,7 +48,6 @@ HELP: objc-error
ARTICLE: "cocoa-application-utils" "Cocoa application utilities"
"Utilities:"
{ $subsection NSApp }
{ $subsection do-event }
{ $subsection add-observer }
{ $subsection remove-observer }
{ $subsection install-delegate }

View File

@ -1,10 +1,10 @@
! Copyright (C) 2006, 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax io kernel namespaces core-foundation
core-foundation.arrays
core-foundation.data core-foundation.strings cocoa.messages
cocoa cocoa.classes cocoa.runtime sequences threads init summary
kernel.private assocs ;
core-foundation.arrays core-foundation.data
core-foundation.strings cocoa.messages cocoa cocoa.classes
cocoa.runtime sequences threads init summary kernel.private
assocs ;
IN: cocoa.application
: <NSString> ( str -- alien ) <CFString> -> autorelease ;

View File

@ -2,7 +2,7 @@ USING: help.syntax help.markup ;
IN: cocoa.views
HELP: <PixelFormat>
{ $values { "pixelfmt" "an " { $snippet "NSOpenGLPixelFormat" } } }
{ $values { "attributes" "a sequence of attributes" } { "pixelfmt" "an " { $snippet "NSOpenGLPixelFormat" } } }
{ $description "Creates an " { $snippet "NSOpenGLPixelFormat" } " with some reasonable defaults." } ;
HELP: <GLView>

View File

@ -14,7 +14,7 @@ IN: cocoa.windows
: NSBackingStoreNonretained 1 ; inline
: NSBackingStoreBuffered 2 ; inline
: standard-window-type
: standard-window-type ( -- n )
{
NSTitledWindowMask
NSClosableWindowMask

View File

@ -4,8 +4,8 @@ IN: columns
HELP: column
{ $class-description "A virtual sequence which presents a fixed column of a matrix represented as a sequence of rows. New instances can be created by calling " { $link <column> } "." } ;
HELP: <column> ( seq n -- column )
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "column" column } }
HELP: <column>
{ $values { "seq" sequence } { "col" "a non-negative integer" } { "column" column } }
{ $description "Outputs a new virtual sequence which presents a fixed column of a matrix represented as a sequence of rows." "The " { $snippet "i" } "th element of a column is the " { $snippet "n" } "th element of the " { $snippet "i" } "th element of " { $snippet "seq" } ". Every element of " { $snippet "seq" } " must be a sequence, and all sequences must have equal length." }
{ $examples
{ $example

View File

@ -1,8 +1,8 @@
! Copyright (C) 2003, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: init continuations hashtables io io.encodings.utf8
io.files kernel kernel.private namespaces parser sequences
strings system splitting vocabs.loader ;
io.files io.pathnames kernel kernel.private namespaces parser
sequences strings system splitting vocabs.loader ;
IN: command-line
SYMBOL: script

View File

@ -68,7 +68,8 @@ IN: compiler.cfg.alias-analysis
! Map vregs -> alias classes
SYMBOL: vregs>acs
: check [ "BUG: static type error detected" throw ] unless* ; inline
: check ( obj -- obj )
[ "BUG: static type error detected" throw ] unless* ; inline
: vreg>ac ( vreg -- ac )
#! Only vregs produced by ##allot, ##peek and ##slot can

View File

@ -5,17 +5,17 @@ sequences classes.tuple cpu.architecture compiler.cfg.registers
compiler.cfg.instructions ;
IN: compiler.cfg.hats
: i int-regs next-vreg ; inline
: ^^i i dup ; inline
: ^^i1 [ ^^i ] dip ; inline
: ^^i2 [ ^^i ] 2dip ; inline
: ^^i3 [ ^^i ] 3dip ; inline
: i ( -- vreg ) int-regs next-vreg ; inline
: ^^i ( -- vreg vreg ) i dup ; inline
: ^^i1 ( obj -- vreg vreg obj ) [ ^^i ] dip ; inline
: ^^i2 ( obj obj -- vreg vreg obj obj ) [ ^^i ] 2dip ; inline
: ^^i3 ( obj obj obj -- vreg vreg obj obj obj ) [ ^^i ] 3dip ; inline
: d double-float-regs next-vreg ; inline
: ^^d d dup ; inline
: ^^d1 [ ^^d ] dip ; inline
: ^^d2 [ ^^d ] 2dip ; inline
: ^^d3 [ ^^d ] 3dip ; inline
: d ( -- vreg ) double-float-regs next-vreg ; inline
: ^^d ( -- vreg vreg ) d dup ; inline
: ^^d1 ( obj -- vreg vreg obj ) [ ^^d ] dip ; inline
: ^^d2 ( obj obj -- vreg vreg obj obj ) [ ^^d ] 2dip ; inline
: ^^d3 ( obj obj obj -- vreg vreg obj obj obj ) [ ^^d ] 3dip ; inline
: ^^load-literal ( obj -- dst ) ^^i1 ##load-literal ; inline
: ^^peek ( loc -- dst ) ^^i1 ##peek ; inline

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: classes.tuple classes.tuple.parser kernel words
make fry sequences parser ;
make fry sequences parser accessors ;
IN: compiler.cfg.instructions.syntax
: insn-word ( -- word )
@ -10,10 +10,13 @@ IN: compiler.cfg.instructions.syntax
#! this one.
"insn" "compiler.cfg.instructions" lookup ;
: insn-effect ( word -- effect )
boa-effect [ but-last ] change-in { } >>out ;
: INSN:
parse-tuple-definition "regs" suffix
[ dup tuple eq? [ drop insn-word ] when ] dip
[ define-tuple-class ]
[ 2drop save-location ]
[ 2drop dup '[ f _ boa , ] define-inline ]
[ 2drop [ ] [ '[ f _ boa , ] ] [ insn-effect ] tri define-inline ]
3tri ; parsing

View File

@ -1,7 +1,6 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: qualified words sequences kernel combinators
cpu.architecture
USING: words sequences kernel combinators cpu.architecture
compiler.cfg.hats
compiler.cfg.instructions
compiler.cfg.intrinsics.alien

View File

@ -37,7 +37,7 @@ M: insn linearize-insn , drop ;
M: ##branch linearize-insn
drop dup successors>> first emit-branch ;
: (binary-conditional)
: (binary-conditional) ( basic-block insn -- basic-block successor1 successor2 src1 src2 cc )
[ dup successors>> first2 ]
[ [ src1>> ] [ src2>> ] [ cc>> ] tri ] bi* ; inline

View File

@ -95,7 +95,7 @@ M: ##dispatch-label generate-insn label>> %dispatch-label ;
M: ##dispatch generate-insn
[ src>> register ] [ temp>> register ] [ offset>> ] tri %dispatch ;
: >slot<
: >slot< ( insn -- dst obj slot tag )
{
[ dst>> register ]
[ obj>> register ]
@ -109,7 +109,7 @@ M: ##slot generate-insn
M: ##slot-imm generate-insn
>slot< %slot-imm ;
: >set-slot<
: >set-slot< ( insn -- src obj slot tag )
{
[ src>> register ]
[ obj>> register ]
@ -209,7 +209,8 @@ M: ##alien-cell generate-insn dst/src %alien-cell ;
M: ##alien-float generate-insn dst/src %alien-float ;
M: ##alien-double generate-insn dst/src %alien-double ;
: >alien-setter< [ src>> register ] [ value>> register ] bi ; inline
: >alien-setter< ( insn -- src value )
[ src>> register ] [ value>> register ] bi ; inline
M: ##set-alien-integer-1 generate-insn >alien-setter< %set-alien-integer-1 ;
M: ##set-alien-integer-2 generate-insn >alien-setter< %set-alien-integer-2 ;

View File

@ -4,7 +4,7 @@ USING: kernel assocs match fry accessors namespaces make effects
sequences sequences.private quotations generic macros arrays
prettyprint prettyprint.backend prettyprint.custom
prettyprint.sections math words combinators
combinators.short-circuit io sorting hints qualified
combinators.short-circuit io sorting hints
compiler.tree
compiler.tree.recursive
compiler.tree.normalization

View File

@ -6,7 +6,7 @@ math.parser math.order layouts words sequences sequences.private
arrays assocs classes classes.algebra combinators generic.math
splitting fry locals classes.tuple alien.accessors
classes.tuple.private slots.private definitions strings.private
vectors hashtables
vectors hashtables generic
stack-checker.state
compiler.tree.comparisons
compiler.tree.propagation.info
@ -337,3 +337,12 @@ generic-comparison-ops [
bi
] [ 2drop object-info ] if
] "outputs" set-word-prop
\ equal? [
! If first input has a known type and second input is an
! object, we convert this to [ swap equal? ].
in-d>> first2 value-info class>> object class= [
value-info class>> \ equal? specific-method
[ swap equal? ] f ?
] [ drop f ] if
] "custom-inlining" set-word-prop

View File

@ -640,6 +640,10 @@ MIXIN: empty-mixin
[ { fixnum } declare log2 0 >= ] final-classes
] unit-test
[ V{ POSTPONE: f } ] [
[ { word object } declare equal? ] final-classes
] unit-test
! [ V{ string } ] [
! [ dup string? t xor [ "A" throw ] [ ] if ] final-classes
! ] unit-test

3
basis/concurrency/combinators/combinators.factor Normal file → Executable file
View File

@ -28,7 +28,8 @@ PRIVATE>
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline
: future-values dup [ ?future ] change-each ; inline
: future-values ( futures -- futures )
dup [ ?future ] change-each ; inline
PRIVATE>

View File

@ -1,7 +1,8 @@
IN: concurrency.distributed.tests
USING: tools.test concurrency.distributed kernel io.files
arrays io.sockets system combinators threads math sequences
concurrency.messaging continuations accessors prettyprint ;
io.files.temp io.directories arrays io.sockets system
combinators threads math sequences concurrency.messaging
continuations accessors prettyprint ;
: test-node ( -- addrspec )
{

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: serialize sequences concurrency.messaging threads io
io.servers.connection io.encodings.binary
qualified arrays namespaces kernel accessors ;
arrays namespaces kernel accessors ;
FROM: io.sockets => host-name <inet> with-client ;
IN: concurrency.distributed

View File

@ -14,6 +14,7 @@ TYPEDEF: int SInt32
TYPEDEF: uint UInt32
TYPEDEF: ulong CFTypeID
TYPEDEF: UInt32 CFOptionFlags
TYPEDEF: void* CFUUIDRef
FUNCTION: CFTypeRef CFRetain ( CFTypeRef cf ) ;

View File

@ -8,7 +8,6 @@ TYPEDEF: void* CFDictionaryRef
TYPEDEF: void* CFMutableDictionaryRef
TYPEDEF: void* CFNumberRef
TYPEDEF: void* CFSetRef
TYPEDEF: void* CFUUIDRef
TYPEDEF: int CFNumberType
: kCFNumberSInt8Type 1 ; inline

View File

@ -189,21 +189,21 @@ MTSPR: LR 8
MTSPR: CTR 9
! Pseudo-instructions
: LI 0 rot ADDI ; inline
: SUBI neg ADDI ; inline
: LIS 0 rot ADDIS ; inline
: SUBIC neg ADDIC ; inline
: SUBIC. neg ADDIC. ; inline
: NOT dup NOR ; inline
: NOT. dup NOR. ; inline
: MR dup OR ; inline
: MR. dup OR. ; inline
: (SLWI) 0 31 pick - ; inline
: LI ( value dst -- ) 0 rot ADDI ; inline
: SUBI ( dst src1 src2 -- ) neg ADDI ; inline
: LIS ( value dst -- ) 0 rot ADDIS ; inline
: SUBIC ( dst src1 src2 -- ) neg ADDIC ; inline
: SUBIC. ( dst src1 src2 -- ) neg ADDIC. ; inline
: NOT ( dst src -- ) dup NOR ; inline
: NOT. ( dst src -- ) dup NOR. ; inline
: MR ( dst src -- ) dup OR ; inline
: MR. ( dst src -- ) dup OR. ; inline
: (SLWI) ( d a b -- d a b x y ) 0 31 pick - ; inline
: SLWI ( d a b -- ) (SLWI) RLWINM ;
: SLWI. ( d a b -- ) (SLWI) RLWINM. ;
: (SRWI) 32 over - swap 31 ; inline
: (SRWI) ( d a b -- d a b x y ) 32 over - swap 31 ; inline
: SRWI ( d a b -- ) (SRWI) RLWINM ;
: SRWI. ( d a b -- ) (SRWI) RLWINM. ;
: LOAD32 ( n r -- ) >r w>h/h r> tuck LIS dup rot ORI ;
: LOAD32 ( n r -- ) [ w>h/h ] dip tuck LIS dup rot ORI ;
: immediate? ( n -- ? ) HEX: -8000 HEX: 7fff between? ;
: LOAD ( n r -- ) over immediate? [ LI ] [ LOAD32 ] if ;

View File

@ -79,8 +79,8 @@ M: label (B) 0 -rot (B) rc-relative-ppc-3 label-fixup ;
GENERIC: BC ( a b c -- )
M: integer BC 0 0 16 b-insn ;
M: word BC >r 0 BC r> rc-relative-ppc-2 rel-word ;
M: label BC >r 0 BC r> rc-relative-ppc-2 label-fixup ;
M: word BC [ 0 BC ] dip rc-relative-ppc-2 rel-word ;
M: label BC [ 0 BC ] dip rc-relative-ppc-2 label-fixup ;
: CREATE-B ( -- word ) scan "B" prepend create-in ;

View File

@ -467,19 +467,21 @@ M: ppc %gc
M: ppc %prologue ( n -- )
0 11 LOAD32 rc-absolute-ppc-2/2 rel-this
0 MFLR
1 1 pick neg ADDI
11 1 pick xt-save STW
dup 11 LI
11 1 pick next-save STW
0 1 rot lr-save + STW ;
{
[ [ 1 1 ] dip neg ADDI ]
[ [ 11 1 ] dip xt-save STW ]
[ 11 LI ]
[ [ 11 1 ] dip next-save STW ]
[ [ 0 1 ] dip lr-save + STW ]
} cleave ;
M: ppc %epilogue ( n -- )
#! At the end of each word that calls a subroutine, we store
#! the previous link register value in r0 by popping it off
#! the stack, set the link register to the contents of r0,
#! and jump to the link register.
0 1 pick lr-save + LWZ
1 1 rot ADDI
[ [ 0 1 ] dip lr-save + LWZ ]
[ [ 1 1 ] dip ADDI ] bi
0 MTLR ;
:: (%boolean) ( dst temp word -- )
@ -541,17 +543,17 @@ GENERIC: STF ( src dst off reg-class -- )
M: single-float-regs STF drop STFS ;
M: double-float-regs STF drop STFD ;
M: float-regs %save-param-reg >r 1 rot local@ r> STF ;
M: float-regs %save-param-reg [ 1 rot local@ ] dip STF ;
GENERIC: LF ( dst src off reg-class -- )
M: single-float-regs LF drop LFS ;
M: double-float-regs LF drop LFD ;
M: float-regs %load-param-reg >r 1 rot local@ r> LF ;
M: float-regs %load-param-reg [ 1 rot local@ ] dip LF ;
M: stack-params %load-param-reg ( stack reg reg-class -- )
drop >r 0 1 rot local@ LWZ 0 1 r> param@ STW ;
drop [ 0 1 rot local@ LWZ 0 1 ] dip param@ STW ;
: next-param@ ( n -- x ) param@ stack-frame get total-size>> + ;
@ -559,8 +561,8 @@ M: stack-params %save-param-reg ( stack reg reg-class -- )
#! Funky. Read the parameter from the caller's stack frame.
#! This word is used in callbacks
drop
0 1 rot next-param@ LWZ
0 1 rot local@ STW ;
[ 0 1 ] dip next-param@ LWZ
[ 0 1 ] dip local@ STW ;
M: ppc %prepare-unbox ( -- )
! First parameter is top of stack
@ -580,14 +582,14 @@ M: ppc %unbox-long-long ( n func -- )
f %alien-invoke
! Store the return value on the C stack
[
3 1 pick local@ STW
4 1 rot cell + local@ STW
[ [ 3 1 ] dip local@ STW ]
[ [ 4 1 ] dip cell + local@ STW ] bi
] when* ;
M: ppc %unbox-large-struct ( n c-type -- )
! Value must be in r3
! Compute destination address and load struct size
[ 4 1 rot local@ ADDI ] [ heap-size 5 LI ] bi*
[ [ 4 1 ] dip local@ ADDI ] [ heap-size 5 LI ] bi*
! Call the function
"to_value_struct" f %alien-invoke ;
@ -595,15 +597,16 @@ M: ppc %box ( n reg-class func -- )
! If the source is a stack location, load it into freg #0.
! If the source is f, then we assume the value is already in
! freg #0.
>r
over [ 0 over param-reg swap %load-param-reg ] [ 2drop ] if
r> f %alien-invoke ;
[ over [ 0 over param-reg swap %load-param-reg ] [ 2drop ] if ] dip
f %alien-invoke ;
M: ppc %box-long-long ( n func -- )
>r [
3 1 pick local@ LWZ
4 1 rot cell + local@ LWZ
] when* r> f %alien-invoke ;
[
[
[ [ 3 1 ] dip local@ LWZ ]
[ [ 4 1 ] dip cell + local@ LWZ ] bi
] when*
] dip f %alien-invoke ;
: struct-return@ ( n -- n )
[ stack-frame get params>> ] unless* local@ ;
@ -616,7 +619,7 @@ M: ppc %prepare-box-struct ( -- )
M: ppc %box-large-struct ( n c-type -- )
! If n = f, then we're boxing a returned struct
! Compute destination address and load struct size
[ 3 1 rot struct-return@ ADDI ] [ heap-size 4 LI ] bi*
[ [ 3 1 ] dip struct-return@ ADDI ] [ heap-size 4 LI ] bi*
! Call the function
"box_value_struct" f %alien-invoke ;

View File

@ -37,7 +37,7 @@ M:: x86.64 %dispatch ( src temp offset -- )
M: x86.64 param-reg-1 int-regs param-regs first ;
M: x86.64 param-reg-2 int-regs param-regs second ;
: param-reg-3 int-regs param-regs third ; inline
: param-reg-3 ( -- reg ) int-regs param-regs third ; inline
M: int-regs return-reg drop RAX ;
M: float-regs return-reg drop XMM0 ;

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel words sequences lexer parser fry ;
USING: kernel words words.symbol sequences lexer parser fry ;
IN: cpu.x86.assembler.syntax
: define-register ( name num size -- )

View File

@ -79,9 +79,10 @@ big-endian off
! compute quotation location
temp0 temp1 ADD
! load quotation
temp0 temp0 array-start-offset [+] MOV
! execute branch
temp0 quot-xt-offset [+] JMP
arg temp0 array-start-offset [+] MOV
! execute branch. the quot must be in arg, since it might
! not be compiled yet
arg quot-xt-offset [+] JMP
] rc-absolute-cell rt-immediate 1 rex-length + jit-dispatch jit-define
: jit->r ( -- )

View File

@ -12,7 +12,7 @@ SYMBOL: delimiter
CHAR: , delimiter set-global
: delimiter> delimiter get ; inline
: delimiter> ( -- delimiter ) delimiter get ; inline
DEFER: quoted-field ( -- endchar )

View File

@ -1,6 +1,6 @@
IN: db.pools.tests
USING: db.pools tools.test continuations io.files namespaces
accessors kernel math destructors ;
USING: db.pools tools.test continuations io.files io.files.temp
io.directories namespaces accessors kernel math destructors ;
\ <db-pool> must-infer

View File

@ -166,7 +166,7 @@ ERROR: sqlite-sql-error < sql-error n string ;
: sqlite-row ( handle -- seq )
dup sqlite-#columns [ sqlite-column ] with map ;
: sqlite-step-has-more-rows? ( prepared -- bool )
: sqlite-step-has-more-rows? ( prepared -- ? )
{
{ SQLITE_ROW [ t ] }
{ SQLITE_DONE [ f ] }

View File

@ -1,5 +1,5 @@
USING: io io.files io.launcher kernel namespaces
prettyprint tools.test db.sqlite db sequences
USING: io io.files io.files.temp io.directories io.launcher
kernel namespaces prettyprint tools.test db.sqlite db sequences
continuations db.types db.tuples unicode.case ;
IN: db.sqlite.tests

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: io.files kernel tools.test db db.tuples classes
USING: io.files io.files.temp kernel tools.test db db.tuples classes
db.types continuations namespaces math math.ranges
prettyprint calendar sequences db.sqlite math.intervals
db.postgresql accessors random math.bitwise system

View File

@ -41,12 +41,15 @@ HELP: +user-assigned-id+
{ $description "The user is responsible for choosing a primary key for tuples inserted with this database type. Keys must be unique or else the database will throw an error. Usually it is better to use a " { $link +db-assigned-id+ } "." } ;
HELP: <generator-bind>
{ $values { "slot-name" object } { "key" object } { "generator-singleton" object } { "type" object } { "generator-bind" generator-bind } }
{ $description "" } ;
HELP: <literal-bind>
{ $values { "key" object } { "type" object } { "value" object } { "literal-bind" literal-bind } }
{ $description "" } ;
HELP: <low-level-binding>
{ $values { "value" object } { "low-level-binding" low-level-binding } }
{ $description "" } ;
HELP: BIG-INTEGER

View File

@ -2,14 +2,14 @@
! See http://factorcode.org/license.txt for BSD license.
USING: slots arrays definitions generic hashtables summary io
kernel math namespaces make prettyprint prettyprint.config
sequences assocs sequences.private strings io.styles io.files
vectors words system splitting math.parser classes.mixin
classes.tuple continuations continuations.private combinators
generic.math classes.builtin classes compiler.units
sequences assocs sequences.private strings io.styles
io.pathnames vectors words system splitting math.parser
classes.mixin classes.tuple continuations continuations.private
combinators generic.math classes.builtin classes compiler.units
generic.standard vocabs init kernel.private io.encodings
accessors math.order destructors source-files parser
classes.tuple.parser effects.parser lexer compiler.errors
generic.parser strings.parser ;
generic.parser strings.parser vocabs.parser ;
IN: debugger
GENERIC: error. ( error -- )

View File

@ -2,7 +2,8 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors parser generic kernel classes classes.tuple
words slots assocs sequences arrays vectors definitions
math hashtables sets generalizations namespaces make ;
math hashtables sets generalizations namespaces make
words.symbol ;
IN: delegate
: protocol-words ( protocol -- words )

View File

@ -1,9 +1,9 @@
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: parser lexer kernel namespaces sequences definitions
io.files summary continuations tools.crossref tools.vocabs io
prettyprint source-files assocs vocabs vocabs.loader io.backend
splitting accessors ;
io.files io.backend io.pathnames io summary continuations
tools.crossref tools.vocabs prettyprint source-files assocs
vocabs vocabs.loader splitting accessors ;
IN: editors
TUPLE: no-edit-hook ;

View File

@ -1,6 +1,6 @@
USING: definitions kernel parser words sequences math.parser
namespaces editors io.launcher windows.shell32 io.files
io.paths.windows strings unicode.case make ;
io.directories.search.windows strings unicode.case make ;
IN: editors.editpadlite
: editpadlite-path ( -- path )

View File

@ -1,6 +1,6 @@
USING: definitions kernel parser words sequences math.parser
namespaces editors io.launcher windows.shell32 io.files
io.paths.windows strings unicode.case make ;
io.directories.search.windows strings unicode.case make ;
IN: editors.editpadpro
: editpadpro-path ( -- path )

View File

@ -1,5 +1,6 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences windows.shell32 make io.paths.windows ;
namespaces sequences windows.shell32 make
io.directories.search.windows ;
IN: editors.editplus
: editplus-path ( -- path )

View File

@ -1,5 +1,6 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences windows.shell32 make io.paths.windows ;
namespaces sequences windows.shell32 make
io.directories.search.windows ;
IN: editors.emeditor
: emeditor-path ( -- path )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Kibleur Christophe.
! See http://factorcode.org/license.txt for BSD license.
USING: editors io.files io.launcher kernel math.parser
namespaces sequences windows.shell32 io.paths.windows make ;
USING: editors io.files io.launcher kernel math.parser make
namespaces sequences windows.shell32 io.directories.search.windows ;
IN: editors.etexteditor
: etexteditor-path ( -- str )

View File

@ -1,5 +1,4 @@
USING: io.unix.backend kernel namespaces editors.gvim
system ;
USING: kernel namespaces editors.gvim system ;
IN: editors.gvim.unix
M: unix gvim-path

View File

@ -1,5 +1,6 @@
USING: editors.gvim io.files io.windows kernel namespaces
sequences windows.shell32 io.paths.windows system ;
USING: editors.gvim io.files kernel namespaces sequences
windows.shell32 io.directories.search.windows system
io.pathnames ;
IN: editors.gvim.windows
M: windows gvim-path

View File

@ -4,7 +4,7 @@ USING: arrays definitions io kernel math
namespaces parser prettyprint sequences strings words
editors io.files io.sockets io.streams.byte-array io.binary
math.parser io.encodings.ascii io.encodings.binary
io.encodings.utf8 io.files.private ;
io.encodings.utf8 io.files.private io.pathnames ;
IN: editors.jedit
: jedit-server-info ( -- port auth )

View File

@ -1,10 +1,10 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences windows.shell32 make ;
namespaces sequences windows.shell32 make io.pathnames ;
IN: editors.notepad2
: notepad2-path ( -- path )
\ notepad2-path get-global [
"C:\\Windows\\system32\\notepad.exe"
windows-directory "system32\\notepad.exe" append-path
] unless* ;
: notepad2 ( file line -- )

View File

@ -1,5 +1,5 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences io.paths.windows make ;
namespaces sequences io.directories.search.windows make ;
IN: editors.notepadpp
: notepadpp-path ( -- path )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Clemens F. Hofreither.
! See http://factorcode.org/license.txt for BSD license.
! clemens.hofreither@gmx.net
USING: io.files io.launcher kernel namespaces io.paths.windows
USING: io.files io.launcher kernel namespaces io.directories.search.windows
math math.parser editors sequences make unicode.case ;
IN: editors.scite

View File

@ -1,5 +1,5 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences io.paths.windows make ;
namespaces sequences io.directories.search.windows make ;
IN: editors.ted-notepad
: ted-notepad-path ( -- path )

View File

View File

@ -0,0 +1 @@
TextPad editor integration

View File

@ -0,0 +1,16 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences make io.directories.search
io.directories.search.windows ;
IN: editors.textpad
: textpad-path ( -- path )
\ textpad-path get-global [
"TextPad 5" t [ "TextPad.exe" tail? ] find-in-program-files
] unless* ;
: textpad ( file line -- )
[
textpad-path , [ , ] [ number>string "(" ",0)" surround , ] bi*
] { } make run-detached drop ;
[ textpad ] edit-hook set-global

View File

@ -1,5 +1,5 @@
USING: editors io.files io.launcher kernel math.parser
namespaces sequences io.paths.windows make ;
namespaces sequences io.directories.search.windows make ;
IN: editors.ultraedit
: ultraedit-path ( -- path )

View File

@ -1,4 +1,5 @@
USING: definitions help help.markup help.syntax io io.files editors words ;
USING: definitions editors help help.markup help.syntax io io.files
io.pathnames words ;
IN: editors.vim
ARTICLE: { "vim" "vim" } "Vim support"

View File

@ -1,4 +1,4 @@
USING: editors io.launcher kernel io.paths.windows
USING: editors io.launcher kernel io.directories.search.windows
math.parser namespaces sequences io.files arrays ;
IN: editors.wordpad

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays classes.singleton combinators
continuations io io.encodings.binary io.encodings.utf8
io.files io.sockets kernel io.streams.duplex math
io.files io.pathnames io.sockets kernel io.streams.duplex math
math.parser sequences splitting namespaces strings fry ftp
ftp.client.listing-parser urls ;
IN: ftp.client
@ -104,7 +104,3 @@ ERROR: ftp-error got expected ;
[ nip parent-directory ftp-cwd drop ]
[ file-name (ftp-get) ] 2bi
] with-ftp-client ;

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators io.files kernel math.parser
USING: accessors combinators io.files.types kernel math.parser
sequences splitting ;
IN: ftp.client.listing-parser

View File

@ -2,12 +2,13 @@
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.short-circuit accessors combinators io
io.encodings.8-bit io.encodings io.encodings.binary
io.encodings.utf8 io.files io.sockets kernel math.parser
namespaces make sequences ftp io.unix.launcher.parser
unicode.case splitting assocs classes io.servers.connection
destructors calendar io.timeouts io.streams.duplex threads
continuations math concurrency.promises byte-arrays
io.backend tools.hexdump tools.files io.streams.string ;
io.encodings.utf8 io.files io.files.info io.directories
io.pathnames io.sockets kernel math.parser namespaces make
sequences ftp io.launcher.unix.parser unicode.case splitting
assocs classes io.servers.connection destructors calendar
io.timeouts io.streams.duplex threads continuations math
concurrency.promises byte-arrays io.backend tools.hexdump
tools.files io.streams.string math.bitwise ;
IN: ftp.server
TUPLE: ftp-client url mode state command-promise user password ;
@ -48,7 +49,7 @@ C: <ftp-list> ftp-list
[ >>raw ] [ tokenize-command >>tokenized ] bi ;
: (send-response) ( n string separator -- )
rot number>string write write ftp-send ;
[ number>string write ] 2dip write ftp-send ;
: send-response ( ftp-response -- )
[ n>> ] [ strings>> ] bi
@ -101,7 +102,7 @@ ERROR: type-error type ;
: handle-TYPE ( obj -- )
[
tokenized>> second parse-type
200 "Switching to " rot " mode" 3append server-response
[ 200 ] dip "Switching to " " mode" surround server-response
] [
2drop "TYPE is binary only" ftp-error
] recover ;
@ -110,11 +111,11 @@ ERROR: type-error type ;
remote-address get class new 0 >>port binary <server> ;
: port>bytes ( port -- hi lo )
[ -8 shift ] keep [ HEX: ff bitand ] bi@ ;
[ -8 shift ] keep [ 8 bits ] bi@ ;
: handle-PWD ( obj -- )
drop
257 current-directory get "\"" "\"" surround server-response ;
257 current-directory get "\"" dup surround server-response ;
: handle-SYST ( obj -- )
drop
@ -154,15 +155,19 @@ M: ftp-list service-command ( stream obj -- )
finish-directory ;
: transfer-outgoing-file ( path -- )
150 "Opening BINARY mode data connection for "
rot
[ file-name ] [
" " swap file-info size>> number>string
"(" " bytes)." surround append
] bi 3append server-response ;
[
150
"Opening BINARY mode data connection for "
] dip
[
file-name
] [
file-info size>> number>string
"(" " bytes)." surround
] bi " " glue append server-response ;
: transfer-incoming-file ( path -- )
150 "Opening BINARY mode data connection for " rot append
[ 150 ] dip "Opening BINARY mode data connection for " prepend
server-response ;
: finish-file-transfer ( -- )
@ -208,8 +213,9 @@ M: ftp-put service-command ( stream obj -- )
: handle-SIZE ( obj -- )
[
[ 213 ] dip
tokenized>> second file-info size>>
213 swap number>string server-response
number>string server-response
] [
2drop
550 "Could not get file size" server-response
@ -227,21 +233,20 @@ M: ftp-put service-command ( stream obj -- )
: handle-PASV ( obj -- )
drop client get passive >>mode drop
expect-connection
[
"Entering Passive Mode (127,0,0,1," %
port>bytes [ number>string ] bi@ "," glue %
")" %
] "" make 227 swap server-response ;
221
expect-connection port>bytes [ number>string ] bi@ "," glue
"Entering Passive Mode (127,0,0,1," ")" surround
server-response ;
: handle-EPSV ( obj -- )
drop
client get command-promise>> [
"You already have a passive stream" ftp-error
] [
229 "Entering Extended Passive Mode (|||"
229
expect-connection number>string
"|)" 3append server-response
"Entering Extended Passive Mode (|||" "|)" surround
server-response
] if ;
! LPRT 6,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,242,186

View File

@ -3,7 +3,8 @@
USING: kernel quotations classes.tuple make combinators generic
words interpolate namespaces sequences io.streams.string fry
classes.mixin effects lexer parser classes.tuple.parser
effects.parser locals.types locals.parser locals.rewrite.closures ;
effects.parser locals.types locals.parser
locals.rewrite.closures vocabs.parser ;
IN: functors
: scan-param ( -- obj )

View File

@ -5,7 +5,7 @@ furnace.auth.login
furnace.auth.providers
furnace.auth.providers.db tools.test
namespaces db db.sqlite db.tuples continuations
io.files accessors kernel ;
io.files io.files.temp io.directories accessors kernel ;
<action> "test" <login-realm> realm set

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel combinators assocs
namespaces sequences splitting words
fry urls multiline present qualified
fry urls multiline present
xml
xml.data
xml.entities

View File

@ -10,8 +10,8 @@ HELP: <redirect>
{ $values { "url" url } { "response" response } }
{ $description "Creates a response which redirects the client to the given URL." } ;
HELP: <secure-only> ( responder -- responder' )
{ $values { "responder" "a responder" } { "responder'" "a responder" } }
HELP: <secure-only>
{ $values { "responder" "a responder" } { "secure-only" "a responder" } }
{ $description "Creates a new responder which ensures that the client is connecting via HTTPS before delegating to the underlying responder. If the client is connecting via HTTP, a redirect is sent instead." } ;
HELP: <secure-redirect>

View File

@ -2,9 +2,9 @@ IN: furnace.sessions.tests
USING: tools.test http furnace.sessions furnace.actions
http.server http.server.responses math namespaces make kernel
accessors io.sockets io.servers.connection prettyprint
io.streams.string io.files splitting destructors sequences db
db.tuples db.sqlite continuations urls math.parser furnace
furnace.utilities ;
io.streams.string io.files io.files.temp io.directories
splitting destructors sequences db db.tuples db.sqlite
continuations urls math.parser furnace furnace.utilities ;
: with-session
[

View File

@ -8,7 +8,8 @@ IN: grouping
TUPLE: chunking-seq { seq read-only } { n read-only } ;
: check-groups dup 0 <= [ "Invalid group count" throw ] when ; inline
: check-groups ( n -- n )
dup 0 <= [ "Invalid group count" throw ] when ; inline
: new-groups ( seq n class -- groups )
[ check-groups ] dip boa ; inline

View File

@ -87,7 +87,8 @@ M: heap heap-size ( heap -- n )
GENERIC: heap-compare ( pair1 pair2 heap -- ? )
: (heap-compare) drop [ key>> ] compare ; inline
: (heap-compare) ( pair1 pair2 heap -- <=> )
drop [ key>> ] compare ; inline
M: min-heap heap-compare (heap-compare) +gt+ eq? ;

View File

@ -168,6 +168,11 @@ ARTICLE: "io" "Input and output"
{ $heading "Streams" }
{ $subsection "streams" }
{ $subsection "io.files" }
{ $heading "The file system" }
{ $subsection "io.pathnames" }
{ $subsection "io.files.info" }
{ $subsection "io.files.links" }
{ $subsection "io.directories" }
{ $heading "Encodings" }
{ $subsection "encodings-introduction" }
{ $subsection "io.encodings" }

View File

@ -1,10 +1,11 @@
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays io io.styles kernel namespaces make
parser prettyprint sequences words assocs definitions generic
quotations effects slots continuations classes.tuple debugger
combinators vocabs help.stylesheet help.topics help.crossref
help.markup sorting classes vocabs.loader ;
parser prettyprint sequences words words.symbol assocs
definitions generic quotations effects slots continuations
classes.tuple debugger combinators vocabs help.stylesheet
help.topics help.crossref help.markup sorting classes
vocabs.loader ;
IN: help
GENERIC: word-help* ( word -- content )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary
io.files html.streams html.elements help kernel
io.files io.files.temp io.directories html.streams html.elements help kernel
assocs sequences make words accessors arrays help.topics vocabs
tools.vocabs tools.vocabs.browser namespaces prettyprint io
vocabs.loader serialize fry memoize unicode.case math.order

View File

@ -5,7 +5,8 @@ help.topics words strings classes tools.vocabs namespaces make
io io.streams.string prettyprint definitions arrays vectors
combinators combinators.short-circuit splitting debugger
hashtables sorting effects vocabs vocabs.loader assocs editors
continuations classes.predicate macros math sets eval ;
continuations classes.predicate macros math sets eval
vocabs.parser words.symbol ;
IN: help.lint
: check-example ( element -- )
@ -43,9 +44,9 @@ IN: help.lint
: check-values ( word element -- )
{
[ drop { [ symbol? ] [ macro? ] [ parsing-word? ] } 1|| ]
[ drop "declared-effect" word-prop not ]
[ nip contains-funky-elements? ]
[ drop macro? ]
[
[ effect-values >array ]
[ extract-values >array ]
@ -59,7 +60,7 @@ IN: help.lint
] each ;
: vocab-exists? ( name -- ? )
dup vocab swap "all-vocabs" get member? or ;
[ vocab ] [ "all-vocabs" get member? ] bi or ;
: check-modules ( element -- )
\ $vocab-link swap elements [

View File

@ -3,8 +3,7 @@
USING: accessors arrays definitions generic io kernel assocs
hashtables namespaces make parser prettyprint sequences strings
io.styles vectors words math sorting splitting classes slots
vocabs help.stylesheet help.topics vocabs.loader alias
quotations ;
vocabs help.stylesheet help.topics vocabs.loader quotations ;
IN: help.markup
! Simple markup language.

View File

@ -1,7 +1,8 @@
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel parser sequences words help
help.topics namespaces vocabs definitions compiler.units ;
help.topics namespaces vocabs definitions compiler.units
vocabs.parser ;
IN: help.syntax
: HELP:

View File

@ -3,7 +3,8 @@
USING: parser words definitions kernel sequences assocs arrays
kernel.private fry combinators accessors vectors strings sbufs
byte-arrays byte-vectors io.binary io.streams.string splitting
math generic generic.standard generic.standard.engines classes ;
math generic generic.standard generic.standard.engines classes
hashtables ;
IN: hints
GENERIC: specializer-predicate ( spec -- quot )
@ -50,14 +51,10 @@ M: object specializer-declaration class ;
] [ drop f ] if ;
: specialized-def ( word -- quot )
dup def>> swap {
{
[ dup "specializer" word-prop ]
[ "specializer" word-prop specialize-quot ]
}
{ [ dup standard-method? ] [ specialize-method ] }
[ drop ]
} cond ;
[ def>> ] keep
[ dup standard-method? [ specialize-method ] [ drop ] if ]
[ "specializer" word-prop [ specialize-quot ] when* ]
bi ;
: specialized-length ( specializer -- n )
dup [ array? ] all? [ first ] when length ;
@ -120,3 +117,7 @@ M: object specializer-declaration class ;
\ >le { { fixnum fixnum } { bignum fixnum } } "specializer" set-word-prop
\ >be { { bignum fixnum } { fixnum fixnum } } "specializer" set-word-prop
\ hashtable \ at* method { { fixnum hashtable } { word hashtable } } "specializer" set-word-prop
\ hashtable \ set-at method { { object fixnum object } { object word object } } "specializer" set-word-prop

View File

@ -4,8 +4,8 @@ html.templates html.templates.chloe.syntax
html.templates.chloe.compiler html.templates.chloe.components
math xml.data strings quotations namespaces ;
HELP: <chloe> ( path -- template )
{ $values { "path" "a pathname string without the trailing " { $snippet ".xml" } " extension" } { "template" chloe } }
HELP: <chloe>
{ $values { "path" "a pathname string without the trailing " { $snippet ".xml" } " extension" } { "chloe" chloe } }
{ $description "Creates a new Chloe template object which can be passed to " { $link call-template } "." } ;
HELP: required-attr

View File

@ -2,9 +2,9 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel sequences combinators kernel fry
namespaces make classes.tuple assocs splitting words arrays io
io.files io.encodings.utf8 io.streams.string unicode.case
mirrors math urls present multiline quotations xml logging
continuations
io.files io.files.info io.encodings.utf8 io.streams.string
unicode.case mirrors math urls present multiline quotations xml
logging continuations
xml.data
html.forms
html.elements

View File

@ -1,7 +1,7 @@
IN: html.templates.fhtml
USING: help.markup help.syntax ;
HELP: <fhtml> ( path -- fhtml )
HELP: <fhtml>
{ $values { "path" "a pathname string" } { "fhtml" fhtml } }
{ $description "Creates an FHTML template descriptor." } ;

View File

@ -1,4 +1,4 @@
USING: http help.markup help.syntax io.files io.streams.string
USING: http help.markup help.syntax io.pathnames io.streams.string
io.encodings.8-bit io.encodings.binary kernel strings urls
urls.encoding byte-arrays strings assocs sequences ;
IN: http.client

View File

@ -1,17 +1,12 @@
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs kernel math math.parser namespaces make
sequences io io.sockets io.streams.string io.files io.timeouts
strings splitting calendar continuations accessors vectors
sequences strings splitting calendar continuations accessors vectors
math.order hashtables byte-arrays destructors
io.encodings
io.encodings.string
io.encodings.ascii
io.encodings.utf8
io.encodings.8-bit
io.encodings.binary
io.streams.duplex
fry ascii urls urls.encoding present
io io.sockets io.streams.string io.files io.timeouts
io.pathnames io.encodings io.encodings.string io.encodings.ascii
io.encodings.utf8 io.encodings.8-bit io.encodings.binary
io.streams.duplex fry ascii urls urls.encoding present
http http.parsers ;
IN: http.client

View File

@ -179,7 +179,7 @@ Set-Cookie: oo="bar; a=b"; comment="your mom"; httponly=yes
! Live-fire exercise
USING: http.server http.server.static furnace.sessions furnace.alloy
furnace.actions furnace.auth furnace.auth.login furnace.db http.client
io.servers.connection io.files io io.encodings.ascii
io.servers.connection io.files io.files.temp io.directories io io.encodings.ascii
accessors namespaces threads
http.server.responses http.server.redirection furnace.redirection
http.server.dispatchers db.tuples ;

View File

@ -8,7 +8,7 @@ calendar.format present urls
io io.encodings io.encodings.iana io.encodings.binary
io.encodings.8-bit
unicode.case unicode.categories qualified
unicode.case unicode.categories
http.parsers ;

View File

@ -4,8 +4,8 @@ IN: http.server
HELP: trivial-responder
{ $description "The class of trivial responders, which output the same response for every request. New instances are created by calling " { $link <trivial-responder> } "." } ;
HELP: <trivial-responder> ( response -- responder )
{ $values { "response" response } { "responder" trivial-responder } }
HELP: <trivial-responder>
{ $values { "response" response } { "trivial-responder" trivial-responder } }
{ $description "Creates a new trivial responder which outputs the same response for every request." } ;
HELP: benchmark?

View File

@ -1,14 +1,11 @@
! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: calendar io io.files kernel math math.order
math.parser namespaces parser sequences strings
assocs hashtables debugger mime.types sorting logging
calendar.format accessors splitting
io.encodings.binary fry xml.entities destructors urls
html.elements html.templates.fhtml
http
http.server
http.server.responses
USING: calendar kernel math math.order math.parser namespaces
parser sequences strings assocs hashtables debugger mime.types
sorting logging calendar.format accessors splitting io io.files
io.files.info io.directories io.pathnames io.encodings.binary
fry xml.entities destructors urls html.elements
html.templates.fhtml http http.server http.server.responses
http.server.redirection ;
IN: http.server.static

View File

View File

@ -1,9 +1,9 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: namespaces system kernel accessors assocs continuations
unix io.backend io.unix.backend io.unix.multiplexers
io.unix.multiplexers.kqueue ;
IN: io.unix.bsd
unix io.backend io.backend.unix io.backend.unix.multiplexers
io.backend.unix.multiplexers.kqueue io.files.unix ;
IN: io.backend.unix.bsd
M: bsd init-io ( -- )
<kqueue-mx> mx set-global ;

Some files were not shown because too many files have changed in this diff Show More