From 44f53de16496395a16862da780792a0fecf10316 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 10 Sep 2008 20:07:00 -0500 Subject: [PATCH] Move make to its own vocabulary, remove fry _ feature --- basis/alien/arrays/arrays.factor | 2 +- basis/alien/c-types/c-types.factor | 2 +- basis/alien/structs/fields/fields.factor | 2 +- basis/bootstrap/image/image.factor | 2 +- basis/cocoa/messages/messages.factor | 11 +++-- basis/cocoa/subclassing/subclassing.factor | 2 +- basis/cocoa/views/views.factor | 2 +- basis/compiler/generator/fixup/fixup.factor | 2 +- basis/compiler/generator/generator.factor | 16 +++---- .../generator/registers/registers.factor | 6 +-- .../tree/cleanup/cleanup-tests.factor | 21 ++++++++++ basis/compiler/tree/debugger/debugger.factor | 2 +- .../tree/finalization/finalization.factor | 2 +- .../core-foundation/fsevents/fsevents.factor | 6 +-- basis/cpu/architecture/architecture.factor | 4 +- .../cpu/x86/architecture/architecture.factor | 2 +- basis/cpu/x86/assembler/assembler.factor | 2 +- basis/debugger/debugger.factor | 12 +++--- basis/debugger/threads/threads.factor | 2 +- basis/delegate/delegate.factor | 2 +- basis/documents/documents.factor | 2 +- basis/fry/fry-docs.factor | 23 ---------- basis/fry/fry-tests.factor | 14 +++---- basis/fry/fry.factor | 42 +++++++------------ basis/furnace/chloe-tags/chloe-tags.factor | 2 +- basis/generalizations/generalizations.factor | 4 +- basis/help/help.factor | 4 +- basis/help/lint/lint.factor | 4 +- basis/help/markup/markup.factor | 2 +- basis/help/topics/topics.factor | 2 +- basis/html/forms/forms.factor | 2 +- basis/http/http.factor | 2 +- basis/interval-maps/interval-maps.factor | 2 +- basis/io/servers/packet/datagram.factor | 2 +- basis/io/unix/backend/backend.factor | 2 +- basis/locals/locals.factor | 17 ++++---- basis/macros/expander/expander.factor | 5 ++- basis/match/match.factor | 4 +- .../partial-dispatch/partial-dispatch.factor | 2 +- basis/memoize/memoize.factor | 2 +- basis/mime-types/mime-types.factor | 4 +- basis/peg/parsers/parsers.factor | 7 ++-- basis/peg/peg.factor | 12 +++--- .../nodes/collision/collision.factor | 2 +- basis/prettyprint/backend/backend.factor | 4 +- basis/prettyprint/prettyprint.factor | 6 +-- basis/prettyprint/sections/sections.factor | 2 +- basis/stack-checker/branches/branches.factor | 4 +- .../transforms/transforms.factor | 2 +- basis/summary/summary.factor | 2 +- basis/tools/deploy/backend/backend.factor | 8 ++-- basis/tools/deploy/macosx/macosx.factor | 2 +- basis/tools/disassembler/disassembler.factor | 6 +-- basis/tools/vocabs/vocabs.factor | 8 ++-- basis/tools/walker/walker.factor | 2 +- basis/ui/commands/commands-docs.factor | 2 +- basis/ui/commands/commands.factor | 4 +- basis/ui/gadgets/editors/editors.factor | 2 +- basis/ui/gadgets/gadgets.factor | 7 ++-- basis/ui/gadgets/grids/grids.factor | 2 +- basis/ui/gadgets/labels/labels.factor | 5 +-- basis/ui/gestures/gestures.factor | 6 +-- basis/ui/operations/operations.factor | 2 +- basis/ui/tools/walker/walker.factor | 2 +- basis/ui/traverse/traverse.factor | 4 +- basis/ui/ui-docs.factor | 7 ---- basis/ui/ui.factor | 2 +- basis/unicode/case/case.factor | 2 +- basis/unicode/normalize/normalize.factor | 2 +- basis/unicode/syntax/syntax.factor | 6 +-- basis/urls/urls.factor | 2 +- core/classes/classes.factor | 4 +- core/classes/predicate/predicate.factor | 4 +- core/classes/tuple/parser/parser.factor | 2 +- core/classes/tuple/tuple.factor | 8 ++-- core/compiler/errors/errors.factor | 2 +- core/continuations/continuations.factor | 2 +- core/destructors/destructors.factor | 2 +- core/effects/effects.factor | 2 +- core/generic/generic.factor | 2 +- core/generic/math/math.factor | 4 +- core/generic/standard/engines/tag/tag.factor | 4 +- .../standard/engines/tuple/tuple.factor | 2 +- core/generic/standard/standard.factor | 2 +- core/io/io.factor | 2 +- core/io/streams/c/c.factor | 2 +- core/math/parser/parser-docs.factor | 2 +- core/math/parser/parser.factor | 4 +- core/namespaces/namespaces-docs.factor | 25 ----------- core/namespaces/namespaces.factor | 31 ++------------ core/slots/slots.factor | 6 +-- core/splitting/splitting.factor | 2 +- core/strings/parser/parser.factor | 2 +- core/vocabs/loader/loader.factor | 4 +- extra/monads/monads.factor | 16 +++---- extra/ui/gadgets/tabs/tabs.factor | 2 +- extra/webapps/wiki/wiki.factor | 9 +--- .../concatenative/concatenative.factor | 16 ++++--- 98 files changed, 227 insertions(+), 305 deletions(-) diff --git a/basis/alien/arrays/arrays.factor b/basis/alien/arrays/arrays.factor index 71c3fd6ff2..94472e8261 100644 --- a/basis/alien/arrays/arrays.factor +++ b/basis/alien/arrays/arrays.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: alien arrays alien.c-types alien.structs -sequences math kernel namespaces libc cpu.architecture ; +sequences math kernel namespaces make libc cpu.architecture ; IN: alien.arrays UNION: value-type array struct-type ; diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index f44941d88f..6a88441be9 100755 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: byte-arrays arrays assocs kernel kernel.private libc math -namespaces parser sequences strings words assocs splitting +namespaces make parser sequences strings words assocs splitting math.parser cpu.architecture alien alien.accessors quotations layouts system compiler.units io.files io.encodings.binary accessors combinators effects continuations ; diff --git a/basis/alien/structs/fields/fields.factor b/basis/alien/structs/fields/fields.factor index 5273c2c7ba..19e5b8c326 100644 --- a/basis/alien/structs/fields/fields.factor +++ b/basis/alien/structs/fields/fields.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays kernel kernel.private math namespaces -sequences strings words effects combinators alien.c-types ; +make sequences strings words effects combinators alien.c-types ; IN: alien.structs.fields TUPLE: field-spec name offset type reader writer ; diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index edfd82dae2..9284728a7a 100755 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -1,7 +1,7 @@ ! 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 +hashtables.private io 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 diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index 7be649416c..7977485b02 100755 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -1,11 +1,10 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors alien alien.c-types alien.strings -arrays assocs combinators compiler kernel -math namespaces parser prettyprint prettyprint.sections -quotations sequences strings words cocoa.runtime io macros -memoize debugger io.encodings.ascii effects compiler.generator -libc libc.private ; +USING: accessors alien alien.c-types alien.strings arrays assocs +combinators compiler kernel math namespaces make parser +prettyprint prettyprint.sections quotations sequences strings +words cocoa.runtime io macros memoize debugger +io.encodings.ascii effects compiler.generator libc libc.private ; IN: cocoa.messages : make-sender ( method function -- quot ) diff --git a/basis/cocoa/subclassing/subclassing.factor b/basis/cocoa/subclassing/subclassing.factor index 1ee39c35d5..3f8e709df0 100755 --- a/basis/cocoa/subclassing/subclassing.factor +++ b/basis/cocoa/subclassing/subclassing.factor @@ -4,7 +4,7 @@ USING: alien alien.c-types alien.strings arrays assocs combinators compiler hashtables kernel libc math namespaces parser sequences words cocoa.messages cocoa.runtime compiler.units io.encodings.ascii generalizations -continuations ; +continuations make ; IN: cocoa.subclassing : init-method ( method -- sel imp types ) diff --git a/basis/cocoa/views/views.factor b/basis/cocoa/views/views.factor index 8bfbe330b2..d03688b2be 100644 --- a/basis/cocoa/views/views.factor +++ b/basis/cocoa/views/views.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2007 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: alien.c-types arrays kernel math namespaces cocoa +USING: alien.c-types arrays kernel math namespaces make cocoa cocoa.messages cocoa.classes cocoa.types sequences continuations ; IN: cocoa.views diff --git a/basis/compiler/generator/fixup/fixup.factor b/basis/compiler/generator/fixup/fixup.factor index 5a3337fb32..ecc88a7a5e 100755 --- a/basis/compiler/generator/fixup/fixup.factor +++ b/basis/compiler/generator/fixup/fixup.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays byte-arrays generic assocs hashtables io.binary -kernel kernel.private math namespaces sequences words +kernel kernel.private math namespaces make sequences words quotations strings alien.accessors alien.strings layouts system combinators math.bitwise words.private cpu.architecture math.order accessors growable ; diff --git a/basis/compiler/generator/generator.factor b/basis/compiler/generator/generator.factor index da120ce432..939d6e2276 100755 --- a/basis/compiler/generator/generator.factor +++ b/basis/compiler/generator/generator.factor @@ -1,15 +1,15 @@ - ! Copyright (C) 2004, 2008 Slava Pestov. +! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs classes combinators cpu.architecture effects generic hashtables io kernel -kernel.private layouts math math.parser namespaces prettyprint -quotations sequences system threads words vectors sets deques -continuations.private summary alien alien.c-types +kernel.private layouts math math.parser namespaces make +prettyprint quotations sequences system threads words vectors +sets deques continuations.private summary alien alien.c-types alien.structs alien.strings alien.arrays libc compiler.errors -stack-checker.inlining -compiler.tree compiler.tree.builder compiler.tree.combinators -compiler.tree.propagation.info compiler.generator.fixup -compiler.generator.registers compiler.generator.iterator ; +stack-checker.inlining compiler.tree compiler.tree.builder +compiler.tree.combinators compiler.tree.propagation.info +compiler.generator.fixup compiler.generator.registers +compiler.generator.iterator ; IN: compiler.generator SYMBOL: compile-queue diff --git a/basis/compiler/generator/registers/registers.factor b/basis/compiler/generator/registers/registers.factor index e909db3f83..76d3c32594 100755 --- a/basis/compiler/generator/registers/registers.factor +++ b/basis/compiler/generator/registers/registers.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs classes classes.private classes.algebra -combinators hashtables kernel layouts math namespaces quotations -sequences system vectors words effects alien byte-arrays -accessors sets math.order cpu.architecture +combinators hashtables kernel layouts math namespaces make +quotations sequences system vectors words effects alien +byte-arrays accessors sets math.order cpu.architecture compiler.generator.fixup ; IN: compiler.generator.registers diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index bb30cda685..644b834117 100644 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -457,3 +457,24 @@ cell-bits 32 = [ [ [ >r "A" throw r> ] [ "B" throw ] if ] cleaned-up-tree drop ] unit-test + +! Regression from benchmark.nsieve +: chicken-fingers ( i seq -- ) + 2dup < [ + 2drop + ] [ + chicken-fingers + ] if ; inline recursive + +: buffalo-wings ( i seq -- ) + 2dup < [ + 2dup chicken-fingers + >r 1+ r> buffalo-wings + ] [ + 2drop + ] if ; inline recursive + +[ t ] [ + [ 2 swap >fixnum buffalo-wings ] + { <-integer-fixnum +-integer-fixnum } inlined? +] unit-test diff --git a/basis/compiler/tree/debugger/debugger.factor b/basis/compiler/tree/debugger/debugger.factor index db742197a5..01b91b1613 100644 --- a/basis/compiler/tree/debugger/debugger.factor +++ b/basis/compiler/tree/debugger/debugger.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel assocs fry match accessors namespaces effects +USING: kernel assocs fry match accessors namespaces make effects sequences sequences.private quotations generic macros arrays prettyprint prettyprint.backend prettyprint.sections math words combinators io sorting hints diff --git a/basis/compiler/tree/finalization/finalization.factor b/basis/compiler/tree/finalization/finalization.factor index 5aaeed360a..540119f709 100644 --- a/basis/compiler/tree/finalization/finalization.factor +++ b/basis/compiler/tree/finalization/finalization.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel arrays accessors sequences sequences.private words -fry namespaces math math.order memoize classes.builtin +fry namespaces make math math.order memoize classes.builtin classes.tuple.private slots.private combinators layouts byte-arrays alien.accessors compiler.intrinsics diff --git a/basis/core-foundation/fsevents/fsevents.factor b/basis/core-foundation/fsevents/fsevents.factor index f14dba6433..bb21391f0a 100644 --- a/basis/core-foundation/fsevents/fsevents.factor +++ b/basis/core-foundation/fsevents/fsevents.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.strings alien.syntax kernel -math sequences namespaces assocs init accessors continuations -combinators core-foundation core-foundation.run-loop -io.encodings.utf8 destructors ; +math sequences namespaces make assocs init accessors +continuations combinators core-foundation +core-foundation.run-loop io.encodings.utf8 destructors ; IN: core-foundation.fsevents ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! diff --git a/basis/cpu/architecture/architecture.factor b/basis/cpu/architecture/architecture.factor index fc11e0a731..432e748cbf 100755 --- a/basis/cpu/architecture/architecture.factor +++ b/basis/cpu/architecture/architecture.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays generic kernel kernel.private math memory -namespaces sequences layouts system hashtables classes alien -byte-arrays combinators words sets ; +namespaces make sequences layouts system hashtables classes +alien byte-arrays combinators words sets ; IN: cpu.architecture ! Register classes diff --git a/basis/cpu/x86/architecture/architecture.factor b/basis/cpu/x86/architecture/architecture.factor index 69bc685364..13524aecc4 100755 --- a/basis/cpu/x86/architecture/architecture.factor +++ b/basis/cpu/x86/architecture/architecture.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien alien.c-types arrays cpu.x86.assembler cpu.x86.assembler.private cpu.architecture kernel kernel.private -math memory namespaces sequences words compiler.generator +math memory namespaces make sequences words compiler.generator compiler.generator.registers compiler.generator.fixup system layouts combinators compiler.constants math.order ; IN: cpu.x86.architecture diff --git a/basis/cpu/x86/assembler/assembler.factor b/basis/cpu/x86/assembler/assembler.factor index d9c25d8492..f557bb4adc 100755 --- a/basis/cpu/x86/assembler/assembler.factor +++ b/basis/cpu/x86/assembler/assembler.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays compiler.generator.fixup io.binary kernel -combinators kernel.private math namespaces sequences +combinators kernel.private math namespaces make sequences words system layouts math.order accessors cpu.x86.assembler.syntax ; IN: cpu.x86.assembler diff --git a/basis/debugger/debugger.factor b/basis/debugger/debugger.factor index 4d01567131..b7fd34c5be 100755 --- a/basis/debugger/debugger.factor +++ b/basis/debugger/debugger.factor @@ -1,12 +1,12 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: slots arrays definitions generic hashtables summary io -kernel math namespaces prettyprint prettyprint.config sequences -assocs sequences.private strings io.styles io.files vectors -words system splitting math.parser classes.tuple continuations -continuations.private combinators generic.math classes.builtin -classes compiler.units generic.standard vocabs init -kernel.private io.encodings accessors math.order +kernel math namespaces make prettyprint prettyprint.config +sequences assocs sequences.private strings io.styles io.files +vectors words system splitting math.parser 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 ; diff --git a/basis/debugger/threads/threads.factor b/basis/debugger/threads/threads.factor index 7bb240859e..27ffdc629b 100644 --- a/basis/debugger/threads/threads.factor +++ b/basis/debugger/threads/threads.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors debugger continuations threads threads.private -io io.styles prettyprint kernel math.parser namespaces ; +io io.styles prettyprint kernel math.parser namespaces make ; IN: debugger.threads : error-in-thread. ( thread -- ) diff --git a/basis/delegate/delegate.factor b/basis/delegate/delegate.factor index fd9b9977e1..45cc214792 100755 --- a/basis/delegate/delegate.factor +++ b/basis/delegate/delegate.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors parser generic kernel classes classes.tuple words slots assocs sequences arrays vectors definitions -prettyprint math hashtables sets macros namespaces ; +prettyprint math hashtables sets macros namespaces make ; IN: delegate : protocol-words ( protocol -- words ) diff --git a/basis/documents/documents.factor b/basis/documents/documents.factor index cac7574e35..54bc85284a 100755 --- a/basis/documents/documents.factor +++ b/basis/documents/documents.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2007 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays io kernel math models namespaces +USING: accessors arrays io kernel math models namespaces make sequences strings splitting combinators unicode.categories math.order ; IN: documents diff --git a/basis/fry/fry-docs.factor b/basis/fry/fry-docs.factor index 05cde62c1f..4f33a6892a 100755 --- a/basis/fry/fry-docs.factor +++ b/basis/fry/fry-docs.factor @@ -7,9 +7,6 @@ HELP: , HELP: @ { $description "Fry specifier. Splices a quotation into the fried quotation." } ; -HELP: _ -{ $description "Fry specifier. Shifts all fry specifiers to the left down by one stack position." } ; - HELP: fry { $values { "quot" quotation } { "quot'" quotation } } { $description "Outputs a quotation that when called, fries " { $snippet "quot" } " by taking values from the stack and substituting them in." } @@ -52,25 +49,11 @@ $nl "{ 8 13 14 27 } [ even? ] 5 [ dup ] swap [ ? ] curry 3compose map" "{ 8 13 14 27 } [ even? dup 5 ? ] map" } -"Occurrences of " { $link _ } " have the effect of enclosing all code to their left in a quotation passed to " { $link dip } ". The following four lines are equivalent:" -{ $code - "{ 10 20 30 } 1 '[ , _ / ] map" - "{ 10 20 30 } 1 [ [ ] curry dip / ] curry map" - "{ 10 20 30 } 1 [ swap / ] curry map" - "{ 10 20 30 } [ 1 swap / ] map" -} -"For any quotation body " { $snippet "X" } ", the following two are equivalent:" -{ $code - "[ [ X ] dip ]" - "'[ X _ ]" -} "Here are some built-in combinators rewritten in terms of fried quotations:" { $table { { $link literalize } { $snippet ": literalize '[ , ] ;" } } { { $link slip } { $snippet ": slip '[ @ , ] call ;" } } - { { $link dip } { $snippet ": dip '[ @ _ ] call ;" } } { { $link curry } { $snippet ": curry '[ , @ ] ;" } } - { { $link with } { $snippet ": with swapd '[ , _ @ ] ;" } } { { $link compose } { $snippet ": compose '[ @ @ ] ;" } } { { $link bi@ } { $snippet ": bi@ tuck '[ , @ , @ ] call ;" } } } ; @@ -85,11 +68,6 @@ ARTICLE: "fry.philosophy" "Fried quotation philosophy" { $code "'[ 3 , + 4 , / ]" "[let | a [ ] b [ ] | [ 3 a + 4 b / ] ]" -} -"The " { $link _ } " fry specifier has no direct analogue in " { $vocab-link "locals" } ", however closure conversion together with the " { $link dip } " combinator achieve the same effect:" -{ $code - "'[ , 2 + , * _ / ]" - "[let | a [ ] b [ ] | [ [ a 2 + b * ] dip / ] ]" } ; ARTICLE: "fry.limitations" "Fried quotation limitations" @@ -103,7 +81,6 @@ $nl "Fried quotations contain zero or more " { $emphasis "fry specifiers" } ":" { $subsection , } { $subsection @ } -{ $subsection _ } "When a fried quotation is being evaluated, values are consumed from the stack and spliced into the quotation from right to left." { $subsection "fry.examples" } { $subsection "fry.philosophy" } diff --git a/basis/fry/fry-tests.factor b/basis/fry/fry-tests.factor index 6d6abba23c..b8cdbc8cd7 100755 --- a/basis/fry/fry-tests.factor +++ b/basis/fry/fry-tests.factor @@ -19,29 +19,25 @@ sequences ; [ [ + ] [ - ] '[ 1 2 @ 3 4 @ ] ] unit-test [ 1/2 ] [ - 1 '[ , _ / ] 2 swap call + 1 '[ [ , ] dip / ] 2 swap call ] unit-test [ { { 1 "a" "A" } { 1 "b" "B" } { 1 "c" "C" } } ] [ - 1 '[ , _ _ 3array ] + 1 '[ [ , ] 2dip 3array ] { "a" "b" "c" } { "A" "B" "C" } rot 2map ] unit-test [ { { 1 "a" } { 1 "b" } { 1 "c" } } ] [ - '[ 1 _ 2array ] + '[ [ 1 ] dip 2array ] { "a" "b" "c" } swap map ] unit-test -[ 1 2 ] [ - 1 2 '[ _ , ] call -] unit-test - [ { { 1 "a" 2 } { 1 "b" 2 } { 1 "c" 2 } } ] [ - 1 2 '[ , _ , 3array ] + 1 2 '[ [ , ] dip , 3array ] { "a" "b" "c" } swap map ] unit-test -: funny-dip '[ @ _ ] call ; inline +: funny-dip '[ [ @ ] dip ] call ; inline [ "hi" 3 ] [ "h" "i" 3 [ append ] funny-dip ] unit-test diff --git a/basis/fry/fry.factor b/basis/fry/fry.factor index 2b84d58d06..af7da07d27 100755 --- a/basis/fry/fry.factor +++ b/basis/fry/fry.factor @@ -1,13 +1,14 @@ ! Copyright (C) 2008 Slava Pestov, Eduardo Cavazos. ! See http://factorcode.org/license.txt for BSD license. USING: kernel sequences combinators parser splitting math -quotations arrays namespaces qualified ; -QUALIFIED: namespaces +quotations arrays make qualified words ; +QUALIFIED: make IN: fry : , ( -- * ) "Only valid inside a fry" throw ; : @ ( -- * ) "Only valid inside a fry" throw ; -: _ ( -- * ) "Only valid inside a fry" throw ; + +r suffix r> (shallow-fry) ] } case @@ -35,32 +34,23 @@ DEFER: shallow-fry : shallow-fry ( quot -- quot' ) [ ] swap (shallow-fry) ; -: deep-fry ( quot -- quot ) - { _ } last-split1 dup [ - shallow-fry [ >r ] rot - deep-fry [ [ dip ] curry r> compose ] 4array concat - ] [ - drop shallow-fry - ] if ; +PREDICATE: fry-specifier < word { , make:, @ } memq? ; -: fry-specifier? ( obj -- ? ) { , namespaces:, @ } member? ; +GENERIC: count-inputs ( quot -- n ) + +M: callable count-inputs [ count-inputs ] sigma ; +M: fry-specifier count-inputs drop 1 ; +M: object count-inputs drop 0 ; + +PRIVATE> -: count-inputs ( quot -- n ) - [ - { - { [ dup callable? ] [ count-inputs ] } - { [ dup fry-specifier? ] [ drop 1 ] } - [ drop 0 ] - } cond - ] map sum ; - : fry ( quot -- quot' ) [ [ dup callable? [ [ count-inputs \ , % ] [ fry % ] bi - ] [ namespaces:, ] if + ] [ make:, ] if ] each - ] [ ] make deep-fry ; + ] [ ] make shallow-fry ; : '[ \ ] parse-until fry over push-all ; parsing diff --git a/basis/furnace/chloe-tags/chloe-tags.factor b/basis/furnace/chloe-tags/chloe-tags.factor index 8822bca519..e4286e3bdf 100644 --- a/basis/furnace/chloe-tags/chloe-tags.factor +++ b/basis/furnace/chloe-tags/chloe-tags.factor @@ -56,7 +56,7 @@ CHLOE: write-atom drop [ write-atom-feeds ] [code] ; : compile-link-attrs ( tag -- ) #! Side-effects current namespace. - attrs>> '[ [ , _ link-attr ] each-responder ] [code] ; + attrs>> '[ [ [ , ] dip link-attr ] each-responder ] [code] ; : a-start-tag ( tag -- ) [ compile-link-attrs ] [ compile-a-url ] bi diff --git a/basis/generalizations/generalizations.factor b/basis/generalizations/generalizations.factor index c97e9c7b91..a3c86b6683 100755 --- a/basis/generalizations/generalizations.factor +++ b/basis/generalizations/generalizations.factor @@ -14,8 +14,8 @@ MACRO: narray ( n -- quot ) MACRO: firstn ( n -- ) dup zero? [ drop [ drop ] ] [ - [ [ '[ , _ nth-unsafe ] ] map ] - [ 1- '[ , _ bounds-check 2drop ] ] + [ [ '[ [ , ] dip nth-unsafe ] ] map ] + [ 1- '[ [ , ] dip bounds-check 2drop ] ] bi prefix '[ , cleave ] ] if ; diff --git a/basis/help/help.factor b/basis/help/help.factor index b2fff22372..686578f1b6 100755 --- a/basis/help/help.factor +++ b/basis/help/help.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays io io.styles kernel namespaces parser -prettyprint sequences words assocs definitions generic +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 ; diff --git a/basis/help/lint/lint.factor b/basis/help/lint/lint.factor index 4ad9067457..facaa8a010 100755 --- a/basis/help/lint/lint.factor +++ b/basis/help/lint/lint.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: fry accessors sequences parser kernel help help.markup -help.topics words strings classes tools.vocabs namespaces io -io.streams.string prettyprint definitions arrays vectors +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 ; diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index 3077a93ed4..b5e074b598 100755 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays definitions generic io kernel assocs -hashtables namespaces parser prettyprint sequences strings +hashtables namespaces make parser prettyprint sequences strings io.styles vectors words math sorting splitting classes slots vocabs help.stylesheet help.topics vocabs.loader alias ; IN: help.markup diff --git a/basis/help/topics/topics.factor b/basis/help/topics/topics.factor index cdb32b18ee..e6b19d5baa 100755 --- a/basis/help/topics/topics.factor +++ b/basis/help/topics/topics.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license.x USING: accessors arrays definitions generic assocs -io kernel namespaces prettyprint prettyprint.sections +io kernel namespaces make prettyprint prettyprint.sections sequences words summary classes strings vocabs ; IN: help.topics diff --git a/basis/html/forms/forms.factor b/basis/html/forms/forms.factor index 911e545f87..34d6a4dcb2 100644 --- a/basis/html/forms/forms.factor +++ b/basis/html/forms/forms.factor @@ -103,4 +103,4 @@ C: validation-error swap set-value ; : validate-values ( assoc validators -- assoc' ) - swap '[ dup , at _ validate-value ] assoc-each ; + swap '[ [ dup , at ] dip validate-value ] assoc-each ; diff --git a/basis/http/http.factor b/basis/http/http.factor index 03cca05ff3..d03d6c2203 100755 --- a/basis/http/http.factor +++ b/basis/http/http.factor @@ -196,7 +196,7 @@ M: response clone [ clone ] change-cookies ; : get-cookie ( request/response name -- cookie/f ) - [ cookies>> ] dip '[ , _ name>> = ] find nip ; + [ cookies>> ] dip '[ [ , ] dip name>> = ] find nip ; : delete-cookie ( request/response name -- ) over cookies>> [ get-cookie ] dip delete ; diff --git a/basis/interval-maps/interval-maps.factor b/basis/interval-maps/interval-maps.factor index a62855d78f..99da00ceab 100755 --- a/basis/interval-maps/interval-maps.factor +++ b/basis/interval-maps/interval-maps.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. USING: kernel sequences arrays accessors grouping math.order -sorting binary-search math assocs locals namespaces ; +sorting binary-search math assocs locals namespaces make ; IN: interval-maps TUPLE: interval-map array ; diff --git a/basis/io/servers/packet/datagram.factor b/basis/io/servers/packet/datagram.factor index 03596ee43c..758e85a777 100644 --- a/basis/io/servers/packet/datagram.factor +++ b/basis/io/servers/packet/datagram.factor @@ -18,4 +18,4 @@ LOG: received-datagram NOTICE PRIVATE> : with-datagrams ( seq service quot -- ) - '[ [ , _ spawn-datagrams ] parallel-each ] with-logging ; inline + '[ [ [ , ] dip spawn-datagrams ] parallel-each ] with-logging ; inline diff --git a/basis/io/unix/backend/backend.factor b/basis/io/unix/backend/backend.factor index aa27b21d98..0e9139f431 100755 --- a/basis/io/unix/backend/backend.factor +++ b/basis/io/unix/backend/backend.factor @@ -3,7 +3,7 @@ USING: alien alien.c-types generic assocs kernel kernel.private math io.ports sequences strings structs sbufs threads unix vectors io.buffers io.backend io.encodings math.parser -continuations system libc qualified namespaces io.timeouts +continuations system libc qualified namespaces make io.timeouts io.encodings.utf8 destructors accessors summary combinators locals ; QUALIFIED: io diff --git a/basis/locals/locals.factor b/basis/locals/locals.factor index af5f6834bc..bfc92ee9e2 100755 --- a/basis/locals/locals.factor +++ b/basis/locals/locals.factor @@ -1,14 +1,13 @@ ! Copyright (C) 2007, 2008 Slava Pestov, Eduardo Cavazos. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel namespaces sequences sequences.private assocs math - vectors strings classes.tuple generalizations - parser words quotations debugger macros arrays macros splitting - combinators prettyprint.backend definitions prettyprint - hashtables prettyprint.sections sets sequences.private effects - effects.parser generic generic.parser compiler.units accessors - locals.backend memoize macros.expander lexer - stack-checker.known-words ; - +USING: kernel namespaces make sequences sequences.private assocs +math vectors strings classes.tuple generalizations parser words +quotations debugger macros arrays macros splitting combinators +prettyprint.backend definitions prettyprint hashtables +prettyprint.sections sets sequences.private effects +effects.parser generic generic.parser compiler.units accessors +locals.backend memoize macros.expander lexer +stack-checker.known-words ; IN: locals ! Inspired by diff --git a/basis/macros/expander/expander.factor b/basis/macros/expander/expander.factor index 0a1703de58..d766430810 100644 --- a/basis/macros/expander/expander.factor +++ b/basis/macros/expander/expander.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences namespaces quotations accessors words -continuations vectors effects math stack-checker.transforms ; +USING: kernel sequences namespaces make quotations accessors +words continuations vectors effects math +stack-checker.transforms ; IN: macros.expander GENERIC: expand-macros ( quot -- quot' ) diff --git a/basis/match/match.factor b/basis/match/match.factor index 0ae285d20d..c546555d07 100755 --- a/basis/match/match.factor +++ b/basis/match/match.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. ! ! Based on pattern matching code from Paul Graham's book 'On Lisp'. -USING: parser lexer kernel words namespaces sequences classes.tuple -combinators macros assocs math effects ; +USING: parser lexer kernel words namespaces make sequences +classes.tuple combinators macros assocs math effects ; IN: match SYMBOL: _ diff --git a/basis/math/partial-dispatch/partial-dispatch.factor b/basis/math/partial-dispatch/partial-dispatch.factor index baa5558f7f..6def4966a2 100644 --- a/basis/math/partial-dispatch/partial-dispatch.factor +++ b/basis/math/partial-dispatch/partial-dispatch.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel kernel.private math math.private words -sequences parser namespaces assocs quotations arrays locals +sequences parser namespaces make assocs quotations arrays locals generic generic.math hashtables effects compiler.units ; IN: math.partial-dispatch diff --git a/basis/memoize/memoize.factor b/basis/memoize/memoize.factor index 4b1a4a67d5..1c31156311 100755 --- a/basis/memoize/memoize.factor +++ b/basis/memoize/memoize.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2007 Slava Pestov, Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel hashtables sequences arrays words namespaces +USING: kernel hashtables sequences arrays words namespaces make parser math assocs effects definitions quotations summary accessors ; IN: memoize diff --git a/basis/mime-types/mime-types.factor b/basis/mime-types/mime-types.factor index 9489da8149..42b8f2e739 100755 --- a/basis/mime-types/mime-types.factor +++ b/basis/mime-types/mime-types.factor @@ -16,7 +16,9 @@ MEMO: mime-db ( -- seq ) } ; MEMO: mime-types ( -- assoc ) - [ mime-db [ unclip '[ , _ set ] each ] each ] H{ } make-assoc + [ + mime-db [ unclip '[ [ , ] dip set ] each ] each + ] H{ } make-assoc nonstandard-mime-types assoc-union ; : mime-type ( filename -- mime-type ) diff --git a/basis/peg/parsers/parsers.factor b/basis/peg/parsers/parsers.factor index 93de40d672..5739482093 100755 --- a/basis/peg/parsers/parsers.factor +++ b/basis/peg/parsers/parsers.factor @@ -1,9 +1,8 @@ ! Copyright (C) 2007, 2008 Chris Double, Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences strings namespaces math assocs shuffle - vectors arrays math.parser accessors - unicode.categories sequences.deep peg peg.private - peg.search math.ranges words ; +USING: kernel sequences strings namespaces make math assocs +shuffle vectors arrays math.parser accessors unicode.categories +sequences.deep peg peg.private peg.search math.ranges words ; IN: peg.parsers TUPLE: just-parser p1 ; diff --git a/basis/peg/peg.factor b/basis/peg/peg.factor index 9ef1ac658e..e90a4c60b6 100755 --- a/basis/peg/peg.factor +++ b/basis/peg/peg.factor @@ -1,11 +1,11 @@ ! Copyright (C) 2007, 2008 Chris Double. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences strings fry namespaces math assocs shuffle debugger io - vectors arrays math.parser math.order vectors combinators - classes sets unicode.categories compiler.units parser - words quotations effects memoize accessors locals effects splitting - combinators.short-circuit combinators.short-circuit.smart - generalizations ; +USING: kernel sequences strings fry namespaces make math assocs +shuffle debugger io vectors arrays math.parser math.order +vectors combinators classes sets unicode.categories +compiler.units parser words quotations effects memoize accessors +locals effects splitting combinators.short-circuit +combinators.short-circuit.smart generalizations ; IN: peg USE: prettyprint diff --git a/basis/persistent/hashtables/nodes/collision/collision.factor b/basis/persistent/hashtables/nodes/collision/collision.factor index 83003e5c47..741e3d067a 100644 --- a/basis/persistent/hashtables/nodes/collision/collision.factor +++ b/basis/persistent/hashtables/nodes/collision/collision.factor @@ -8,7 +8,7 @@ persistent.hashtables.nodes.leaf ; IN: persistent.hashtables.nodes.collision : find-index ( key hashcode collision-node -- n leaf-node ) - leaves>> -rot '[ , , _ matching-key? ] find ; inline + leaves>> -rot '[ [ , , ] dip matching-key? ] find ; inline M:: collision-node (entry-at) ( key hashcode collision-node -- leaf-node ) key hashcode collision-node find-index nip ; diff --git a/basis/prettyprint/backend/backend.factor b/basis/prettyprint/backend/backend.factor index c2fd94e5cf..f8445c7783 100755 --- a/basis/prettyprint/backend/backend.factor +++ b/basis/prettyprint/backend/backend.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays byte-arrays byte-vectors generic -hashtables io assocs kernel math namespaces sequences strings -sbufs io.styles vectors words prettyprint.config +hashtables io assocs kernel math namespaces make sequences +strings sbufs io.styles vectors words prettyprint.config prettyprint.sections quotations io io.files math.parser effects classes.tuple math.order classes.tuple.private classes combinators colors ; diff --git a/basis/prettyprint/prettyprint.factor b/basis/prettyprint/prettyprint.factor index 3b9d034378..149ecde447 100755 --- a/basis/prettyprint/prettyprint.factor +++ b/basis/prettyprint/prettyprint.factor @@ -1,15 +1,13 @@ ! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. - -USING: arrays generic generic.standard assocs io kernel -math namespaces sequences strings io.styles io.streams.string +USING: arrays generic generic.standard assocs io kernel math +namespaces make sequences strings io.styles io.streams.string vectors words prettyprint.backend prettyprint.sections prettyprint.config sorting splitting grouping math.parser vocabs definitions effects classes.builtin classes.tuple io.files classes continuations hashtables classes.mixin classes.union classes.intersection classes.predicate classes.singleton combinators quotations sets accessors colors ; - IN: prettyprint : make-pprint ( obj quot -- block in use ) diff --git a/basis/prettyprint/sections/sections.factor b/basis/prettyprint/sections/sections.factor index 13c86ea994..a629ca6fff 100644 --- a/basis/prettyprint/sections/sections.factor +++ b/basis/prettyprint/sections/sections.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays generic hashtables io kernel math assocs -namespaces sequences strings io.styles vectors words +namespaces make sequences strings io.styles vectors words prettyprint.config splitting classes continuations io.streams.nested accessors sets ; IN: prettyprint.sections diff --git a/basis/stack-checker/branches/branches.factor b/basis/stack-checker/branches/branches.factor index 4685483103..651b8d1626 100644 --- a/basis/stack-checker/branches/branches.factor +++ b/basis/stack-checker/branches/branches.factor @@ -22,7 +22,7 @@ SYMBOL: +bottom+ : phi-inputs ( max-d-in pairs -- newseq ) dup empty? [ nip ] [ - swap '[ , _ first2 unify-inputs ] map + swap '[ [ , ] dip first2 unify-inputs ] map pad-with-bottom ] if ; @@ -50,7 +50,7 @@ SYMBOL: quotations ] if-empty ; : branch-variable ( seq symbol -- seq ) - '[ , _ at ] map ; + '[ [ , ] dip at ] map ; : active-variable ( seq symbol -- seq ) [ [ terminated? over at [ drop f ] when ] map ] dip diff --git a/basis/stack-checker/transforms/transforms.factor b/basis/stack-checker/transforms/transforms.factor index d60565e849..e64795c5df 100755 --- a/basis/stack-checker/transforms/transforms.factor +++ b/basis/stack-checker/transforms/transforms.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: fry accessors arrays kernel words sequences generic math -namespaces quotations assocs combinators classes.tuple +namespaces make quotations assocs combinators classes.tuple classes.tuple.private effects summary hashtables classes generic sets definitions generic.standard slots.private continuations stack-checker.backend stack-checker.state stack-checker.visitor diff --git a/basis/summary/summary.factor b/basis/summary/summary.factor index 5da6599c63..ea2c19fd6d 100644 --- a/basis/summary/summary.factor +++ b/basis/summary/summary.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors classes sequences splitting kernel namespaces -words math math.parser io.styles prettyprint assocs ; +make words math math.parser io.styles prettyprint assocs ; IN: summary GENERIC: summary ( object -- string ) diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor index ae4f6a8d62..324adcaad2 100755 --- a/basis/tools/deploy/backend/backend.factor +++ b/basis/tools/deploy/backend/backend.factor @@ -1,12 +1,12 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: namespaces continuations.private kernel.private init +USING: namespaces make continuations.private kernel.private init assocs kernel vocabs words sequences memory io system arrays continuations math definitions mirrors splitting parser classes summary layouts vocabs.loader prettyprint.config prettyprint -debugger io.streams.c io.files io.backend -quotations io.launcher words.private tools.deploy.config -bootstrap.image io.encodings.utf8 destructors accessors ; +debugger io.streams.c io.files io.backend quotations io.launcher +words.private tools.deploy.config bootstrap.image +io.encodings.utf8 destructors accessors ; IN: tools.deploy.backend : copy-vm ( executable bundle-name extension -- vm ) diff --git a/basis/tools/deploy/macosx/macosx.factor b/basis/tools/deploy/macosx/macosx.factor index d38b40db4b..ee60ce3982 100755 --- a/basis/tools/deploy/macosx/macosx.factor +++ b/basis/tools/deploy/macosx/macosx.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: io io.files kernel namespaces sequences +USING: io io.files kernel namespaces make sequences system tools.deploy.backend tools.deploy.config assocs hashtables prettyprint io.unix.backend cocoa io.encodings.utf8 io.backend cocoa.application cocoa.classes cocoa.plists diff --git a/basis/tools/disassembler/disassembler.factor b/basis/tools/disassembler/disassembler.factor index 887fd1b6d7..dabdaaaa7c 100755 --- a/basis/tools/disassembler/disassembler.factor +++ b/basis/tools/disassembler/disassembler.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2008 Slava Pestov, Jorge Acereda Macia. ! See http://factorcode.org/license.txt for BSD license. USING: io.files io words alien kernel math.parser alien.syntax -io.launcher system assocs arrays sequences namespaces qualified -system math compiler.generator.fixup io.encodings.ascii -accessors generic tr ; +io.launcher system assocs arrays sequences namespaces make +qualified system math compiler.generator.fixup +io.encodings.ascii accessors generic tr ; IN: tools.disassembler : in-file ( -- path ) "gdb-in.txt" temp-file ; diff --git a/basis/tools/vocabs/vocabs.factor b/basis/tools/vocabs/vocabs.factor index 1c7e8d28d2..732a6635b7 100755 --- a/basis/tools/vocabs/vocabs.factor +++ b/basis/tools/vocabs/vocabs.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel io io.styles io.files io.encodings.utf8 -vocabs.loader vocabs sequences namespaces math.parser arrays -hashtables assocs memoize summary sorting splitting combinators -source-files debugger continuations compiler.errors init -checksums checksums.crc32 sets accessors ; +vocabs.loader vocabs sequences namespaces make math.parser +arrays hashtables assocs memoize summary sorting splitting +combinators source-files debugger continuations compiler.errors +init checksums checksums.crc32 sets accessors ; IN: tools.vocabs : vocab-tests-file ( vocab -- path ) diff --git a/basis/tools/walker/walker.factor b/basis/tools/walker/walker.factor index c1073eda8c..9775bdff81 100755 --- a/basis/tools/walker/walker.factor +++ b/basis/tools/walker/walker.factor @@ -4,7 +4,7 @@ USING: threads kernel namespaces continuations combinators sequences math namespaces.private continuations.private concurrency.messaging quotations kernel.private words sequences.private assocs models models.filter arrays accessors -generic generic.standard definitions ; +generic generic.standard definitions make ; IN: tools.walker SYMBOL: show-walker-hook ! ( status continuation thread -- ) diff --git a/basis/ui/commands/commands-docs.factor b/basis/ui/commands/commands-docs.factor index 804236dadc..25312ad868 100644 --- a/basis/ui/commands/commands-docs.factor +++ b/basis/ui/commands/commands-docs.factor @@ -1,5 +1,5 @@ USING: accessors ui.gestures help.markup help.syntax strings kernel -hashtables quotations words classes sequences namespaces +hashtables quotations words classes sequences namespaces make arrays assocs ; IN: ui.commands diff --git a/basis/ui/commands/commands.factor b/basis/ui/commands/commands.factor index 2677c496ec..b45e2e4004 100755 --- a/basis/ui/commands/commands.factor +++ b/basis/ui/commands/commands.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays definitions kernel sequences strings -math assocs words generic namespaces assocs quotations splitting -ui.gestures unicode.case unicode.categories tr ; +math assocs words generic namespaces make assocs quotations +splitting ui.gestures unicode.case unicode.categories tr ; IN: ui.commands SYMBOL: +nullary+ diff --git a/basis/ui/gadgets/editors/editors.factor b/basis/ui/gadgets/editors/editors.factor index 8142297318..888716b364 100755 --- a/basis/ui/gadgets/editors/editors.factor +++ b/basis/ui/gadgets/editors/editors.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006, 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays documents io kernel math models -namespaces opengl opengl.gl sequences strings io.styles +namespaces make opengl opengl.gl sequences strings io.styles math.vectors sorting colors combinators assocs math.order ui.clipboards ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.buttons ui.gadgets.labels ui.gadgets.scrollers diff --git a/basis/ui/gadgets/gadgets.factor b/basis/ui/gadgets/gadgets.factor index 15850ae357..05764d5b84 100755 --- a/basis/ui/gadgets/gadgets.factor +++ b/basis/ui/gadgets/gadgets.factor @@ -1,10 +1,9 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays hashtables kernel models math namespaces - sequences quotations math.vectors combinators sorting - binary-search vectors dlists deques models threads - concurrency.flags math.order math.geometry.rect ; - +make sequences quotations math.vectors combinators sorting +binary-search vectors dlists deques models threads +concurrency.flags math.order math.geometry.rect ; IN: ui.gadgets SYMBOL: ui-notify-flag diff --git a/basis/ui/gadgets/grids/grids.factor b/basis/ui/gadgets/grids/grids.factor index 42e8cfdfdf..f14ccf1cca 100644 --- a/basis/ui/gadgets/grids/grids.factor +++ b/basis/ui/gadgets/grids/grids.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays kernel math namespaces sequences words io +USING: arrays kernel math namespaces make sequences words io io.streams.string math.vectors ui.gadgets columns accessors math.geometry.rect ; IN: ui.gadgets.grids diff --git a/basis/ui/gadgets/labels/labels.factor b/basis/ui/gadgets/labels/labels.factor index ed951824b8..f27b9898a1 100755 --- a/basis/ui/gadgets/labels/labels.factor +++ b/basis/ui/gadgets/labels/labels.factor @@ -1,9 +1,8 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays hashtables io kernel math namespaces -opengl sequences strings splitting -ui.gadgets ui.gadgets.tracks ui.gadgets.theme ui.render colors -models ; +make opengl sequences strings splitting ui.gadgets +ui.gadgets.tracks ui.gadgets.theme ui.render colors models ; IN: ui.gadgets.labels ! A label gadget draws a string. diff --git a/basis/ui/gestures/gestures.factor b/basis/ui/gestures/gestures.factor index 1170ea3fd1..a1c6adac6e 100755 --- a/basis/ui/gestures/gestures.factor +++ b/basis/ui/gestures/gestures.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs kernel math models namespaces -sequences words strings system hashtables math.parser -math.vectors classes.tuple classes ui.gadgets boxes -calendar alarms symbols combinators sets columns ; +make sequences words strings system hashtables math.parser +math.vectors classes.tuple classes ui.gadgets boxes calendar +alarms symbols combinators sets columns ; IN: ui.gestures : set-gestures ( class hash -- ) "gestures" set-word-prop ; diff --git a/basis/ui/operations/operations.factor b/basis/ui/operations/operations.factor index 8b4817dcac..3e0b36486e 100755 --- a/basis/ui/operations/operations.factor +++ b/basis/ui/operations/operations.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays definitions kernel ui.commands -ui.gestures sequences strings math words generic namespaces +ui.gestures sequences strings math words generic namespaces make hashtables help.markup quotations assocs ; IN: ui.operations diff --git a/basis/ui/tools/walker/walker.factor b/basis/ui/tools/walker/walker.factor index 51091c576d..7bc42ea676 100755 --- a/basis/ui/tools/walker/walker.factor +++ b/basis/ui/tools/walker/walker.factor @@ -4,7 +4,7 @@ USING: accessors kernel concurrency.messaging inspector ui.tools.listener ui.tools.traceback ui.gadgets.buttons ui.gadgets.status-bar ui.gadgets.tracks ui.commands ui.gadgets models models.filter ui.tools.workspace ui.gestures -ui.gadgets.labels ui threads namespaces tools.walker assocs +ui.gadgets.labels ui threads namespaces make tools.walker assocs combinators ; IN: ui.tools.walker diff --git a/basis/ui/traverse/traverse.factor b/basis/ui/traverse/traverse.factor index 440f6487c2..eadd110fe7 100644 --- a/basis/ui/traverse/traverse.factor +++ b/basis/ui/traverse/traverse.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors namespaces sequences kernel math arrays io ui.gadgets -generic combinators ; +USING: accessors namespaces make sequences kernel math arrays io +ui.gadgets generic combinators ; IN: ui.traverse TUPLE: node value children ; diff --git a/basis/ui/ui-docs.factor b/basis/ui/ui-docs.factor index e086b7ebae..d8c816d717 100755 --- a/basis/ui/ui-docs.factor +++ b/basis/ui/ui-docs.factor @@ -192,7 +192,6 @@ HELP: raise-window ARTICLE: "ui-layouts" "Gadget hierarchy and layouts" "A layout gadget is a gadget whose sole purpose is to contain other gadgets. Layout gadgets position and resize children according to a certain policy, taking the preferred size of the children into account. Gadget hierarchies are constructed by building up nested layouts." { $subsection "ui-layout-basics" } -{ $subsection "ui-layout-combinators" } "Common layout gadgets:" { $subsection "ui-pack-layout" } { $subsection "ui-track-layout" } @@ -230,12 +229,6 @@ $nl { $subsection pref-dim* } "To get a gadget's preferred size, do not call the above word, instead use " { $link pref-dim } ", which caches the result." ; -ARTICLE: "ui-layout-combinators" "Creating layouts using combinators" -"The " { $link make } " combinator provides a convenient way of constructing sequences by keeping the intermediate sequence off the stack until construction is done. The " { $link , } " and " { $link % } " words operate on this implicit sequence, reducing stack noise." -$nl -"Similar tools exist for constructing complex gadget hierarchies. Different words are used for different types of gadgets; see " { $link "ui-pack-layout" } ", " { $link "ui-track-layout" } " and " { $link "ui-frame-layout" } " for specifics. This section documents their common factors." -; - ARTICLE: "ui-null-layout" "Manual layouts" "When automatic layout is not appropriate, gadgets can be added to a parent with no layout policy, and then positioned and sized manually by setting the " { $snippet "loc" } " field." ; diff --git a/basis/ui/ui.factor b/basis/ui/ui.factor index 22abfc8f21..da9e2f0d43 100755 --- a/basis/ui/ui.factor +++ b/basis/ui/ui.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays assocs io kernel math models namespaces +USING: arrays assocs io kernel math models namespaces make prettyprint dlists deques sequences threads sequences words debugger ui.gadgets ui.gadgets.worlds ui.gadgets.tracks ui.gestures ui.backend ui.render continuations init combinators diff --git a/basis/unicode/case/case.factor b/basis/unicode/case/case.factor index 0234a959da..5e961e2d67 100755 --- a/basis/unicode/case/case.factor +++ b/basis/unicode/case/case.factor @@ -1,4 +1,4 @@ -USING: unicode.data sequences sequences.next namespaces +USING: unicode.data sequences sequences.next namespaces make unicode.normalize math unicode.categories combinators assocs strings splitting kernel accessors ; IN: unicode.case diff --git a/basis/unicode/normalize/normalize.factor b/basis/unicode/normalize/normalize.factor index 6f36461d38..53a38faed4 100755 --- a/basis/unicode/normalize/normalize.factor +++ b/basis/unicode/normalize/normalize.factor @@ -1,4 +1,4 @@ -USING: sequences namespaces unicode.data kernel math arrays +USING: sequences namespaces make unicode.data kernel math arrays locals sorting.insertion accessors ; IN: unicode.normalize diff --git a/basis/unicode/syntax/syntax.factor b/basis/unicode/syntax/syntax.factor index 9df14a3928..1ba76fd380 100755 --- a/basis/unicode/syntax/syntax.factor +++ b/basis/unicode/syntax/syntax.factor @@ -1,6 +1,6 @@ -USING: unicode.data kernel math sequences parser lexer bit-arrays -namespaces sequences.private arrays quotations assocs -classes.predicate math.order eval ; +USING: unicode.data kernel math sequences parser lexer +bit-arrays namespaces make sequences.private arrays quotations +assocs classes.predicate math.order eval ; IN: unicode.syntax ! Character classes (categories) diff --git a/basis/urls/urls.factor b/basis/urls/urls.factor index 299f305371..92a05806b5 100644 --- a/basis/urls/urls.factor +++ b/basis/urls/urls.factor @@ -105,7 +105,7 @@ TUPLE: url protocol username password host port path query anchor ; swap query>> at ; : set-query-param ( url value key -- url ) - '[ , , _ ?set-at ] change-query ; + '[ [ , , ] dip ?set-at ] change-query ; : parse-host ( string -- host port ) ":" split1 [ url-decode ] [ diff --git a/core/classes/classes.factor b/core/classes/classes.factor index 5ec96bbbb0..67a789a1dc 100755 --- a/core/classes/classes.factor +++ b/core/classes/classes.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays definitions assocs kernel kernel.private -slots.private namespaces sequences strings words vectors math -quotations combinators sorting effects graphs vocabs sets ; +slots.private namespaces make sequences strings words vectors +math quotations combinators sorting effects graphs vocabs sets ; IN: classes SYMBOL: class<=-cache diff --git a/core/classes/predicate/predicate.factor b/core/classes/predicate/predicate.factor index e6d6b5a0d4..4ba93acae4 100755 --- a/core/classes/predicate/predicate.factor +++ b/core/classes/predicate/predicate.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: classes classes.algebra kernel namespaces words sequences -quotations arrays kernel.private assocs combinators ; +USING: classes classes.algebra kernel namespaces make words +sequences quotations arrays kernel.private assocs combinators ; IN: classes.predicate PREDICATE: predicate-class < class diff --git a/core/classes/tuple/parser/parser.factor b/core/classes/tuple/parser/parser.factor index 531658a5e0..c190ce85e7 100644 --- a/core/classes/tuple/parser/parser.factor +++ b/core/classes/tuple/parser/parser.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors kernel sets namespaces sequences parser +USING: accessors kernel sets namespaces make sequences parser lexer combinators words classes.parser classes.tuple arrays slots math assocs ; IN: classes.tuple.parser diff --git a/core/classes/tuple/tuple.factor b/core/classes/tuple/tuple.factor index b5c3658542..f92c9c0fd5 100755 --- a/core/classes/tuple/tuple.factor +++ b/core/classes/tuple/tuple.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays definitions hashtables kernel kernel.private math -namespaces sequences sequences.private strings vectors words -quotations memory combinators generic classes classes.algebra -classes.builtin classes.private slots.private slots -compiler.units math.private accessors assocs effects ; +namespaces make sequences sequences.private strings vectors +words quotations memory combinators generic classes +classes.algebra classes.builtin classes.private slots.private +slots compiler.units math.private accessors assocs effects ; IN: classes.tuple PREDICATE: tuple-class < class diff --git a/core/compiler/errors/errors.factor b/core/compiler/errors/errors.factor index e21348fd19..7a28c1fb99 100755 --- a/core/compiler/errors/errors.factor +++ b/core/compiler/errors/errors.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel namespaces assocs io sequences +USING: kernel namespaces make assocs io sequences sorting continuations math math.parser ; IN: compiler.errors diff --git a/core/continuations/continuations.factor b/core/continuations/continuations.factor index bfa3848186..6dde851963 100755 --- a/core/continuations/continuations.factor +++ b/core/continuations/continuations.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays vectors kernel kernel.private sequences -namespaces math splitting sorting quotations assocs +namespaces make math splitting sorting quotations assocs combinators accessors ; IN: continuations diff --git a/core/destructors/destructors.factor b/core/destructors/destructors.factor index 154e1c30ac..afc956fae4 100755 --- a/core/destructors/destructors.factor +++ b/core/destructors/destructors.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2007, 2008 Doug Coleman, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors continuations kernel namespaces +USING: accessors continuations kernel namespaces make sequences vectors ; IN: destructors diff --git a/core/effects/effects.factor b/core/effects/effects.factor index 8a000b0615..0c082477c7 100755 --- a/core/effects/effects.factor +++ b/core/effects/effects.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel math math.parser namespaces sequences strings +USING: kernel math math.parser namespaces make sequences strings words assocs combinators accessors arrays ; IN: effects diff --git a/core/generic/generic.factor b/core/generic/generic.factor index c0a21dbaba..026e372912 100755 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors words kernel sequences namespaces assocs +USING: accessors words kernel sequences namespaces make assocs hashtables definitions kernel.private classes classes.private classes.algebra quotations arrays vocabs effects combinators sets ; diff --git a/core/generic/math/math.factor b/core/generic/math/math.factor index 834e19d9d9..077795c4b7 100755 --- a/core/generic/math/math.factor +++ b/core/generic/math/math.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays generic hashtables kernel kernel.private -math namespaces sequences words quotations layouts combinators +USING: arrays generic hashtables kernel kernel.private math +namespaces make sequences words quotations layouts combinators sequences.private classes classes.builtin classes.algebra definitions math.order ; IN: generic.math diff --git a/core/generic/standard/engines/tag/tag.factor b/core/generic/standard/engines/tag/tag.factor index 02a7af105f..50813f191c 100644 --- a/core/generic/standard/engines/tag/tag.factor +++ b/core/generic/standard/engines/tag/tag.factor @@ -1,4 +1,6 @@ -USING: classes.private generic.standard.engines namespaces +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: classes.private generic.standard.engines namespaces make arrays assocs sequences.private quotations kernel.private math slots.private math.private kernel accessors words layouts ; diff --git a/core/generic/standard/engines/tuple/tuple.factor b/core/generic/standard/engines/tuple/tuple.factor index 325f2ebb39..8c61aa4240 100644 --- a/core/generic/standard/engines/tuple/tuple.factor +++ b/core/generic/standard/engines/tuple/tuple.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: kernel classes.tuple.private hashtables assocs sorting accessors combinators sequences slots.private math.parser words -effects namespaces generic generic.standard.engines +effects namespaces make generic generic.standard.engines classes.algebra math math.private kernel.private quotations arrays definitions ; IN: generic.standard.engines.tuple diff --git a/core/generic/standard/standard.factor b/core/generic/standard/standard.factor index 860781e5e2..d22d20a0fc 100644 --- a/core/generic/standard/standard.factor +++ b/core/generic/standard/standard.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs kernel kernel.private slots.private math -namespaces sequences vectors words quotations definitions +namespaces make sequences vectors words quotations definitions hashtables layouts combinators sequences.private generic classes classes.algebra classes.private generic.standard.engines generic.standard.engines.tag generic.standard.engines.predicate diff --git a/core/io/io.factor b/core/io/io.factor index a03aaac6d8..0d5a857490 100755 --- a/core/io/io.factor +++ b/core/io/io.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2003, 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: hashtables generic kernel math namespaces sequences +USING: hashtables generic kernel math namespaces make sequences continuations destructors assocs ; IN: io diff --git a/core/io/streams/c/c.factor b/core/io/streams/c/c.factor index de6d8519ca..780d892d2e 100755 --- a/core/io/streams/c/c.factor +++ b/core/io/streams/c/c.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel kernel.private namespaces io io.encodings +USING: kernel kernel.private namespaces make io io.encodings sequences math generic threads.private classes io.backend io.files continuations destructors byte-arrays accessors ; IN: io.streams.c diff --git a/core/math/parser/parser-docs.factor b/core/math/parser/parser-docs.factor index 1d2a24057c..bcc75a842a 100644 --- a/core/math/parser/parser-docs.factor +++ b/core/math/parser/parser-docs.factor @@ -1,5 +1,5 @@ USING: help.markup help.syntax math math.private prettyprint -namespaces strings ; +namespaces make strings ; IN: math.parser ARTICLE: "number-strings" "Converting between numbers and strings" diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 05e267f035..04d8fb6a41 100755 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2004, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel math.private namespaces sequences strings arrays -combinators splitting math assocs ; +USING: kernel math.private namespaces make sequences strings +arrays combinators splitting math assocs ; IN: math.parser : digit> ( ch -- n ) diff --git a/core/namespaces/namespaces-docs.factor b/core/namespaces/namespaces-docs.factor index 1da3bc45db..f410148566 100755 --- a/core/namespaces/namespaces-docs.factor +++ b/core/namespaces/namespaces-docs.factor @@ -22,13 +22,6 @@ ARTICLE: "namespaces-global" "Global variables" { $subsection get-global } { $subsection set-global } ; -ARTICLE: "namespaces-make" "Constructing sequences" -"There is a lexicon of words for constructing sequences without passing the partial sequence being built on the stack. This reduces stack noise." -{ $subsection make } -{ $subsection , } -{ $subsection % } -{ $subsection # } ; - ARTICLE: "namespaces.private" "Namespace implementation details" "The namestack holds namespaces." { $subsection namestack } @@ -50,8 +43,6 @@ $nl { $subsection "namespaces-change" } { $subsection "namespaces-combinators" } { $subsection "namespaces-global" } -"A useful facility for constructing sequences by holding an accumulator sequence in a variable:" -{ $subsection "namespaces-make" } "Implementation details your code probably does not care about:" { $subsection "namespaces.private" } "An alternative to dynamic scope is lexical scope. Lexically-scoped values and closures are implemented in the " { $vocab-link "locals" } " vocabulary." ; @@ -162,22 +153,6 @@ HELP: >n HELP: ndrop { $description "Pops a namespace from the name stack." } ; -HELP: building -{ $var-description "Temporary mutable growable sequence holding elements accumulated so far by " { $link make } "." } ; - -HELP: make -{ $values { "quot" quotation } { "exemplar" "a sequence" } { "seq" "a new sequence" } } -{ $description "Calls the quotation in a new " { $emphasis "dynamic scope" } ". The quotation and any words it calls can execute the " { $link , } " and " { $link % } " words to accumulate elements. When the quotation returns, all accumulated elements are collected into a sequence with the same type as " { $snippet "exemplar" } "." } -{ $examples { $example "USING: namespaces prettyprint ;" "[ 1 , 2 , 3 , ] { } make ." "{ 1 2 3 }" } } ; - -HELP: , -{ $values { "elt" object } } -{ $description "Adds an element to the end of the sequence being constructed by " { $link make } "." } ; - -HELP: % -{ $values { "seq" "a sequence" } } -{ $description "Appends a sequence to the end of the sequence being constructed by " { $link make } "." } ; - HELP: init-namespaces { $description "Resets the name stack to its initial state, holding a single copy of the global namespace." } $low-level-note ; diff --git a/core/namespaces/namespaces.factor b/core/namespaces/namespaces.factor index 3d3d3c554b..20400f4e54 100644 --- a/core/namespaces/namespaces.factor +++ b/core/namespaces/namespaces.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2003, 2007 Slava Pestov. +! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel vectors sequences hashtables arrays kernel.private math strings assocs ; @@ -6,9 +6,7 @@ IN: namespaces n ( namespace -- ) namestack* push ; : ndrop ( -- ) namestack* pop* ; @@ -25,18 +23,11 @@ PRIVATE> : off ( variable -- ) f swap set ; inline : get-global ( variable -- value ) global at ; : set-global ( value variable -- ) global set-at ; - -: change ( variable quot -- ) - >r dup get r> rot slip set ; inline - +: change ( variable quot -- ) >r dup get r> rot slip set ; inline : +@ ( n variable -- ) [ 0 or + ] change ; - : inc ( variable -- ) 1 swap +@ ; inline - : dec ( variable -- ) -1 swap +@ ; inline - : bind ( ns quot -- ) swap >n call ndrop ; inline - : counter ( variable -- n ) global [ dup inc get ] bind ; : make-assoc ( quot exemplar -- hash ) @@ -47,19 +38,3 @@ PRIVATE> : with-variable ( value key quot -- ) >r associate >n r> call ndrop ; inline - -! Building sequences -SYMBOL: building - -: make ( quot exemplar -- seq ) - [ - [ - 1024 swap new-resizable [ - building set call - ] keep - ] keep like - ] with-scope ; inline - -: , ( elt -- ) building get push ; - -: % ( seq -- ) building get push-all ; diff --git a/core/slots/slots.factor b/core/slots/slots.factor index 6f831c30c5..d4ae60ca94 100755 --- a/core/slots/slots.factor +++ b/core/slots/slots.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays byte-arrays kernel kernel.private math namespaces -sequences strings words effects generic generic.standard classes -classes.algebra slots.private combinators accessors words -sequences.private assocs alien ; +make sequences strings words effects generic generic.standard +classes classes.algebra slots.private combinators accessors +words sequences.private assocs alien ; IN: slots TUPLE: slot-spec name offset class initial read-only ; diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index 38f5ae0891..aac32784a1 100755 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2005, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel math namespaces strings arrays vectors sequences +USING: kernel math make strings arrays vectors sequences sets math.order accessors ; IN: splitting diff --git a/core/strings/parser/parser.factor b/core/strings/parser/parser.factor index 8d95254539..2695860a59 100644 --- a/core/strings/parser/parser.factor +++ b/core/strings/parser/parser.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel assocs namespaces splitting sequences +USING: kernel assocs namespaces make splitting sequences strings math.parser lexer accessors ; IN: strings.parser diff --git a/core/vocabs/loader/loader.factor b/core/vocabs/loader/loader.factor index 4677a7b5d7..44f538d5d9 100755 --- a/core/vocabs/loader/loader.factor +++ b/core/vocabs/loader/loader.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007, 2008 Eduardo Cavazos, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: namespaces sequences io.files kernel assocs words vocabs -definitions parser continuations io hashtables sorting +USING: namespaces make sequences io.files kernel assocs words +vocabs definitions parser continuations io hashtables sorting source-files arrays combinators strings system math.parser compiler.errors splitting init accessors ; IN: vocabs.loader diff --git a/extra/monads/monads.factor b/extra/monads/monads.factor index e110cb38d3..bff720b2a3 100644 --- a/extra/monads/monads.factor +++ b/extra/monads/monads.factor @@ -51,7 +51,7 @@ M: identity monad-of drop identity-monad ; M: identity-monad return drop identity boa ; M: identity-monad fail "Fail" throw ; -M: identity >>= value>> '[ , _ call ] ; +M: identity >>= value>> '[ , swap call ] ; : run-identity ( identity -- value ) value>> ; @@ -73,7 +73,7 @@ M: maybe-monad return drop just ; M: maybe-monad fail 2drop nothing ; M: nothing >>= '[ drop , ] ; -M: just >>= value>> '[ , _ call ] ; +M: just >>= value>> '[ , swap call ] ; : if-maybe ( maybe just-quot nothing-quot -- ) pick nothing? [ 2nip call ] [ drop [ value>> ] dip call ] if ; inline @@ -97,7 +97,7 @@ M: either-monad return drop right ; M: either-monad fail drop left ; M: left >>= '[ drop , ] ; -M: right >>= value>> '[ , _ call ] ; +M: right >>= value>> '[ , swap call ] ; : if-either ( value left-quot right-quot -- ) [ [ value>> ] [ left? ] bi ] 2dip if ; inline @@ -112,7 +112,7 @@ M: array-monad fail 2drop { } ; M: array monad-of drop array-monad ; -M: array >>= '[ , _ map concat ] ; +M: array >>= '[ , swap map concat ] ; ! List SINGLETON: list-monad @@ -124,7 +124,7 @@ M: list-monad fail 2drop nil ; M: list monad-of drop list-monad ; -M: list >>= '[ , _ lazy-map lconcat ] ; +M: list >>= '[ , swap lazy-map lconcat ] ; ! State SINGLETON: state-monad @@ -142,7 +142,7 @@ M: state-monad fail "Fail" throw ; : mcall ( state -- ) quot>> call ; -M: state >>= '[ , _ '[ , mcall first2 @ mcall ] state ] ; +M: state >>= '[ , swap '[ , mcall first2 @ mcall ] state ] ; : get-st ( -- state ) [ dup 2array ] state ; : put-st ( value -- state ) '[ drop , f 2array ] state ; @@ -164,7 +164,7 @@ M: reader monad-of drop reader-monad ; M: reader-monad return drop '[ drop , ] reader ; M: reader-monad fail "Fail" throw ; -M: reader >>= '[ , _ '[ dup , mcall @ mcall ] reader ] ; +M: reader >>= '[ , swap '[ dup , mcall @ mcall ] reader ] ; : run-reader ( reader env -- ) swap mcall ; @@ -185,7 +185,7 @@ M: writer-monad fail "Fail" throw ; : run-writer ( writer -- value log ) [ value>> ] [ log>> ] bi ; -M: writer >>= '[ , run-writer _ '[ @ run-writer ] dip append writer ] ; +M: writer >>= '[ [ , run-writer ] dip '[ @ run-writer ] dip append writer ] ; : pass ( writer -- writer' ) run-writer [ first2 ] dip swap call writer ; : listen ( writer -- writer' ) run-writer [ 2array ] keep writer ; diff --git a/extra/ui/gadgets/tabs/tabs.factor b/extra/ui/gadgets/tabs/tabs.factor index 50e2df2e9e..83ed445593 100755 --- a/extra/ui/gadgets/tabs/tabs.factor +++ b/extra/ui/gadgets/tabs/tabs.factor @@ -23,7 +23,7 @@ DEFER: (del-page) [ names>> ] [ model>> ] [ toggler>> ] tri [ clear-gadget ] keep [ [ length ] keep ] 2dip - '[ , _ _ , add-toggle ] 2each ; + '[ [ , ] 2dip , add-toggle ] 2each ; : refresh-book ( tabbed -- ) model>> [ ] change-model ; diff --git a/extra/webapps/wiki/wiki.factor b/extra/webapps/wiki/wiki.factor index 5f679be431..f36e8a11f0 100644 --- a/extra/webapps/wiki/wiki.factor +++ b/extra/webapps/wiki/wiki.factor @@ -93,18 +93,12 @@ M: revision feed-entry-url id>> revision-url ;
select-tuple dup [ revision>> select-tuple ] when ; -: init-relative-link-prefix ( -- ) - URL" $wiki/view/" adjust-url present relative-link-prefix set ; - : ( -- action ) "title" >>rest - [ - validate-title - init-relative-link-prefix - ] >>init + [ validate-title ] >>init [ "title" value dup latest-revision [ @@ -126,7 +120,6 @@ M: revision feed-entry-url id>> revision-url ; validate-integer-id "id" value select-tuple from-object - init-relative-link-prefix ] >>init { wiki "view" } >>template diff --git a/extra/websites/concatenative/concatenative.factor b/extra/websites/concatenative/concatenative.factor index e37f7d4c3f..a35358ae6b 100644 --- a/extra/websites/concatenative/concatenative.factor +++ b/extra/websites/concatenative/concatenative.factor @@ -74,20 +74,24 @@ SYMBOL: dh-file "noreply@concatenative.org" lost-password-from set-global "website@concatenative.org" insomniac-sender set-global "slava@factorcode.org" insomniac-recipients set-global - main-responder set-global init-factor-db ; : init-testing ( -- ) "resource:basis/openssl/test/dh1024.pem" dh-file set-global "resource:basis/openssl/test/server.pem" key-file set-global "password" key-password set-global - common-configuration ; + common-configuration + main-responder set-global ; + +: no-www-prefix ( -- responder ) + "http://concatenative.org" ; : init-production ( -- ) - f dh-file set-global - f key-password set-global - "/home/slava/cert/host.pem" key-file set-global - common-configuration ; + common-configuration + + "concatenative.org" add-responder + no-www-prefix "www.concatenative.org" add-responder + main-responder set-global ; : ( -- config ) -- 2.34.1