core: using lowercase colon words.

locals-and-roots
Doug Coleman 2016-06-03 11:34:15 -07:00
parent 72f88bb950
commit 99ed27a833
364 changed files with 560 additions and 560 deletions

View File

@ -1,6 +1,6 @@
! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
IN: alien.accessors
in: alien.accessors
PRIMITIVE: alien-cell ( c-ptr n -- value )
PRIMITIVE: alien-double ( c-ptr n -- value )

View File

@ -2,7 +2,7 @@ USING: alien.accessors alien.c-types alien.libraries alien.strings
alien.syntax byte-arrays cpu.x86 eval help.markup help.syntax io
io.backend io.encodings.utf16n io.encodings.utf8 kernel math
quotations sequences system ;
IN: alien
in: alien
HELP: callee-cleanup?
{ $values { "abi" abi } { "?" boolean } }

View File

@ -2,7 +2,7 @@ USING: accessors alien alien.accessors alien.c-types
alien.syntax byte-arrays continuations fry kernel layouts math
namespaces prettyprint sequences tools.memory tools.test ;
QUALIFIED: sets
IN: alien.tests
in: alien.tests
{ t } [ -1 <alien> alien-address 0 > ] unit-test
@ -72,7 +72,7 @@ cell 8 = [
{ "( displaced alien )" } [ 1 B{ 1 2 3 } <displaced-alien> unparse ] unit-test
SYMBOL: initialize-test
symbol: initialize-test
f initialize-test set-global
@ -91,7 +91,7 @@ f initialize-test set-global
: produce-until-error ( quot -- error seq )
'[ [ @ t ] [ f ] recover ] [ ] produce ; inline
SYMBOL: foo
symbol: foo
: fill-and-free-callback-heap ( -- )
[ \ foo 33 <callback> ] produce-until-error nip [ free-callback ] each ;

View File

@ -3,7 +3,7 @@
USING: accessors assocs byte-arrays byte-vectors continuations
continuations.private init kernel kernel.private math namespaces
sequences ;
IN: alien
in: alien
BUILTIN: alien { underlying c-ptr read-only initial: f } expired ;
BUILTIN: dll { path byte-array read-only initial: B{ } } ;
@ -109,7 +109,7 @@ ERROR: alien-assembly-error code ;
! are also pinned in a special callback area, so clearing this
! hashtable will not reclaim callbacks. It should only be
! cleared on startup.
SYMBOL: callbacks
symbol: callbacks
[ H{ } clone callbacks set-global ] "alien" add-startup-hook

View File

@ -2,7 +2,7 @@ USING: alien help.syntax help.markup libc kernel.private
byte-arrays strings hashtables alien.syntax alien.strings
sequences io.encodings.string debugger destructors vocabs.loader
classes.struct math kernel ;
IN: alien.c-types
in: alien.c-types
HELP: heap-size
{ $values { "name" c-type-name } { "size" math:integer } }

View File

@ -2,7 +2,7 @@ USING: accessors alien.c-types alien.syntax classes
classes.struct compiler.units eval io.encodings.ascii kernel
math.constants tools.test ;
FROM: alien.c-types => short ;
IN: alien.c-types.tests
in: alien.c-types.tests
CONSTANT: xyz 123
@ -126,26 +126,26 @@ must-fail-with
! generic -> callback
"IN: alien.c-types.tests
USE: alien.syntax
USE: alien.c-types
use: alien.syntax
use: alien.c-types
GENERIC: foo-func ( x -- )
" eval( -- )
"IN: alien.c-types.tests
USE: alien.syntax
USE: alien.c-types
use: alien.syntax
use: alien.c-types
CALLBACK: void foo-func ( )
" eval( -- )
! generic -> typedef
"IN: alien.c-types.tests
USE: alien.syntax
USE: alien.c-types
use: alien.syntax
use: alien.c-types
GENERIC: foo-func ( x -- )
" eval( -- )
"IN: alien.c-types.tests
USE: alien.syntax
USE: alien.c-types
use: alien.syntax
use: alien.c-types
TYPEDEF: void* foo-func
" eval( -- )

View File

@ -4,7 +4,7 @@ USING: accessors alien alien.accessors arrays byte-arrays
classes combinators compiler.units cpu.architecture delegate
fry kernel layouts locals macros math math.order quotations
sequences system words words.symbol summary ;
IN: alien.c-types
in: alien.c-types
SYMBOLS:
char uchar
@ -15,7 +15,7 @@ SYMBOLS:
float double
void* bool ;
SINGLETON: void
singleton: void
TUPLE: abstract-c-type
{ class class initial: object }

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.syntax assocs help.markup
help.syntax io.backend kernel namespaces strings ;
IN: alien.libraries
in: alien.libraries
HELP: make-library
{ $values

View File

@ -3,7 +3,7 @@
USING: accessors alien alien.strings assocs compiler.errors
io.backend kernel namespaces destructors sequences strings
system io.pathnames fry combinators vocabs ;
IN: alien.libraries
in: alien.libraries
PRIMITIVE: dll-valid? ( dll -- ? )
PRIMITIVE: (dlopen) ( path -- dll )
@ -19,7 +19,7 @@ PRIMITIVE: (dlsym-raw) ( name dll -- alien )
HOOK: dlerror os ( -- message/f )
SYMBOL: libraries
symbol: libraries
libraries [ H{ } clone ] initialize
@ -89,7 +89,7 @@ M: library dispose dll>> [ dispose ] when* ;
2dup load-library dlsym-raw
[ 2nip ] [ no-such-symbol ] if* ;
SYMBOL: deploy-libraries
symbol: deploy-libraries
deploy-libraries [ V{ } clone ] initialize

View File

@ -1,6 +1,6 @@
USING: help.markup help.syntax strings byte-arrays alien libc
debugger io.encodings.string sequences ;
IN: alien.strings
in: alien.strings
HELP: string>alien
{ $values { "string" string } { "encoding" "an encoding descriptor" } { "byte-array" byte-array } }

View File

@ -1,7 +1,7 @@
USING: alien.strings alien.c-types alien.data tools.test
kernel libc io.encodings.utf8 io.encodings.utf16 io.encodings.utf16n
io.encodings.ascii alien io.encodings.string io.encodings.8-bit.latin1 ;
IN: alien.strings.tests
in: alien.strings.tests
{ "\u0000ff" }
[ "\u0000ff" latin1 string>alien latin1 alien>string ]

View File

@ -5,7 +5,7 @@ io.encodings io.encodings.ascii io.encodings.utf16n
io.encodings.utf8 io.streams.memory kernel kernel.private math
namespaces sequences sequences.private strings strings.private
system system.private ;
IN: alien.strings
in: alien.strings
GENERIC# alien>string 1 ( c-ptr encoding -- string/f )

View File

@ -1,6 +1,6 @@
USING: help.markup help.syntax
kernel kernel.private prettyprint sequences.private sequences ;
IN: arrays
in: arrays
ARTICLE: "arrays-unsafe" "Unsafe array operations"
"These two words are used internally by the Factor implementation. User code should never need to call them; instead use " { $link nth } " and " { $link set-nth } "."

View File

@ -1,7 +1,7 @@
! Copyright (C) 2005, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel math sequences sequences.private ;
IN: arrays
in: arrays
BUILTIN: array { length array-capacity read-only initial: 0 } ;

View File

@ -3,7 +3,7 @@
USING: help.markup help.syntax kernel sequences
sequences.private namespaces math quotations assocs.private
sets ;
IN: assocs
in: assocs
ARTICLE: "alists" "Association lists"
"An " { $emphasis "association list" } ", abbreviated " { $emphasis "alist" } ", is an association represented as a sequence where all elements are key/value pairs. The " { $link sequence } " mixin is an instance of the " { $link assoc } " mixin, hence all sequences support the " { $link "assocs-protocol" } " in this way."

View File

@ -1,8 +1,8 @@
USING: alien.c-types assocs kernel make math namespaces
sequences specialized-arrays tools.test ;
IN: assocs.tests
in: assocs.tests
SPECIALIZED-ARRAY: double
IN: assocs.tests
in: assocs.tests
{ t } [ H{ } dup assoc-subset? ] unit-test
{ f } [ H{ { 1 3 } } H{ } assoc-subset? ] unit-test

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel math sequences sequences.private
vectors ;
IN: assocs
in: assocs
MIXIN: assoc

View File

@ -1,5 +1,5 @@
USING: bootstrap.image.private effects help.markup help.syntax strings ;
IN: bootstrap.primitives
in: bootstrap.primitives
ARTICLE: "bootstrap.primitives" "Bootstrap primitives"
"A script file run to create the bootstrap image. Also see the vocab " { $link "bootstrap.image.primitives" } "." ;

View File

@ -7,7 +7,7 @@ classes.tuple.private classes.union combinators compiler.units io
kernel kernel.private layouts make math math.private namespaces parser
quotations sequences slots source-files splitting vocabs vocabs.loader
words ;
IN: bootstrap.primitives
in: bootstrap.primitives
"* Creating primitives and basic runtime structures..." print flush

View File

@ -5,7 +5,7 @@ hashtables.wrapped init io io.files kernel kernel.private make
memory namespaces parser parser.notes sequences system vocabs
vocabs.loader vocabs.hierarchy ;
QUALIFIED: bootstrap.image.private
IN: bootstrap.stage1
in: bootstrap.stage1
"Bootstrap stage 1..." print flush

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: words words.symbol sequences vocabs kernel
compiler.units ;
IN: bootstrap.syntax
in: bootstrap.syntax
[
"syntax" create-vocab drop

View File

@ -1,5 +1,5 @@
USING: kernel help.markup help.syntax sequences ;
IN: byte-arrays
in: byte-arrays
ARTICLE: "byte-arrays" "Byte arrays"
"Byte arrays are fixed-size mutable sequences (" { $link "sequence-protocol" } ") whose elements are integers in the range 0-255, inclusive. Each element only uses one byte of storage, hence the name. The literal syntax is covered in " { $link "syntax-byte-arrays" } "."

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.accessors kernel math sequences
sequences.private ;
IN: byte-arrays
in: byte-arrays
BUILTIN: byte-array
{ length array-capacity read-only initial: 0 } ;

View File

@ -1,5 +1,5 @@
USING: help.markup help.syntax sequences ;
IN: byte-vectors
in: byte-vectors
ARTICLE: "byte-vectors" "Byte vectors"
"The " { $vocab-link "byte-vectors" } " vocabulary implements resizable mutable sequence of unsigned bytes. Byte vectors implement the " { $link "sequence-protocol" } " and thus all " { $link "sequences" } " can be used with them."

View File

@ -1,6 +1,6 @@
USING: byte-vectors math prettyprint sequences tools.test
vectors ;
IN: byte-vectors.tests
in: byte-vectors.tests
{ 0 } [ 123 <byte-vector> length ] unit-test

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors byte-arrays growable kernel math sequences
sequences.private ;
IN: byte-vectors
in: byte-vectors
TUPLE: byte-vector
{ underlying byte-array }

View File

@ -1,5 +1,5 @@
USING: byte-arrays help.markup help.syntax sequences strings ;
IN: checksums
in: checksums
HELP: checksum
{ $class-description "The class of checksum algorithms." } ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors byte-arrays byte-vectors io io.backend io.files
kernel math math.parser sequences ;
IN: checksums
in: checksums
MIXIN: checksum

View File

@ -1,5 +1,5 @@
USING: help.markup help.syntax math ;
IN: checksums.crc32
in: checksums.crc32
HELP: crc32
{ $class-description "The CRC32 checksum algorithm." } ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: checksums io.binary kernel math sequences
sequences.private ;
IN: checksums.crc32
in: checksums.crc32
CONSTANT: crc32-polynomial 0xedb88320
@ -19,7 +19,7 @@ CONSTANT: crc32-table V{ }
mask-byte crc32-table nth-unsafe
swap -8 shift bitxor ; inline
SINGLETON: crc32
singleton: crc32
INSTANCE: crc32 checksum

View File

@ -1,6 +1,6 @@
USING: classes classes.private help.markup help.syntax kernel
math sequences ;
IN: classes.algebra
in: classes.algebra
ARTICLE: "class-operations" "Class operations"
"Set-theoretic operations on classes:"

View File

@ -2,7 +2,7 @@ USING: accessors arrays assocs classes classes.algebra
classes.tuple classes.union generic generic.private growable
kernel math prettyprint quotations random sbufs sequences
stack-checker strings tools.test vectors words ;
IN: classes.algebra.tests
in: classes.algebra.tests
TUPLE: first-one ;
TUPLE: second-one ;
@ -26,9 +26,9 @@ UNION: x1 a1 b1 ;
UNION: y1 a1 c1 ;
UNION: z1 b1 c1 ;
SINGLETON: sa
SINGLETON: sb
SINGLETON: sc
singleton: sa
singleton: sb
singleton: sc
INTERSECTION: empty-intersection ;
@ -334,7 +334,7 @@ MIXIN: empty-mixin
] unit-test
] times
SINGLETON: xxx
singleton: xxx
UNION: yyy xxx ;
{ { yyy xxx } } [ { xxx yyy } sort-classes ] unit-test

View File

@ -3,7 +3,7 @@
USING: accessors arrays assocs classes classes.private
combinators kernel make math math.order namespaces sequences
sets sorting vectors words ;
IN: classes.algebra
in: classes.algebra
DEFER: sort-classes
@ -107,7 +107,7 @@ PRIVATE>
: class-or ( first second -- class )
class-or-cache get [ (class-or) ] symmetric-class-op ;
SYMBOL: +incomparable+
symbol: +incomparable+
: compare-classes ( first second -- <=> )
[ swap class<= ] [ class<= ] 2bi

View File

@ -1,5 +1,5 @@
USING: help.syntax help.markup classes layouts ;
IN: classes.builtin
in: classes.builtin
ARTICLE: "builtin-classes" "Built-in classes"
"Every object is an instance of exactly one canonical " { $emphasis "built-in class" } " which defines its layout in memory and basic behavior."

View File

@ -1,5 +1,5 @@
USING: accessors kernel memory sequences tools.test words ;
IN: classes.builtin.tests
in: classes.builtin.tests
{ f } [
[ word? ] instances

View File

@ -2,9 +2,9 @@
! See http://factorcode.org/license.txt for BSD license.
USING: classes classes.algebra.private classes.private kernel
kernel.private make namespaces sequences words ;
IN: classes.builtin
in: classes.builtin
SYMBOL: builtins
symbol: builtins
PREDICATE: builtin-class < class
"metaclass" word-prop builtin-class eq? ;

View File

@ -1,6 +1,6 @@
USING: classes.private help.markup help.syntax kernel quotations
sequences words ;
IN: classes
in: classes
ARTICLE: "class-predicates" "Class predicate words"
"With a handful of exceptions, each class has a membership predicate word, named " { $snippet { $emphasis "class" } "?" } ". A quotation calling this predicate is stored in the " { $snippet "\"predicate\"" } " word property."

View File

@ -1,7 +1,7 @@
USING: assocs classes classes.private compiler.units definitions
eval generic io.streams.string kernel math multiline namespaces
parser sequences sets sorting tools.test vocabs words ;
IN: classes.tests
in: classes.tests
{ t } [ 3 object instance? ] unit-test
{ t } [ 3 fixnum instance? ] unit-test
@ -26,7 +26,7 @@ M: method-forget-class method-forget-test ;
] unit-test
! Long-standing problem
USE: multiline
use: multiline
! So the user has some code...
{ } [

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs combinators definitions graphs kernel
make namespaces quotations sequences sets words words.symbol ;
IN: classes
in: classes
ERROR: bad-inheritance class superclass ;
@ -16,12 +16,12 @@ INSTANCE: defining-class classoid
<PRIVATE
SYMBOL: class<=-cache
SYMBOL: class-not-cache
SYMBOL: classes-intersect-cache
SYMBOL: class-and-cache
SYMBOL: class-or-cache
SYMBOL: next-method-quot-cache
symbol: class<=-cache
symbol: class-not-cache
symbol: classes-intersect-cache
symbol: class-and-cache
symbol: class-or-cache
symbol: next-method-quot-cache
: init-caches ( -- )
H{ } clone class<=-cache namespaces:set
@ -39,9 +39,9 @@ SYMBOL: next-method-quot-cache
class-or-cache get clear-assoc
next-method-quot-cache get clear-assoc ;
SYMBOL: update-map
symbol: update-map
SYMBOL: implementors-map
symbol: implementors-map
GENERIC: class-name ( class -- string )

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors classes classes.error classes.tuple
compiler.units effects eval generic kernel tools.test words ;
IN: classes.error.tests
in: classes.error.tests
! Test error classes
ERROR: error-class-test a b c ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors classes.private classes.tuple
classes.tuple.private combinators kernel parser sequences words ;
IN: classes.error
in: classes.error
PREDICATE: error-class < tuple-class
"error-class" word-prop ;

View File

@ -1,7 +1,7 @@
USING: generic help.markup help.syntax kernel kernel.private
namespaces sequences words arrays help effects math
layouts classes.private classes compiler.units ;
IN: classes.intersection
in: classes.intersection
ARTICLE: "intersections" "Intersection classes"
"An object is an instance of a intersection class if it is an instance of all of its participants."

View File

@ -1,5 +1,5 @@
USING: accessors generic kernel math math.order slots tools.test ;
IN: classes.intersection.tests
in: classes.intersection.tests
TUPLE: a ;
TUPLE: a1 < a ; TUPLE: a2 < a ; TUPLE: a3 < a2 ;

View File

@ -3,7 +3,7 @@
USING: accessors assocs classes classes.algebra
classes.algebra.private classes.builtin classes.private
combinators kernel make sequences words ;
IN: classes.intersection
in: classes.intersection
PREDICATE: intersection-class < class
"metaclass" word-prop intersection-class eq? ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors classes classes.algebra classes.algebra.private
classes.maybe eval generic.single kernel math slots tools.test ;
IN: classes.maybe.tests
in: classes.maybe.tests
{ t } [ 3 maybe{ integer } instance? ] unit-test
{ t } [ f maybe{ integer } instance? ] unit-test

View File

@ -3,7 +3,7 @@
USING: accessors arrays classes classes.algebra
classes.algebra.private classes.private classes.union.private
kernel words ;
IN: classes.maybe
in: classes.maybe
TUPLE: maybe { class classoid initial: object read-only } ;

View File

@ -1,6 +1,6 @@
USING: help.markup help.syntax help words compiler.units
classes sequences ;
IN: classes.mixin
in: classes.mixin
ARTICLE: "mixins" "Mixin classes"
"An object is an instance of a union class if it is an instance of one of its members. In this respect, mixin classes are identical to union classes. However, mixin classes have the additional property that they are " { $emphasis "open" } "; new classes can be added to the mixin after the original definition of the mixin."

View File

@ -2,7 +2,7 @@ USING: arrays assocs classes classes.algebra classes.mixin
compiler.units definitions eval hashtables io.streams.string
kernel math parser sequences source-files strings tools.test
vectors words ;
IN: classes.mixin.tests
in: classes.mixin.tests
! Test mixins
MIXIN: sequence-mixin
@ -47,7 +47,7 @@ INSTANCE: integer mx1
[ \ mx1 forget ] with-compilation-unit
USE: io.streams.string
use: io.streams.string
2 [
[ "mixin-forget-test" forget-source ] with-compilation-unit
@ -119,11 +119,11 @@ MIXIN: move-instance-declaration-mixin
{ { string } } [ move-instance-declaration-mixin class-members ] unit-test
MIXIN: silly-mixin
SYMBOL: not-a-class
symbol: not-a-class
[ [ \ not-a-class \ silly-mixin add-mixin-instance ] with-compilation-unit ] must-fail
SYMBOL: not-a-mixin
symbol: not-a-mixin
TUPLE: a-class ;
[ [ \ a-class \ not-a-mixin add-mixin-instance ] with-compilation-unit ] must-fail

View File

@ -4,7 +4,7 @@ USING: accessors assocs classes classes.algebra
classes.algebra.private classes.private classes.union
classes.union.private combinators definitions kernel sequences
words ;
IN: classes.mixin
in: classes.mixin
PREDICATE: mixin-class < union-class "mixin" word-prop ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: classes compiler.units kernel parser vocabs.parser words ;
IN: classes.parser
in: classes.parser
: save-class-location ( class -- )
location remember-class ;

View File

@ -1,7 +1,7 @@
USING: generic help.markup help.syntax kernel kernel.private
namespaces sequences words arrays layouts help effects math
classes.private classes compiler.units ;
IN: classes.predicate
in: classes.predicate
ARTICLE: "predicates" "Predicate classes"
"Predicate classes allow fine-grained control over method dispatch."

View File

@ -1,6 +1,6 @@
USING: accessors assocs classes classes.algebra compiler.units
eval generic.single kernel math strings tools.test words ;
IN: classes.predicate.tests
in: classes.predicate.tests
PREDICATE: negative < integer 0 < ;
PREDICATE: positive < integer 0 > ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: classes classes.algebra classes.algebra.private
classes.private kernel make words ;
IN: classes.predicate
in: classes.predicate
PREDICATE: predicate-class < class
"metaclass" word-prop predicate-class eq? ;

View File

@ -1,5 +1,5 @@
USING: help.markup help.syntax kernel words ;
IN: classes.singleton
in: classes.singleton
ARTICLE: "singletons" "Singleton classes"
"A singleton is a class with only one instance and with no state."

View File

@ -1,5 +1,5 @@
USING: classes.singleton io.streams.string kernel see tools.test ;
IN: classes.singleton.tests
in: classes.singleton.tests
{ } [ SINGLETON: bzzt ] unit-test
{ t } [ bzzt bzzt? ] unit-test
@ -11,7 +11,7 @@ GENERIC: zammo ( obj -- str )
{ t } [ omg singleton-class? ] unit-test
{ "IN: classes.singleton.tests\nSINGLETON: omg\n" } [ [ omg see ] with-string-writer ] unit-test
SINGLETON: word-and-singleton
singleton: word-and-singleton
: word-and-singleton ( -- x ) 3 ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: classes classes.algebra.private classes.predicate
classes.predicate.private kernel sequences words ;
IN: classes.singleton
in: classes.singleton
<PRIVATE

View File

@ -1,4 +1,4 @@
IN: classes.tuple.parser
in: classes.tuple.parser
USING: strings help.markup help.syntax ;
HELP: invalid-slot-name

View File

@ -1,7 +1,7 @@
USING: accessors classes.tuple.parser lexer words classes
sequences math kernel slots tools.test parser compiler.units
arrays classes.tuple eval multiline ;
IN: classes.tuple.parser.tests
in: classes.tuple.parser.tests
TUPLE: test-1 ;

View File

@ -3,7 +3,7 @@
USING: accessors arrays assocs classes.parser classes.tuple
combinators kernel lexer make parser parser.notes sequences
sets slots ;
IN: classes.tuple.parser
in: classes.tuple.parser
: slot-names ( slots -- seq )
[ dup array? [ first ] when ] map ;

View File

@ -1,7 +1,7 @@
USING: arrays assocs classes classes.tuple.private
compiler.units growable help.markup help.syntax kernel math
sbufs sequences slots strings vectors words ;
IN: classes.tuple
in: classes.tuple
ARTICLE: "slot-read-only-declaration" "Read-only slots"
"By default, all slots are writable. If a slot is explicitly declared " { $link read-only } ", then no writer method is generated for the slot, and the only way to set it to a value other than its initial value is to construct an instance of the tuple with " { $link boa } ", passing the initial value for the read-only slot on the stack; the common idiom of calling " { $link new } " and then immediately filling in slot values with setter words will not work with read-only slots." ;

View File

@ -6,7 +6,7 @@ kernel.private literals math math.constants memory namespaces
parser parser.notes see sequences sequences.private slots
splitting strings threads tools.test vectors vocabs words
words.symbol ;
IN: classes.tuple.tests
in: classes.tuple.tests
TUPLE: rect x y w h ;
: <rect> ( x y w h -- rect ) rect boa ;
@ -191,7 +191,7 @@ M: vector silly "z" ;
{ "zz" } [ 123 <reversed> silly nip ] unit-test
! Typo
SYMBOL: not-a-tuple-class
symbol: not-a-tuple-class
! Missing check
[ not-a-tuple-class boa ] must-fail

View File

@ -5,7 +5,7 @@ classes.algebra.private classes.builtin classes.private
combinators definitions effects generic kernel kernel.private
make math math.private memory namespaces quotations
sequences sequences.private slots slots.private strings words ;
IN: classes.tuple
in: classes.tuple
<PRIVATE
PRIMITIVE: <tuple> ( layout -- tuple )
@ -211,7 +211,7 @@ M: object final-class? drop f ;
: apply-slot-permutation ( old-values triples -- new-values )
[ first3 update-slot ] with map ;
SYMBOL: outdated-tuples
symbol: outdated-tuples
: permute-slots ( old-values layout -- new-values )
[ first all-slots ] [ outdated-tuples get at ] bi

View File

@ -1,7 +1,7 @@
USING: generic help.markup help.syntax kernel kernel.private
namespaces sequences words arrays help effects math
classes.private classes compiler.units ;
IN: classes.union
in: classes.union
ARTICLE: "unions" "Union classes"
"An object is an instance of a union class if it is an instance of one of its members."

View File

@ -2,7 +2,7 @@ USING: accessors alien assocs classes classes.algebra
classes.predicate classes.union classes.union.private
compiler.units eval io.streams.string kernel math math.private
parser quotations see sequences slots strings tools.test words ;
IN: classes.union.tests
in: classes.union.tests
! DEFER: bah
! FORGET: bah
@ -134,7 +134,7 @@ PREDICATE: numba-ova-10 < union{ float integer }
[ "IN: issue-420 UNION: omg omg ;" eval( -- ) ]
[ error>> cannot-reference-self? ] must-fail-with
IN: issue-420
in: issue-420
UNION: a ;
UNION: b a ;

View File

@ -4,7 +4,7 @@ USING: accessors assocs classes classes.algebra
classes.algebra.private classes.builtin classes.private
combinators definitions kernel kernel.private math math.private
quotations sequences sets words ;
IN: classes.union
in: classes.union
PREDICATE: union-class < class
"metaclass" word-prop union-class eq? ;

View File

@ -2,7 +2,7 @@ USING: arrays help.markup help.syntax strings sbufs vectors
kernel quotations generic generic.standard classes
math assocs sequences sequences.private combinators.private
effects words ;
IN: combinators
in: combinators
ARTICLE: "cleave-combinators" "Cleave combinators"
"The cleave combinators apply multiple quotations to a single value or set of values."

View File

@ -1,7 +1,7 @@
USING: accessors arrays combinators combinators.private io
kernel math math.functions prettyprint sequences stack-checker
tools.test words ;
IN: combinators.tests
in: combinators.tests
{ 3 } [ 1 2 [ + ] call( x y -- z ) ] unit-test
[ 1 2 [ + ] call( -- z ) ] must-fail

View File

@ -3,7 +3,7 @@
USING: accessors arrays assocs hashtables kernel kernel.private
make math math.order math.private quotations sequences
sequences.private sets sorting words ;
IN: combinators
in: combinators
! Most of these combinators have compile-time expansions in
! the optimizing compiler. See stack-checker.transforms and

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax io.streams.string quotations
math kernel ;
IN: combinators.short-circuit
in: combinators.short-circuit
HELP: 0&&
{ $values { "quots" "a sequence of quotations with stack effect " { $snippet "( -- ? )" } } { "?" "the result of the last quotation, or " { $link f } } }

View File

@ -1,6 +1,6 @@
USING: accessors combinators.short-circuit kernel math
tools.test ;
IN: combinators.short-circuit.tests
in: combinators.short-circuit.tests
{ 3 } [ { [ 1 ] [ 2 ] [ 3 ] } 0&& ] unit-test
{ 5 } [ 3 { [ 0 > ] [ odd? ] [ 2 + ] } 1&& ] unit-test

View File

@ -1,6 +1,6 @@
USING: arrays combinators fry generalizations kernel macros
math sequences ;
IN: combinators.short-circuit
in: combinators.short-circuit
<PRIVATE

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax io.streams.string quotations ;
IN: combinators.short-circuit.smart
in: combinators.short-circuit.smart
HELP: &&
{ $values

View File

@ -1,6 +1,6 @@
USING: kernel sequences math stack-checker effects accessors
macros fry combinators.short-circuit ;
IN: combinators.short-circuit.smart
in: combinators.short-circuit.smart
<PRIVATE

View File

@ -1,6 +1,6 @@
USING: help.markup help.syntax parser vocabs.loader strings
vocabs ;
IN: command-line
in: command-line
HELP: run-bootstrap-init
{ $description "Runs the bootstrap initialization file in the user's home directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-boot-rc" } "." } ;

View File

@ -4,10 +4,10 @@ USING: accessors alien.strings assocs continuations fry init
io.encodings.utf8 io.files io.pathnames kernel kernel.private
namespaces parser parser.notes sequences source-files
source-files.errors splitting system vocabs.loader ;
IN: command-line
in: command-line
SYMBOL: user-init-errors
SYMBOL: +user-init-error+
symbol: user-init-errors
symbol: +user-init-error+
TUPLE: user-init-error error path line# asset ;
@ -18,9 +18,9 @@ M: user-init-error error-file path>> ;
M: user-init-error error-line line#>> ;
M: user-init-error error-type drop +user-init-error+ ;
SYMBOL: executable
SYMBOL: script
SYMBOL: command-line
symbol: executable
symbol: script
symbol: command-line
: (command-line) ( -- args )
OBJ-ARGS special-object sift [ alien>native-string ] map ;
@ -84,7 +84,7 @@ SYMBOL: command-line
unclip executable set
(parse-command-line) ;
SYMBOL: main-vocab-hook
symbol: main-vocab-hook
: main-vocab ( -- vocab )
embedded? [

View File

@ -1,6 +1,6 @@
USING: accessors debugger io kernel make math.parser
prettyprint command-line summary ;
IN: command-line.debugger
in: command-line.debugger
M: user-init-error error.
error>> error. ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: command-line eval io io.pathnames kernel namespaces
sequences system vocabs.loader ;
IN: command-line.startup
in: command-line.startup
: cli-usage ( -- )
"Usage: " write vm-path file-name write " [Factor arguments] [script] [script arguments]

View File

@ -1,4 +1,4 @@
IN: compiler.errors
in: compiler.errors
USING: help.markup help.syntax vocabs.loader words io
quotations words.symbol ;

View File

@ -2,10 +2,10 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs command-line fry kernel namespaces
source-files.errors summary ;
IN: compiler.errors
in: compiler.errors
SYMBOL: +compiler-error+
SYMBOL: compiler-errors
symbol: +compiler-error+
symbol: compiler-errors
compiler-errors [ H{ } clone ] initialize
@ -13,8 +13,8 @@ TUPLE: compiler-error < source-file-error ;
M: compiler-error error-type drop +compiler-error+ ;
SYMBOL: +linkage-error+
SYMBOL: linkage-errors
symbol: +linkage-error+
symbol: linkage-errors
linkage-errors [ H{ } clone ] initialize

View File

@ -1,7 +1,7 @@
USING: compiler.units.private definitions help.markup help.syntax kernel
kernel.private parser quotations sequences source-files stack-checker.errors
words ;
IN: compiler.units
in: compiler.units
ARTICLE: "compilation-units-internals" "Compilation units internals"
"These words do not need to be called directly, and only serve to support the implementation."

View File

@ -1,6 +1,6 @@
USING: arrays compiler compiler.units definitions eval fry
kernel math namespaces quotations sequences tools.test words ;
IN: compiler.units.tests
in: compiler.units.tests
[ [ [ ] define-temp ] with-compilation-unit ] must-infer
[ [ [ ] define-temp ] with-nested-compilation-unit ] must-infer
@ -30,11 +30,11 @@ IN: compiler.units.tests
] unit-test
! Check that we notify observers
SINGLETON: observer
singleton: observer
observer add-definition-observer
SYMBOL: counter
symbol: counter
0 counter set-global

View File

@ -4,12 +4,12 @@ USING: accessors arrays assocs classes classes.private
classes.tuple.private continuations definitions generic
hash-sets init kernel kernel.private math namespaces sequences
sets source-files.errors vocabs words ;
IN: compiler.units
in: compiler.units
PRIMITIVE: modify-code-heap ( alist update-existing? reset-pics? -- )
SYMBOL: old-definitions
SYMBOL: new-definitions
symbol: old-definitions
symbol: new-definitions
TUPLE: redefine-error def ;
@ -42,7 +42,7 @@ PRIVATE>
new-definitions get [ in? ] with any? not
] [ drop f ] if ;
SYMBOL: compiler-impl
symbol: compiler-impl
HOOK: update-call-sites compiler-impl ( class generic -- words )
@ -84,7 +84,7 @@ M: f process-forgotten-words drop ;
: <definitions> ( -- pair ) { HS{ } HS{ } } [ clone ] map ;
SYMBOL: definition-observers
symbol: definition-observers
GENERIC: definitions-changed ( set obj -- )

View File

@ -1,6 +1,6 @@
USING: continuations.private help.markup help.syntax kernel
kernel.private lexer namespaces quotations sequences vectors ;
IN: continuations
in: continuations
ARTICLE: "errors-restartable" "Restartable errors"
"Support for restartable errors is built on top of the basic error handling facility. The following words signals recoverable errors:"

View File

@ -1,7 +1,7 @@
USING: accessors continuations debugger eval io kernel
kernel.private math memory namespaces sequences tools.test
vectors words ;
IN: continuations.tests
in: continuations.tests
: (callcc1-test) ( n obj -- n' obj )
[ 1 - dup ] dip ?push
@ -62,8 +62,8 @@ IN: continuations.tests
{ 1 } [ "c" get innermost-frame-scan ] unit-test
SYMBOL: always-counter
SYMBOL: error-counter
symbol: always-counter
symbol: error-counter
H{
{ always-counter 0 }

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs combinators combinators.private kernel
kernel.private make namespaces sequences vectors ;
IN: continuations
in: continuations
: with-datastack ( stack quot -- new-stack )
[
@ -11,11 +11,11 @@ IN: continuations
swap [ set-datastack ] dip
] ( stack quot -- new-stack ) call-effect-unsafe ;
SYMBOL: original-error
SYMBOL: error
SYMBOL: error-continuation
SYMBOL: error-thread
SYMBOL: restarts
symbol: original-error
symbol: error
symbol: error-continuation
symbol: error-thread
symbol: restarts
<PRIVATE
@ -97,7 +97,7 @@ PRIVATE>
: continue ( continuation -- * )
f swap continue-with ;
SYMBOL: return-continuation
symbol: return-continuation
: with-return ( quot -- )
[ return-continuation ] dip [ with-variable ] 2curry callcc0 ; inline
@ -117,14 +117,14 @@ PRIVATE>
GENERIC: error-in-thread ( error thread -- * )
SYMBOL: thread-error-hook ! ( error thread -- * )
symbol: thread-error-hook ! ( error thread -- * )
M: object error-in-thread
thread-error-hook get-global call( error thread -- * ) ;
: in-callback? ( -- ? ) CONTEXT-OBJ-IN-CALLBACK-P context-object ;
SYMBOL: callback-error-hook ! ( error -- * )
symbol: callback-error-hook ! ( error -- * )
: rethrow ( error -- * )
dup save-error

View File

@ -2,7 +2,7 @@ USING: alien assocs classes compiler.cfg.instructions
compiler.cfg.registers compiler.cfg.stack-frame cpu.x86.assembler
cpu.x86.assembler.operands help.markup help.syntax kernel layouts
literals math multiline sequences strings system vm words ;
IN: cpu.architecture
in: cpu.architecture
<<
STRING: ex-%allot

View File

@ -1,7 +1,7 @@
USING: accessors compiler.cfg compiler.cfg.instructions
compiler.cfg.stack-frame compiler.cfg.utilities cpu.architecture
cpu.x86 kernel layouts math namespaces system tools.test ;
IN: cpu.architecture.tests
in: cpu.architecture.tests
: cfg-w-spill-area-base ( base -- cfg )
stack-frame new swap >>spill-area-base

View File

@ -4,13 +4,13 @@ USING: accessors arrays assocs generic kernel kernel.private
math math.order memory namespaces make sequences layouts system
hashtables classes alien byte-arrays combinators words sets fry
;
IN: cpu.architecture
in: cpu.architecture
! Representations -- these are like low-level types
! Unknown representation; this is used for ##copy instructions which
! get eliminated later
SINGLETON: any-rep
singleton: any-rep
! Integer registers can contain data with one of these three representations
! tagged-rep: tagged pointer or fixnum

View File

@ -1,6 +1,6 @@
USING: generic hash-sets help.markup help.syntax words math source-files
parser quotations compiler.units ;
IN: definitions
in: definitions
ARTICLE: "definition-protocol" "Definition protocol"
"A common protocol is used to build generic tools for working with all definitions."

View File

@ -1,18 +1,18 @@
USING: arrays bit-arrays byte-arrays compiler.units definitions
tools.test ;
IN: definitions.tests
in: definitions.tests
GENERIC: some-generic ( a -- b )
USE: arrays
use: arrays
M: array some-generic ;
USE: bit-arrays
use: bit-arrays
M: bit-array some-generic ;
USE: byte-arrays
use: byte-arrays
M: byte-array some-generic ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2006, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs kernel namespaces sequences sets ;
IN: definitions
in: definitions
MIXIN: definition-mixin
@ -10,21 +10,21 @@ ERROR: no-compilation-unit definition ;
: add-to-unit ( key set -- )
[ adjoin ] [ no-compilation-unit ] if* ;
SYMBOL: changed-definitions
symbol: changed-definitions
: changed-definition ( defspec -- )
changed-definitions get add-to-unit ;
SYMBOL: maybe-changed
symbol: maybe-changed
: changed-conditionally ( class -- )
maybe-changed get add-to-unit ;
SYMBOL: changed-effects
symbol: changed-effects
SYMBOL: outdated-generics
symbol: outdated-generics
SYMBOL: new-words
symbol: new-words
: new-word ( word -- )
new-words get add-to-unit ;
@ -37,7 +37,7 @@ GENERIC: set-where ( loc defspec -- )
GENERIC: forget* ( defspec -- )
SYMBOL: forgotten-definitions
symbol: forgotten-definitions
: forgotten-definition ( defspec -- )
forgotten-definitions get add-to-unit ;

View File

@ -1,5 +1,5 @@
USING: help.syntax help.markup delegate.private ;
IN: delegate
in: delegate
HELP: define-protocol
{ $values { "protocol" "a word for the new protocol" } { "wordlist" "a sequence of words" } }

View File

@ -2,7 +2,7 @@ USING: delegate kernel arrays tools.test words math definitions
compiler.units parser generic prettyprint io.streams.string
accessors eval multiline generic.single delegate.protocols
delegate.private assocs see make ;
IN: delegate.tests
in: delegate.tests
TUPLE: hello this that ;
C: <hello> hello

View File

@ -5,7 +5,7 @@ USING: accessors arrays assocs classes.tuple definitions effects generic
generic.standard hashtables kernel lexer math parser
generic.parser sequences sets slots words words.symbol fry
compiler.units make ;
IN: delegate
in: delegate
ERROR: broadcast-words-must-have-no-outputs group ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: assocs delegate io sequences sequences.private sets ;
IN: delegate.protocols
in: delegate.protocols
PROTOCOL: sequence-protocol
like new-sequence new-resizable nth nth-unsafe

View File

@ -1,5 +1,5 @@
USING: classes help.markup help.syntax io quotations sequences ;
IN: destructors
in: destructors
HELP: debug-leaks?
{ $var-description "When this variable is on, " { $link new-disposable } " stores the current continuation in the " { $link disposable } "'s " { $slot "continuation" } " slot." }

View File

@ -1,6 +1,6 @@
USING: accessors continuations destructors destructors.private
kernel namespaces sequences tools.test ;
IN: destructors.tests
in: destructors.tests
TUPLE: dispose-error ;

View File

@ -2,13 +2,13 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs continuations init kernel namespaces
sequences sets ;
IN: destructors
in: destructors
SYMBOL: disposables
symbol: disposables
ERROR: already-unregistered disposable ;
SYMBOL: debug-leaks?
symbol: debug-leaks?
<PRIVATE
@ -63,9 +63,9 @@ M: disposable dispose
<PRIVATE
SYMBOL: always-destructors
symbol: always-destructors
SYMBOL: error-destructors
symbol: error-destructors
: do-always-destructors ( -- )
always-destructors get <reversed> dispose-each ;

View File

@ -1,6 +1,6 @@
USING: arrays classes help.markup help.syntax kernel math
sequences strings words ;
IN: effects
in: effects
ARTICLE: "effects" "Stack effect declarations"
"Word definition words such as " { $link POSTPONE: : } " and " { $link POSTPONE: GENERIC: } " have a " { $emphasis "stack effect declaration" } " as part of their syntax. A stack effect declaration takes the following form:"

View File

@ -1,6 +1,6 @@
USING: accessors effects effects.parser eval kernel prettyprint
sequences tools.test math ;
IN: effects.tests
in: effects.tests
{ t } [ { "a" } { "a" } <effect> { "a" "b" } { "a" "b" } <effect> effect<= ] unit-test
{ f } [ { "a" } { } <effect> { "a" "b" } { "a" "b" } <effect> effect<= ] unit-test

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