From eceed177d6ab6d545eaddad77ffc699fa82f836a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 20 Sep 2009 22:42:40 -0500 Subject: [PATCH] replace usages of <" with """ --- basis/classes/struct/struct-tests.factor | 10 +- basis/combinators/smart/smart-docs.factor | 6 +- basis/compiler/tests/folding.factor | 16 +- basis/compiler/tests/redefine10.factor | 17 +-- basis/compiler/tests/redefine11.factor | 9 +- basis/compiler/tests/redefine5.factor | 16 +- basis/compiler/tests/redefine6.factor | 16 +- basis/compiler/tests/redefine7.factor | 16 +- basis/compiler/tests/redefine8.factor | 16 +- basis/compiler/tests/redefine9.factor | 16 +- basis/db/db-docs.factor | 26 ++-- basis/db/sqlite/sqlite.factor | 28 ++-- basis/db/tuples/tuples-docs.factor | 33 ++--- basis/delegate/delegate-tests.factor | 30 ++-- .../documents/elements/elements-tests.factor | 6 +- basis/functors/functors-tests.factor | 12 +- basis/furnace/actions/actions-docs.factor | 6 +- basis/furnace/alloy/alloy-docs.factor | 6 +- basis/furnace/auth/auth-docs.factor | 14 +- basis/help/cookbook/cookbook.factor | 10 +- basis/html/templates/fhtml/fhtml-tests.factor | 8 +- basis/http/server/cgi/cgi-docs.factor | 6 +- .../dispatchers/dispatchers-docs.factor | 21 ++- basis/json/reader/reader-tests.factor | 20 +-- basis/json/writer/writer-tests.factor | 8 +- basis/literals/literals-docs.factor | 20 +-- basis/math/blas/config/config-docs.factor | 6 +- basis/math/blas/matrices/matrices-docs.factor | 18 +-- .../combinatorics/combinatorics-docs.factor | 6 +- basis/math/vectors/simd/simd-docs.factor | 26 ++-- .../capabilities/capabilities-docs.factor | 6 +- basis/opengl/debug/debug-docs.factor | 7 +- basis/peg/ebnf/ebnf-tests.factor | 4 +- .../quoted-printable-tests.factor | 16 +- basis/regexp/regexp-docs.factor | 6 +- .../complex-components-docs.factor | 23 ++- basis/sequences/complex/complex-docs.factor | 18 +-- .../specialized-arrays-tests.factor | 12 +- .../splitting/monotonic/monotonic-docs.factor | 11 +- basis/tools/scaffold/scaffold-tests.factor | 6 +- .../pixel-formats/pixel-formats-docs.factor | 6 +- basis/urls/encoding/encoding-docs.factor | 6 +- basis/urls/urls-docs.factor | 6 +- .../prettyprint/prettyprint-tests.factor | 26 ++-- basis/windows/com/syntax/syntax-docs.factor | 12 +- basis/windows/com/wrapper/wrapper-docs.factor | 7 +- basis/xml/syntax/syntax-docs.factor | 22 +-- basis/xml/syntax/syntax-tests.factor | 12 +- basis/xml/traversal/traversal-docs.factor | 12 +- basis/xml/writer/writer-docs.factor | 10 +- basis/xml/writer/writer-tests.factor | 18 +-- basis/xmode/code2html/code2html-tests.factor | 10 +- core/classes/classes-tests.factor | 28 ++-- core/generic/generic-tests.factor | 21 +-- extra/4DNav/4DNav-docs.factor | 6 +- extra/adsoda/adsoda-docs.factor | 6 +- extra/brainfuck/brainfuck-tests.factor | 19 +-- extra/gpu/render/render-docs.factor | 6 +- extra/gpu/shaders/shaders-docs.factor | 10 +- extra/gpu/shaders/shaders-tests.factor | 8 +- extra/gpu/state/state-docs.factor | 7 +- extra/managed-server/chat/chat.factor | 25 ++-- extra/otug-talk/otug-talk.factor | 20 +-- extra/pair-rocket/pair-rocket-docs.factor | 6 +- .../peg/javascript/parser/parser-tests.factor | 14 +- extra/peg/pl0/pl0-tests.factor | 13 +- extra/qw/qw-docs.factor | 13 +- extra/roles/roles-docs.factor | 8 +- extra/sequences/n-based/n-based-docs.factor | 10 +- extra/sequences/product/product-docs.factor | 14 +- extra/spider/spider-docs.factor | 14 +- extra/svg/svg-tests.factor | 6 +- extra/tc-lisp-talk/tc-lisp-talk.factor | 140 +++++++++--------- extra/variants/variants-docs.factor | 12 +- 74 files changed, 538 insertions(+), 572 deletions(-) diff --git a/basis/classes/struct/struct-tests.factor b/basis/classes/struct/struct-tests.factor index bbbaf4f1d5..a282eb75ee 100755 --- a/basis/classes/struct/struct-tests.factor +++ b/basis/classes/struct/struct-tests.factor @@ -3,7 +3,7 @@ USING: accessors alien alien.c-types ascii assocs byte-arrays classes.struct classes.tuple.private combinators compiler.tree.debugger compiler.units destructors io.encodings.utf8 io.pathnames io.streams.string kernel libc -literals math mirrors multiline namespaces prettyprint +literals math mirrors namespaces prettyprint prettyprint.config see sequences specialized-arrays system tools.test parser lexer eval layouts ; SPECIALIZED-ARRAY: char @@ -181,18 +181,18 @@ STRUCT: struct-test-string-ptr ] with-scope ] unit-test -[ <" USING: classes.struct ; +[ "USING: classes.struct ; IN: classes.struct.tests STRUCT: struct-test-foo { x char initial: 0 } { y int initial: 123 } { z bool } ; -"> ] +" ] [ [ struct-test-foo see ] with-string-writer ] unit-test -[ <" USING: classes.struct ; +[ "USING: classes.struct ; IN: classes.struct.tests UNION-STRUCT: struct-test-float-and-bits { f float initial: 0.0 } { bits uint initial: 0 } ; -"> ] +" ] [ [ struct-test-float-and-bits see ] with-string-writer ] unit-test [ { diff --git a/basis/combinators/smart/smart-docs.factor b/basis/combinators/smart/smart-docs.factor index 85545a730c..2b98f5c061 100644 --- a/basis/combinators/smart/smart-docs.factor +++ b/basis/combinators/smart/smart-docs.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: help.markup help.syntax kernel quotations math sequences -multiline stack-checker ; +stack-checker ; IN: combinators.smart HELP: inputarray { $description "Infers the number or outputs from the quotation and constructs an array from those outputs." } { $examples { $example - <" USING: combinators combinators.smart math prettyprint ; + "USING: combinators combinators.smart math prettyprint ; 9 [ { [ 1 - ] [ 1 + ] [ sq ] } cleave -] output>array ."> +] output>array ." "{ 8 10 81 }" } } ; diff --git a/basis/compiler/tests/folding.factor b/basis/compiler/tests/folding.factor index 5050ce1950..ebdee36b70 100644 --- a/basis/compiler/tests/folding.factor +++ b/basis/compiler/tests/folding.factor @@ -1,4 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words +USING: eval tools.test compiler.units vocabs words kernel classes.mixin arrays ; IN: compiler.tests.folding @@ -7,20 +7,18 @@ IN: compiler.tests.folding [ ] [ [ "compiler.tests.redefine11" forget-vocab ] with-compilation-unit ] unit-test [ ] [ - <" - USING: math arrays ; + "USING: math arrays ; IN: compiler.tests.folding GENERIC: foldable-generic ( a -- b ) foldable - M: integer foldable-generic f ; - "> eval( -- ) + M: integer foldable-generic f ;" + eval( -- ) ] unit-test [ ] [ - <" - USING: math arrays ; + "USING: math arrays ; IN: compiler.tests.folding - : fold-test ( -- x ) 10 foldable-generic ; - "> eval( -- ) + : fold-test ( -- x ) 10 foldable-generic ;" + eval( -- ) ] unit-test [ t ] [ diff --git a/basis/compiler/tests/redefine10.factor b/basis/compiler/tests/redefine10.factor index 66edd75097..768b926389 100644 --- a/basis/compiler/tests/redefine10.factor +++ b/basis/compiler/tests/redefine10.factor @@ -1,5 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words -kernel ; +USING: eval tools.test compiler.units vocabs words kernel ; IN: compiler.tests.redefine10 ! Mixin redefinition did not recompile all necessary words. @@ -7,21 +6,19 @@ IN: compiler.tests.redefine10 [ ] [ [ "compiler.tests.redefine10" forget-vocab ] with-compilation-unit ] unit-test [ ] [ - <" - USING: kernel math classes ; + "USING: kernel math classes ; IN: compiler.tests.redefine10 MIXIN: my-mixin INSTANCE: fixnum my-mixin - : my-inline ( a -- b ) dup my-mixin instance? [ 1 + ] when ; - "> eval( -- ) + : my-inline ( a -- b ) dup my-mixin instance? [ 1 + ] when ;" + eval( -- ) ] unit-test [ ] [ - <" - USE: math + "USE: math IN: compiler.tests.redefine10 - INSTANCE: float my-mixin - "> eval( -- ) + INSTANCE: float my-mixin" + eval( -- ) ] unit-test [ 2.0 ] [ diff --git a/basis/compiler/tests/redefine11.factor b/basis/compiler/tests/redefine11.factor index dbec57e3d5..0f16a42cc3 100644 --- a/basis/compiler/tests/redefine11.factor +++ b/basis/compiler/tests/redefine11.factor @@ -1,4 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words +USING: eval tools.test compiler.units vocabs words kernel classes.mixin arrays ; IN: compiler.tests.redefine11 @@ -7,8 +7,7 @@ IN: compiler.tests.redefine11 [ ] [ [ "compiler.tests.redefine11" forget-vocab ] with-compilation-unit ] unit-test [ ] [ - <" - USING: kernel math classes arrays ; + "USING: kernel math classes arrays ; IN: compiler.tests.redefine11 MIXIN: my-mixin INSTANCE: array my-mixin @@ -16,8 +15,8 @@ IN: compiler.tests.redefine11 GENERIC: my-generic ( a -- b ) M: my-mixin my-generic drop 0 ; M: object my-generic drop 1 ; - : my-inline ( -- b ) { } my-generic ; - "> eval( -- ) + : my-inline ( -- b ) { } my-generic ;" + eval( -- ) ] unit-test [ ] [ diff --git a/basis/compiler/tests/redefine5.factor b/basis/compiler/tests/redefine5.factor index 7613987852..38623393e7 100644 --- a/basis/compiler/tests/redefine5.factor +++ b/basis/compiler/tests/redefine5.factor @@ -1,5 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words -kernel ; +USING: eval tools.test compiler.units vocabs words kernel ; IN: compiler.tests.redefine5 ! Regression: if dispatch was eliminated but method was not inlined, @@ -8,22 +7,19 @@ IN: compiler.tests.redefine5 [ "compiler.tests.redefine5" forget-vocab ] with-compilation-unit [ ] [ - <" - USING: sorting kernel math.order ; + "USING: sorting kernel math.order ; IN: compiler.tests.redefine5 GENERIC: my-generic ( a -- b ) M: object my-generic [ <=> ] sort ; - : my-inline ( a -- b ) my-generic ; - "> eval( -- ) + : my-inline ( a -- b ) my-generic ;" + eval( -- ) ] unit-test [ ] [ - <" - USE: kernel + "USE: kernel IN: compiler.tests.redefine5 TUPLE: my-tuple ; - M: my-tuple my-generic drop 0 ; - "> eval( -- ) + M: my-tuple my-generic drop 0 ;" eval( -- ) ] unit-test [ 0 ] [ diff --git a/basis/compiler/tests/redefine6.factor b/basis/compiler/tests/redefine6.factor index fdf3e7edbb..892c768bc5 100644 --- a/basis/compiler/tests/redefine6.factor +++ b/basis/compiler/tests/redefine6.factor @@ -1,4 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words +USING: eval tools.test compiler.units vocabs words kernel ; IN: compiler.tests.redefine6 @@ -7,24 +7,22 @@ IN: compiler.tests.redefine6 [ ] [ [ "compiler.tests.redefine6" forget-vocab ] with-compilation-unit ] unit-test [ ] [ - <" - USING: kernel kernel.private ; + "USING: kernel kernel.private ; IN: compiler.tests.redefine6 GENERIC: my-generic ( a -- b ) MIXIN: my-mixin M: my-mixin my-generic drop 0 ; - : my-inline ( a -- b ) { my-mixin } declare my-generic ; - "> eval( -- ) + : my-inline ( a -- b ) { my-mixin } declare my-generic ;" + eval( -- ) ] unit-test [ ] [ - <" - USING: kernel ; + "USING: kernel ; IN: compiler.tests.redefine6 TUPLE: my-tuple ; M: my-tuple my-generic drop 1 ; - INSTANCE: my-tuple my-mixin - "> eval( -- ) + INSTANCE: my-tuple my-mixin" + eval( -- ) ] unit-test [ 1 ] [ diff --git a/basis/compiler/tests/redefine7.factor b/basis/compiler/tests/redefine7.factor index cfe29603f9..8e7abcb372 100644 --- a/basis/compiler/tests/redefine7.factor +++ b/basis/compiler/tests/redefine7.factor @@ -1,4 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words +USING: eval tools.test compiler.units vocabs words kernel ; IN: compiler.tests.redefine7 @@ -7,21 +7,19 @@ IN: compiler.tests.redefine7 [ ] [ [ "compiler.tests.redefine7" forget-vocab ] with-compilation-unit ] unit-test [ ] [ - <" - USING: kernel math ; + "USING: kernel math ; IN: compiler.tests.redefine7 MIXIN: my-mixin INSTANCE: fixnum my-mixin - : my-inline ( a -- b ) dup my-mixin? [ 1 + ] when ; - "> eval( -- ) + : my-inline ( a -- b ) dup my-mixin? [ 1 + ] when ;" + eval( -- ) ] unit-test [ ] [ - <" - USE: math + "USE: math IN: compiler.tests.redefine7 - INSTANCE: float my-mixin - "> eval( -- ) + INSTANCE: float my-mixin" + eval( -- ) ] unit-test [ 2.0 ] [ diff --git a/basis/compiler/tests/redefine8.factor b/basis/compiler/tests/redefine8.factor index a79bfb5af5..b4deeb3cc1 100644 --- a/basis/compiler/tests/redefine8.factor +++ b/basis/compiler/tests/redefine8.factor @@ -1,4 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words +USING: eval tools.test compiler.units vocabs words kernel ; IN: compiler.tests.redefine8 @@ -7,24 +7,22 @@ IN: compiler.tests.redefine8 [ ] [ [ "compiler.tests.redefine8" forget-vocab ] with-compilation-unit ] unit-test [ ] [ - <" - USING: kernel math math.order sorting ; + "USING: kernel math math.order sorting ; IN: compiler.tests.redefine8 MIXIN: my-mixin INSTANCE: fixnum my-mixin GENERIC: my-generic ( a -- b ) ! We add the bogus quotation here to hinder inlining ! since otherwise we cannot trigger this bug. - M: my-mixin my-generic 1 + [ [ <=> ] sort ] drop ; - "> eval( -- ) + M: my-mixin my-generic 1 + [ [ <=> ] sort ] drop ;" + eval( -- ) ] unit-test [ ] [ - <" - USE: math + "USE: math IN: compiler.tests.redefine8 - INSTANCE: float my-mixin - "> eval( -- ) + INSTANCE: float my-mixin" + eval( -- ) ] unit-test [ 2.0 ] [ diff --git a/basis/compiler/tests/redefine9.factor b/basis/compiler/tests/redefine9.factor index 2598246472..abc677dd77 100644 --- a/basis/compiler/tests/redefine9.factor +++ b/basis/compiler/tests/redefine9.factor @@ -1,4 +1,4 @@ -USING: eval tools.test compiler.units vocabs multiline words +USING: eval tools.test compiler.units vocabs words kernel generic.math ; IN: compiler.tests.redefine9 @@ -7,25 +7,23 @@ IN: compiler.tests.redefine9 [ ] [ [ "compiler.tests.redefine9" forget-vocab ] with-compilation-unit ] unit-test [ ] [ - <" - USING: kernel math math.order sorting ; + "USING: kernel math math.order sorting ; IN: compiler.tests.redefine9 MIXIN: my-mixin INSTANCE: fixnum my-mixin GENERIC: my-generic ( a -- b ) ! We add the bogus quotation here to hinder inlining ! since otherwise we cannot trigger this bug. - M: my-mixin my-generic 1 + [ [ <=> ] sort ] drop ; - "> eval( -- ) + M: my-mixin my-generic 1 + [ [ <=> ] sort ] drop ;" + eval( -- ) ] unit-test [ ] [ - <" - USE: math + "USE: math IN: compiler.tests.redefine9 TUPLE: my-tuple ; - INSTANCE: my-tuple my-mixin - "> eval( -- ) + INSTANCE: my-tuple my-mixin" + eval( -- ) ] unit-test [ diff --git a/basis/db/db-docs.factor b/basis/db/db-docs.factor index e73783fdfc..eb5cc71f81 100644 --- a/basis/db/db-docs.factor +++ b/basis/db/db-docs.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: classes kernel help.markup help.syntax sequences -alien assocs strings math multiline quotations db.private ; +alien assocs strings math quotations db.private ; IN: db HELP: db-connection @@ -251,24 +251,24 @@ ARTICLE: "db-lowlevel-tutorial" "Low-level database tutorial" { $subsection sql-query } "Here's an example usage where we'll make a book table, insert some objects, and query them." $nl "First, let's set up a custom combinator for using our database. See " { $link "db-custom-database-combinators" } " for more details." -{ $code <" +{ $code " USING: db.sqlite db io.files io.files.temp ; : with-book-db ( quot -- ) - "book.db" temp-file swap with-db ; inline"> } + "book.db" temp-file swap with-db ; inline" } "Now let's create the table manually:" -{ $code <" "create table books +{ $code " "create table books (id integer primary key, title text, author text, date_published timestamp, edition integer, cover_price double, condition text)" - [ sql-command ] with-book-db"> } + [ sql-command ] with-book-db" } "Time to insert some books:" -{ $code <" +{ $code " "insert into books (title, author, date_published, edition, cover_price, condition) values('Factor for Sheeple', 'Mister Stacky Pants', date('now'), 1, 13.37, 'mint')" -[ sql-command ] with-book-db"> } +[ sql-command ] with-book-db" } "Now let's select the book:" -{ $code <" -"select id, title, cover_price from books;" [ sql-query ] with-book-db "> } +{ $code " +"select id, title, cover_price from books;" [ sql-query ] with-book-db " } "Notice that the result of this query is a Factor array containing the database rows as arrays of strings. We would have to convert the " { $snippet "cover_price" } " from a string to a number in order to use it in a calculation." $nl "In conclusion, this method of accessing a database is supported, but it is fairly low-level and generally specific to a single database. The " { $vocab-link "db.tuples" } " vocabulary is a good alternative to writing SQL by hand." ; @@ -278,13 +278,13 @@ ARTICLE: "db-custom-database-combinators" "Custom database combinators" "Make a " { $snippet "with-" } " combinator to open and close a database so that resources are not leaked." $nl "SQLite example combinator:" -{ $code <" +{ $code " USING: db.sqlite db io.files io.files.temp ; : with-sqlite-db ( quot -- ) - "my-database.db" temp-file swap with-db ; inline"> } + "my-database.db" temp-file swap with-db ; inline" } "PostgreSQL example combinator:" -{ $code <" USING: db.postgresql db ; +{ $code " USING: db.postgresql db ; : with-postgresql-db ( quot -- ) "localhost" >>host @@ -292,7 +292,7 @@ USING: db.sqlite db io.files io.files.temp ; "erg" >>username "secrets?" >>password "factor-test" >>database - swap with-db ; inline"> + swap with-db ; inline" } ; ABOUT: "db" diff --git a/basis/db/sqlite/sqlite.factor b/basis/db/sqlite/sqlite.factor index 5b658f36c9..ec6c2a1568 100755 --- a/basis/db/sqlite/sqlite.factor +++ b/basis/db/sqlite/sqlite.factor @@ -6,7 +6,7 @@ sequences strings classes.tuple alien.c-types continuations db.sqlite.lib db.sqlite.ffi db.tuples words db.types combinators math.intervals io nmake accessors vectors math.ranges random math.bitwise db.queries destructors db.tuples.private interpolate -io.streams.string multiline make db.private sequences.deep +io.streams.string make db.private sequences.deep db.errors.sqlite ; IN: db.sqlite @@ -201,19 +201,19 @@ M: sqlite-db-connection persistent-table ( -- assoc ) : insert-trigger ( -- string ) [ - <" + " CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id BEFORE INSERT ON ${table-name} FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'insert on table "${table-name}" violates foreign key constraint "fki_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"') WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; END; - "> interpolate + " interpolate ] with-string-writer ; : insert-trigger-not-null ( -- string ) [ - <" + " CREATE TRIGGER fki_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id BEFORE INSERT ON ${table-name} FOR EACH ROW BEGIN @@ -221,24 +221,24 @@ M: sqlite-db-connection persistent-table ( -- assoc ) WHERE NEW.${table-id} IS NOT NULL AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; END; - "> interpolate + " interpolate ] with-string-writer ; : update-trigger ( -- string ) [ - <" + " CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id BEFORE UPDATE ON ${table-name} FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'update on table "${table-name}" violates foreign key constraint "fku_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"') WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; END; - "> interpolate + " interpolate ] with-string-writer ; : update-trigger-not-null ( -- string ) [ - <" + " CREATE TRIGGER fku_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id BEFORE UPDATE ON ${table-name} FOR EACH ROW BEGIN @@ -246,30 +246,30 @@ M: sqlite-db-connection persistent-table ( -- assoc ) WHERE NEW.${table-id} IS NOT NULL AND (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = NEW.${table-id}) IS NULL; END; - "> interpolate + " interpolate ] with-string-writer ; : delete-trigger-restrict ( -- string ) [ - <" + " CREATE TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id BEFORE DELETE ON ${foreign-table-name} FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'delete on table "${foreign-table-name}" violates foreign key constraint "fkd_${table-name}_$table-id}_${foreign-table-name}_${foreign-table-id}_id"') WHERE (SELECT ${foreign-table-id} FROM ${foreign-table-name} WHERE ${foreign-table-id} = OLD.${foreign-table-id}) IS NOT NULL; END; - "> interpolate + " interpolate ] with-string-writer ; : delete-trigger-cascade ( -- string ) - [ - <" + + " CREATE TRIGGER fkd_${table-name}_${table-id}_${foreign-table-name}_${foreign-table-id}_id BEFORE DELETE ON ${foreign-table-name} FOR EACH ROW BEGIN DELETE from ${table-name} WHERE ${table-id} = OLD.${foreign-table-id}; END; - "> interpolate + " interpolate ] with-string-writer ; : can-be-null? ( -- ? ) diff --git a/basis/db/tuples/tuples-docs.factor b/basis/db/tuples/tuples-docs.factor index bd88c56431..4d435e6a89 100644 --- a/basis/db/tuples/tuples-docs.factor +++ b/basis/db/tuples/tuples-docs.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: classes help.markup help.syntax io.streams.string kernel -quotations sequences strings multiline math db.types -db.tuples.private db ; +quotations sequences strings math db.types db.tuples.private db ; IN: db.tuples HELP: random-id-generator @@ -209,7 +208,7 @@ ARTICLE: "db-tuples-tutorial" "Tuple database tutorial" "The title, author, and publisher should be strings; the date-published a timestamp; the edition an integer; the cover-price a float. These are the Factor types for which we will need to look up the corresponding " { $link "db.types" } ". " $nl "To actually bind the tuple slots to the database types, we'll use " { $link define-persistent } "." { $code -<" USING: db.tuples db.types ; +"""USING: db.tuples db.types ; book "BOOK" { { "id" "ID" +db-assigned-id+ } @@ -219,9 +218,9 @@ book "BOOK" { "edition" "EDITION" INTEGER } { "cover-price" "COVER_PRICE" DOUBLE } { "condition" "CONDITION" VARCHAR } -} define-persistent "> } +} define-persistent""" } "That's all we'll have to do with the database for this tutorial. Now let's make a book." -{ $code <" USING: calendar namespaces ; +{ $code """USING: calendar namespaces ; T{ book { title "Factor for Sheeple" } { author "Mister Stacky Pants" } @@ -229,9 +228,9 @@ T{ book { edition 1 } { cover-price 13.37 } } book set -"> } +""" } "Now we've created a book. Let's save it to the database." -{ $code <" USING: db db.sqlite fry io.files ; +{ $code """USING: db db.sqlite fry io.files ; : with-book-tutorial ( quot -- ) '[ "book-tutorial.db" temp-file _ with-db ] call ; @@ -239,25 +238,25 @@ T{ book book recreate-table book get insert-tuple ] with-book-tutorial -"> } +""" } "Is it really there?" -{ $code <" [ +{ $code """[ T{ book { title "Factor for Sheeple" } } select-tuples . -] with-book-tutorial "> } +] with-book-tutorial""" } "Oops, we spilled some orange juice on the book cover." -{ $code <" book get "Small orange juice stain on cover" >>condition "> } +{ $code """book get "Small orange juice stain on cover" >>condition""" } "Now let's save the modified book." -{ $code <" [ +{ $code """[ book get update-tuple -] with-book-tutorial "> } +] with-book-tutorial""" } "And select it again. You can query the database by any field -- just set it in the exemplar tuple you pass to " { $link select-tuples } "." -{ $code <" [ +{ $code """[ T{ book { title "Factor for Sheeple" } } select-tuples -] with-book-tutorial "> } +] with-book-tutorial""" } "Let's drop the table because we're done." -{ $code <" [ +{ $code """[ book drop-table -] with-book-tutorial "> } +] with-book-tutorial""" } "To summarize, the steps for using Factor's tuple database are:" { $list "Make a new tuple to represent your data" diff --git a/basis/delegate/delegate-tests.factor b/basis/delegate/delegate-tests.factor index d9581152e1..17f81708c5 100644 --- a/basis/delegate/delegate-tests.factor +++ b/basis/delegate/delegate-tests.factor @@ -105,20 +105,20 @@ PROTOCOL: silly-protocol do-me ; ! Replacing a method definition with a consultation would cause problems [ [ ] ] [ - <" IN: delegate.tests + "IN: delegate.tests USE: kernel - M: a-tuple do-me drop ; "> "delegate-test" parse-stream + M: a-tuple do-me drop ;" "delegate-test" parse-stream ] unit-test [ ] [ T{ a-tuple } do-me ] unit-test ! Change method definition to consultation [ [ ] ] [ - <" IN: delegate.tests + "IN: delegate.tests USE: kernel USE: delegate - CONSULT: silly-protocol a-tuple drop f ; "> "delegate-test" parse-stream + CONSULT: silly-protocol a-tuple drop f ; " "delegate-test" parse-stream ] unit-test ! Method should be there @@ -126,7 +126,7 @@ PROTOCOL: silly-protocol do-me ; ! Now try removing the consulation [ [ ] ] [ - <" IN: delegate.tests "> "delegate-test" parse-stream + "IN: delegate.tests" "delegate-test" parse-stream ] unit-test ! Method should be gone @@ -139,18 +139,18 @@ SLOT: y [ f ] [ \ slot-protocol-test-3 \ y>> method >boolean ] unit-test [ [ ] ] [ - <" IN: delegate.tests + "IN: delegate.tests USING: accessors delegate ; TUPLE: slot-protocol-test-3 x ; -CONSULT: y>> slot-protocol-test-3 x>> ;"> +CONSULT: y>> slot-protocol-test-3 x>> ;" "delegate-test-1" parse-stream ] unit-test [ t ] [ \ slot-protocol-test-3 \ y>> method >boolean ] unit-test [ [ ] ] [ - <" IN: delegate.tests -TUPLE: slot-protocol-test-3 x y ;"> + "IN: delegate.tests +TUPLE: slot-protocol-test-3 x y ;" "delegate-test-1" parse-stream ] unit-test @@ -160,11 +160,11 @@ TUPLE: slot-protocol-test-3 x y ;"> ! We want to be able to override methods after consultation [ [ ] ] [ - <" IN: delegate.tests + "IN: delegate.tests USING: delegate kernel sequences delegate.protocols accessors ; TUPLE: override-method-test seq ; CONSULT: sequence-protocol override-method-test seq>> ; - M: override-method-test like drop ; "> + M: override-method-test like drop ; " "delegate-test-2" parse-stream ] unit-test @@ -172,10 +172,10 @@ DEFER: seq-delegate ! See if removing a consultation updates protocol-consult word prop [ [ ] ] [ - <" IN: delegate.tests + "IN: delegate.tests USING: accessors delegate delegate.protocols ; TUPLE: seq-delegate seq ; - CONSULT: sequence-protocol seq-delegate seq>> ;"> + CONSULT: sequence-protocol seq-delegate seq>> ;" "remove-consult-test" parse-stream ] unit-test @@ -186,9 +186,9 @@ DEFER: seq-delegate ] unit-test [ [ ] ] [ - <" IN: delegate.tests + "IN: delegate.tests USING: delegate delegate.protocols ; - TUPLE: seq-delegate seq ;"> + TUPLE: seq-delegate seq ;" "remove-consult-test" parse-stream ] unit-test diff --git a/basis/documents/elements/elements-tests.factor b/basis/documents/elements/elements-tests.factor index 9b323ae8e9..70476e16a9 100644 --- a/basis/documents/elements/elements-tests.factor +++ b/basis/documents/elements/elements-tests.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: tools.test namespaces documents documents.elements multiline ; +USING: tools.test namespaces documents documents.elements ; IN: document.elements.tests SYMBOL: doc @@ -56,12 +56,12 @@ SYMBOL: doc ! page-elt doc set -<" First line +"First line Second line Third line Fourth line Fifth line -Sixth line"> doc get set-doc-string +Sixth line" doc get set-doc-string [ { 0 0 } ] [ { 3 3 } doc get 4 prev-elt ] unit-test [ { 1 2 } ] [ { 5 2 } doc get 4 prev-elt ] unit-test diff --git a/basis/functors/functors-tests.factor b/basis/functors/functors-tests.factor index 32d578d05d..0145e8d989 100644 --- a/basis/functors/functors-tests.factor +++ b/basis/functors/functors-tests.factor @@ -1,5 +1,5 @@ USING: classes.struct functors tools.test math words kernel -multiline parser io.streams.string generic ; +parser io.streams.string generic ; IN: functors.tests << @@ -104,14 +104,13 @@ M: integer W 1 + ; ! Does replacing an ordinary word with a functor-generated one work? [ [ ] ] [ - <" IN: functors.tests + "IN: functors.tests TUPLE: some-tuple ; : some-word ( -- ) ; GENERIC: some-generic ( a -- b ) M: some-tuple some-generic ; - SYMBOL: some-symbol - "> "functors-test" parse-stream + SYMBOL: some-symbol" "functors-test" parse-stream ] unit-test : test-redefinition ( -- ) @@ -144,9 +143,8 @@ SYMBOL: W-symbol ;FUNCTOR [ [ ] ] [ - <" IN: functors.tests - << "some" redefine-test >> - "> "functors-test" parse-stream + """IN: functors.tests + << "some" redefine-test >>""" "functors-test" parse-stream ] unit-test test-redefinition diff --git a/basis/furnace/actions/actions-docs.factor b/basis/furnace/actions/actions-docs.factor index 6468b8deb7..f28be1015a 100644 --- a/basis/furnace/actions/actions-docs.factor +++ b/basis/furnace/actions/actions-docs.factor @@ -1,6 +1,6 @@ USING: assocs classes help.markup help.syntax io.streams.string http http.server.dispatchers http.server.responses -furnace.redirection strings multiline html.forms ; +furnace.redirection strings html.forms ; IN: furnace.actions HELP: @@ -53,12 +53,12 @@ HELP: validate-params { $examples "A simple validator from " { $vocab-link "webapps.todo" } "; this word is invoked from the " { $slot "validate" } " quotation of action for editing a todo list item:" { $code - <" : validate-todo ( -- ) + """: validate-todo ( -- ) { { "summary" [ v-one-line ] } { "priority" [ v-integer 0 v-min-value 10 v-max-value ] } { "description" [ v-required ] } - } validate-params ;"> + } validate-params ;""" } } ; diff --git a/basis/furnace/alloy/alloy-docs.factor b/basis/furnace/alloy/alloy-docs.factor index f21fc237a8..7c5a231be8 100644 --- a/basis/furnace/alloy/alloy-docs.factor +++ b/basis/furnace/alloy/alloy-docs.factor @@ -1,5 +1,5 @@ +USING: help.markup help.syntax db ; IN: furnace.alloy -USING: help.markup help.syntax db multiline ; HELP: init-furnace-tables { $description "Initializes database tables used by asides, conversations and session management. This word must be invoked inside a " { $link with-db } " scope." } ; @@ -10,13 +10,13 @@ HELP: { $examples "The " { $vocab-link "webapps.counter" } " vocabulary uses an alloy to configure the counter:" { $code - <" : counter-db ( -- db ) "counter.db" ; + """: counter-db ( -- db ) "counter.db" ; : run-counter ( -- ) counter-db main-responder set-global - 8080 httpd ;"> + 8080 httpd ;""" } } ; diff --git a/basis/furnace/auth/auth-docs.factor b/basis/furnace/auth/auth-docs.factor index efd6a52ef0..21041c416c 100644 --- a/basis/furnace/auth/auth-docs.factor +++ b/basis/furnace/auth/auth-docs.factor @@ -1,7 +1,7 @@ USING: assocs classes help.markup help.syntax kernel quotations strings words words.symbol furnace.auth.providers.db checksums.sha furnace.auth.providers math byte-arrays -http multiline ; +http ; IN: furnace.auth HELP: @@ -149,24 +149,24 @@ ARTICLE: "furnace.auth.users" "User profiles" ARTICLE: "furnace.auth.example" "Furnace authentication example" "The " { $vocab-link "webapps.todo" } " vocabulary wraps all of its responders in a protected responder. The " { $slot "description" } " slot is set so that the login page contains the message “You must log in to view your todo list”:" { $code - <" - "view your todo list" >>description"> + """ + "view your todo list" >>description""" } "The " { $vocab-link "webapps.wiki" } " vocabulary defines a mix of protected and unprotected actions. One example of a protected action is that for deleting wiki pages, an action normally reserved for administrators. This action is protected with the following code:" { $code - <" + """ "delete wiki articles" >>description - { can-delete-wiki-articles? } >>capabilities"> + { can-delete-wiki-articles? } >>capabilities""" } "The " { $vocab-link "websites.concatenative" } " vocabulary wraps all of its responders, including the wiki, in a login authentication realm:" { $code -<" : ( responder -- responder' ) +""": ( responder -- responder' ) "Factor website" "Factor website" >>name allow-registration allow-password-recovery allow-edit-profile - allow-deactivation ;"> + allow-deactivation ;""" } ; ARTICLE: "furnace.auth" "Furnace authentication" diff --git a/basis/help/cookbook/cookbook.factor b/basis/help/cookbook/cookbook.factor index 6bf88f8f03..96193c1ab8 100644 --- a/basis/help/cookbook/cookbook.factor +++ b/basis/help/cookbook/cookbook.factor @@ -1,6 +1,6 @@ USING: help.markup help.syntax io kernel math parser prettyprint sequences vocabs.loader namespaces stack-checker -help command-line multiline see ; +help command-line see ; IN: help.cookbook ARTICLE: "cookbook-syntax" "Basic syntax cookbook" @@ -195,7 +195,7 @@ $nl { $heading "Example: ls" } "Here is an example implementing a simplified version of the Unix " { $snippet "ls" } " command in Factor:" { $code - <" USING: command-line namespaces io io.files + """USING: command-line namespaces io io.files io.pathnames tools.files sequences kernel ; command-line get [ @@ -204,13 +204,13 @@ command-line get [ dup length 1 = [ first directory. ] [ [ [ nl write ":" print ] [ directory. ] bi ] each ] if -] if-empty"> +] if-empty""" } "You can put it in a file named " { $snippet "ls.factor" } ", and then run it, to list the " { $snippet "/usr/bin" } " directory for example:" { $code "./factor ls.factor /usr/bin" } { $heading "Example: grep" } "The following is a more complicated example, implementing something like the Unix " { $snippet "grep" } " command:" -{ $code <" USING: kernel fry io io.files io.encodings.ascii sequences +{ $code """USING: kernel fry io io.files io.encodings.ascii sequences regexp command-line namespaces ; IN: grep @@ -231,7 +231,7 @@ command-line get [ ] [ [ grep-file ] with each ] if-empty -] if-empty"> } +] if-empty""" } "You can run it like so," { $code "./factor grep.factor '.*hello.*' myfile.txt" } "You'll notice this script takes a while to start. This is because it is loading and compiling the " { $vocab-link "regexp" } " vocabulary every time. To speed up startup, load the vocabulary into your image, and save the image:" diff --git a/basis/html/templates/fhtml/fhtml-tests.factor b/basis/html/templates/fhtml/fhtml-tests.factor index 427b3215c1..6179e07859 100644 --- a/basis/html/templates/fhtml/fhtml-tests.factor +++ b/basis/html/templates/fhtml/fhtml-tests.factor @@ -1,5 +1,5 @@ USING: io io.files io.streams.string io.encodings.utf8 -html.templates html.templates.fhtml kernel multiline +html.templates html.templates.fhtml kernel tools.test sequences parser splitting prettyprint ; IN: html.templates.fhtml.tests @@ -20,11 +20,9 @@ IN: html.templates.fhtml.tests [ [ ] [ - <" - <% + """<% IN: html.templates.fhtml.tests : test-word ( -- ) ; - %> - "> parse-template drop + %>""" parse-template drop ] unit-test ] with-file-vocabs diff --git a/basis/http/server/cgi/cgi-docs.factor b/basis/http/server/cgi/cgi-docs.factor index e4ce71f626..edc4103f8c 100644 --- a/basis/http/server/cgi/cgi-docs.factor +++ b/basis/http/server/cgi/cgi-docs.factor @@ -1,4 +1,4 @@ -USING: help.markup help.syntax http.server.static multiline ; +USING: help.markup help.syntax http.server.static ; IN: http.server.cgi HELP: enable-cgi @@ -6,8 +6,8 @@ HELP: enable-cgi { $description "Enables the responder to serve " { $snippet ".cgi" } " scripts by executing them as per the CGI specification." } { $examples { $code - <" - "/var/www/cgi/" enable-cgi "cgi-bin" add-responder" "> + """ + "/var/www/cgi/" enable-cgi "cgi-bin" add-responder""" } } { $side-effects "responder" } ; diff --git a/basis/http/server/dispatchers/dispatchers-docs.factor b/basis/http/server/dispatchers/dispatchers-docs.factor index e0f7f20e69..75c87582f7 100644 --- a/basis/http/server/dispatchers/dispatchers-docs.factor +++ b/basis/http/server/dispatchers/dispatchers-docs.factor @@ -1,7 +1,6 @@ -! Copyright (C) 2008 Your name. +! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: classes help.markup help.syntax io.streams.string -multiline ; +USING: classes help.markup help.syntax io.streams.string ; IN: http.server.dispatchers HELP: new-dispatcher @@ -32,28 +31,28 @@ HELP: add-responder ARTICLE: "http.server.dispatchers.example" "HTTP dispatcher examples" { $heading "Simple pathname dispatcher" } { $code - <" + """ "new" add-responder "edit" add-responder "delete" add-responder "" add-responder -main-responder set-global"> +main-responder set-global""" } "In the above example, visiting any URL other than " { $snippet "/new" } ", " { $snippet "/edit" } ", " { $snippet "/delete" } ", or " { $snippet "/" } " will result in a 404 error." { $heading "Another pathname dispatcher" } "On the other hand, suppose we wanted to route all unrecognized paths to a “view” action:" { $code - <" + """ "new" add-responder "edit" add-responder "delete" add-responder >>default -main-responder set-global"> +main-responder set-global""" } "The " { $slot "default" } " slot holds a responder to which all unrecognized paths are sent to." { $heading "Dispatcher subclassing example" } { $code - <" TUPLE: golf-courses < dispatcher ; + """TUPLE: golf-courses < dispatcher ; : ( -- golf-courses ) golf-courses new-dispatcher ; @@ -63,15 +62,15 @@ main-responder set-global"> "edit" add-responder "delete" add-responder "" add-responder -main-responder set-global"> +main-responder set-global""" } "The action templates can now emit links to responder-relative URLs prefixed by " { $snippet "$golf-courses/" } "." { $heading "Virtual hosting example" } { $code - <" + """ "concatenative-casino.com" add-responder "raptor-dating.com" add-responder -main-responder set-global"> +main-responder set-global""" } "Note that the virtual host dispatcher strips off a " { $snippet "www." } " prefix, so " { $snippet "www.concatenative-casino.com" } " would be routed to the " { $snippet "" } " responder instead of receiving a 404." ; diff --git a/basis/json/reader/reader-tests.factor b/basis/json/reader/reader-tests.factor index 14a54b89c0..79a0e4b5af 100644 --- a/basis/json/reader/reader-tests.factor +++ b/basis/json/reader/reader-tests.factor @@ -1,4 +1,4 @@ -USING: arrays json.reader kernel multiline strings tools.test +USING: arrays json.reader kernel strings tools.test hashtables json ; IN: json.reader.tests @@ -26,26 +26,26 @@ IN: json.reader.tests ! feature to get { -0.0 } [ "-0.0" json> ] unit-test -{ " fuzzy pickles " } [ <" " fuzzy pickles " "> json> ] unit-test -{ "while 1:\n\tpass" } [ <" "while 1:\n\tpass" "> json> ] unit-test +{ " fuzzy pickles " } [ """ " fuzzy pickles " """ json> ] unit-test +{ "while 1:\n\tpass" } [ """ "while 1:\n\tpass" """ json> ] unit-test ! unicode is allowed in json -{ "ß∂¬ƒ˚∆" } [ <" "ß∂¬ƒ˚∆""> json> ] unit-test -{ 8 9 10 12 13 34 47 92 } >string 1array [ <" "\b\t\n\f\r\"\/\\" "> json> ] unit-test -{ HEX: abcd } >string 1array [ <" "\uaBCd" "> json> ] unit-test +{ "ß∂¬ƒ˚∆" } [ """ "ß∂¬ƒ˚∆"""" json> ] unit-test +{ 8 9 10 12 13 34 47 92 } >string 1array [ """ "\\b\\t\\n\\f\\r\\"\\/\\\\" """ json> ] unit-test +{ HEX: abcd } >string 1array [ """ "\\uaBCd" """ json> ] unit-test { H{ { "a" { } } { "b" 123 } } } [ "{\"a\":[],\"b\":123}" json> ] unit-test { { } } [ "[]" json> ] unit-test -{ { 1 "two" 3.0 } } [ <" [1, "two", 3.0] "> json> ] unit-test +{ { 1 "two" 3.0 } } [ """ [1, "two", 3.0] """ json> ] unit-test { H{ } } [ "{}" json> ] unit-test ! the returned hashtable should be different every time { H{ } } [ "key" "value" "{}" json> ?set-at "{}" json> nip ] unit-test -{ H{ { "US$" 1.0 } { "EU€" 1.5 } } } [ <" { "US$":1.00, "EU\u20AC":1.50 } "> json> ] unit-test +{ H{ { "US$" 1.0 } { "EU€" 1.5 } } } [ """ { "US$":1.00, "EU\\u20AC":1.50 } """ json> ] unit-test { H{ { "fib" { 1 1 2 3 5 8 H{ { "etc" "etc" } } } } { "prime" { 2 3 5 7 11 13 } } -} } [ <" { +} } [ """ { "fib": [1, 1, 2, 3, 5, 8, { "etc":"etc" } ], "prime": @@ -53,7 +53,7 @@ IN: json.reader.tests 11, 13 ] } -"> json> ] unit-test +""" json> ] unit-test { 0 } [ " 0" json> ] unit-test { 0 } [ "0 " json> ] unit-test diff --git a/basis/json/writer/writer-tests.factor b/basis/json/writer/writer-tests.factor index 6b6118c443..692a264d0a 100644 --- a/basis/json/writer/writer-tests.factor +++ b/basis/json/writer/writer-tests.factor @@ -1,4 +1,4 @@ -USING: json.writer tools.test multiline json.reader json ; +USING: json.writer tools.test json.reader json ; IN: json.writer.tests { "false" } [ f >json ] unit-test @@ -11,10 +11,10 @@ IN: json.writer.tests { "102.5" } [ 102.5 >json ] unit-test { "[1,\"two\",3.0]" } [ { 1 "two" 3.0 } >json ] unit-test -{ <" {"US$":1.0,"EU€":1.5}"> } [ H{ { "US$" 1.0 } { "EU€" 1.5 } } >json ] unit-test +{ """{"US$":1.0,"EU€":1.5}""" } [ H{ { "US$" 1.0 } { "EU€" 1.5 } } >json ] unit-test ! Random symbols are written simply as strings SYMBOL: testSymbol -{ <" "testSymbol""> } [ testSymbol >json ] unit-test +{ """"testSymbol"""" } [ testSymbol >json ] unit-test -[ { 0.5 } ] [ { 1/2 } >json json> ] unit-test \ No newline at end of file +[ { 0.5 } ] [ { 1/2 } >json json> ] unit-test diff --git a/basis/literals/literals-docs.factor b/basis/literals/literals-docs.factor index 1caa4b746f..3b47d9351f 100644 --- a/basis/literals/literals-docs.factor +++ b/basis/literals/literals-docs.factor @@ -9,21 +9,21 @@ HELP: $ { $notes { $snippet "word" } "'s definition is looked up and " { $link call } "ed at parse time, so words that reference words in the current compilation unit cannot be used with " { $snippet "$" } "." } { $examples - { $example <" + { $example """ USING: kernel literals prettyprint ; IN: scratchpad CONSTANT: five 5 { $ five } . - "> "{ 5 }" } + """ "{ 5 }" } - { $example <" + { $example """ USING: kernel literals prettyprint ; IN: scratchpad : seven-eleven ( -- a b ) 7 11 ; { $ seven-eleven } . - "> "{ 7 11 }" } + """ "{ 7 11 }" } } ; @@ -33,13 +33,13 @@ HELP: $[ { $notes "Since " { $snippet "code" } " is " { $link call } "ed at parse time, it cannot reference any words defined in the same compilation unit." } { $examples - { $example <" + { $example """ USING: kernel literals math prettyprint ; IN: scratchpad << CONSTANT: five 5 >> { $[ five dup 1 + dup 2 + ] } . - "> "{ 5 6 8 }" } + """ "{ 5 6 8 }" } } ; @@ -49,14 +49,14 @@ HELP: ${ { $notes { $snippet "code" } "'s definition is looked up and " { $link call } "ed at parse time, so words that reference words in the current compilation unit cannot be used with " { $snippet "$" } "." } { $examples - { $example <" + { $example """ USING: kernel literals math prettyprint ; IN: scratchpad CONSTANT: five 5 CONSTANT: six 6 ${ five six 7 } . - "> "{ 5 6 7 }" + """ "{ 5 6 7 }" } } ; @@ -64,13 +64,13 @@ ${ five six 7 } . ARTICLE: "literals" "Interpolating code results into literal values" "The " { $vocab-link "literals" } " vocabulary contains words to run code at parse time and insert the results into more complex literal values." -{ $example <" +{ $example """ USE: literals IN: scratchpad CONSTANT: five 5 { $ five $[ five dup 1 + dup 2 + ] } . - "> "{ 5 5 6 8 }" } + """ "{ 5 5 6 8 }" } { $subsection POSTPONE: $ } { $subsection POSTPONE: $[ } { $subsection POSTPONE: ${ } diff --git a/basis/math/blas/config/config-docs.factor b/basis/math/blas/config/config-docs.factor index 60eaff25c2..eadfc3fed0 100644 --- a/basis/math/blas/config/config-docs.factor +++ b/basis/math/blas/config/config-docs.factor @@ -1,4 +1,4 @@ -USING: alien.fortran help.markup help.syntax math.blas.config multiline ; +USING: alien.fortran help.markup help.syntax math.blas.config ; IN: math.blas.config ARTICLE: "math.blas.config" "Configuring the BLAS interface" @@ -6,11 +6,11 @@ ARTICLE: "math.blas.config" "Configuring the BLAS interface" { $subsection blas-library } { $subsection blas-fortran-abi } "The interface attempts to set default values based on the ones encountered on the Factor project's build machines. If these settings don't work with your system's BLAS, or you wish to use a commercial BLAS, you may change the global values of those variables in your " { $link "factor-rc" } ". For example, to use AMD's ACML library on Windows with " { $snippet "math.blas" } ", your " { $snippet "factor-rc" } " would look like this:" -{ $code <" +{ $code """ USING: math.blas.config namespaces ; "X:\\path\\to\\acml.dll" blas-library set-global intel-windows-abi blas-fortran-abi set-global -"> } +""" } "To take effect, the " { $snippet "blas-library" } " and " { $snippet "blas-fortran-abi" } " variables must be set before any other " { $snippet "math.blas" } " vocabularies are loaded." ; diff --git a/basis/math/blas/matrices/matrices-docs.factor b/basis/math/blas/matrices/matrices-docs.factor index 5662cd9905..a42fea3bf6 100644 --- a/basis/math/blas/matrices/matrices-docs.factor +++ b/basis/math/blas/matrices/matrices-docs.factor @@ -1,4 +1,4 @@ -USING: alien byte-arrays help.markup help.syntax math math.blas.vectors sequences strings multiline ; +USING: alien byte-arrays help.markup help.syntax math math.blas.vectors sequences strings ; IN: math.blas.matrices ARTICLE: "math.blas-summary" "Basic Linear Algebra Subroutines (BLAS) interface" @@ -249,39 +249,39 @@ HELP: { $description "Return a vector of zeros with the given " { $snippet "length" } " and the same element type as " { $snippet "v" } "." } ; HELP: smatrix{ -{ $syntax <" smatrix{ +{ $syntax """smatrix{ { 1.0 0.0 0.0 1.0 } { 0.0 1.0 0.0 2.0 } { 0.0 0.0 1.0 3.0 } { 0.0 0.0 0.0 1.0 } -} "> } +}""" } { $description "Construct a literal " { $link float-blas-matrix } ". Note that although BLAS matrices are stored in column-major order, the literal is specified in row-major order." } ; HELP: dmatrix{ -{ $syntax <" dmatrix{ +{ $syntax """dmatrix{ { 1.0 0.0 0.0 1.0 } { 0.0 1.0 0.0 2.0 } { 0.0 0.0 1.0 3.0 } { 0.0 0.0 0.0 1.0 } -} "> } +}""" } { $description "Construct a literal " { $link double-blas-matrix } ". Note that although BLAS matrices are stored in column-major order, the literal is specified in row-major order." } ; HELP: cmatrix{ -{ $syntax <" cmatrix{ +{ $syntax """cmatrix{ { 1.0 0.0 0.0 1.0 } { 0.0 C{ 0.0 1.0 } 0.0 2.0 } { 0.0 0.0 -1.0 3.0 } { 0.0 0.0 0.0 C{ 0.0 -1.0 } } -} "> } +}""" } { $description "Construct a literal " { $link complex-float-blas-matrix } ". Note that although BLAS matrices are stored in column-major order, the literal is specified in row-major order." } ; HELP: zmatrix{ -{ $syntax <" zmatrix{ +{ $syntax """zmatrix{ { 1.0 0.0 0.0 1.0 } { 0.0 C{ 0.0 1.0 } 0.0 2.0 } { 0.0 0.0 -1.0 3.0 } { 0.0 0.0 0.0 C{ 0.0 -1.0 } } -} "> } +}""" } { $description "Construct a literal " { $link complex-double-blas-matrix } ". Note that although BLAS matrices are stored in column-major order, the literal is specified in row-major order." } ; { diff --git a/basis/math/combinatorics/combinatorics-docs.factor b/basis/math/combinatorics/combinatorics-docs.factor index 0e0b7ae167..10584f2004 100644 --- a/basis/math/combinatorics/combinatorics-docs.factor +++ b/basis/math/combinatorics/combinatorics-docs.factor @@ -1,4 +1,4 @@ -USING: help.markup help.syntax kernel math math.order multiline sequences ; +USING: help.markup help.syntax kernel math math.order sequences ; IN: math.combinatorics HELP: factorial @@ -76,14 +76,14 @@ HELP: all-combinations { $examples { $example "USING: math.combinatorics prettyprint ;" "{ \"a\" \"b\" \"c\" \"d\" } 2 all-combinations ." -<" { +"""{ { "a" "b" } { "a" "c" } { "a" "d" } { "b" "c" } { "b" "d" } { "c" "d" } -}"> } } ; +}""" } } ; HELP: each-combination { $values { "seq" sequence } { "k" "a non-negative integer" } { "quot" { $quotation "( seq -- )" } } } diff --git a/basis/math/vectors/simd/simd-docs.factor b/basis/math/vectors/simd/simd-docs.factor index b110de1de8..d35f8589b6 100644 --- a/basis/math/vectors/simd/simd-docs.factor +++ b/basis/math/vectors/simd/simd-docs.factor @@ -1,5 +1,5 @@ USING: help.markup help.syntax sequences math math.vectors -multiline kernel.private classes.tuple.private +kernel.private classes.tuple.private math.vectors.simd.intrinsics cpu.architecture ; IN: math.vectors.simd @@ -71,7 +71,7 @@ $nl $nl "For example, in the following, no SIMD operations are used at all, because the compiler's propagation pass does not consider dynamic variable usage:" { $code -<" USING: compiler.tree.debugger math.vectors +"""USING: compiler.tree.debugger math.vectors math.vectors.simd ; SYMBOLS: x y ; @@ -79,22 +79,22 @@ SYMBOLS: x y ; double-4{ 1.5 2.0 3.7 0.4 } x set double-4{ 1.5 2.0 3.7 0.4 } y set x get y get v+ -] optimizer-report."> } +] optimizer-report.""" } "The following word benefits from SIMD optimization, because it begins with an unsafe declaration:" { $code -<" USING: compiler.tree.debugger kernel.private +"""USING: compiler.tree.debugger kernel.private math.vectors math.vectors.simd ; : interpolate ( v a b -- w ) { float-4 float-4 float-4 } declare [ v* ] [ [ 1.0 ] dip n-v v* ] bi-curry* bi v+ ; -\ interpolate optimizer-report. "> } +\ interpolate optimizer-report.""" } "Note that using " { $link declare } " is not recommended. Safer ways of getting type information for the input parameters to a word include defining methods on a generic word (the value being dispatched upon has a statically known type in the method body), as well as using " { $link "hints" } " and " { $link POSTPONE: inline } " declarations." $nl "Here is a better version of the " { $snippet "interpolate" } " words above that uses hints:" { $code -<" USING: compiler.tree.debugger hints +"""USING: compiler.tree.debugger hints math.vectors math.vectors.simd ; : interpolate ( v a b -- w ) @@ -102,14 +102,14 @@ math.vectors math.vectors.simd ; HINTS: interpolate float-4 float-4 float-4 ; -\ interpolate optimizer-report. "> } +\ interpolate optimizer-report. """ } "This time, the optimizer report lists calls to both SIMD primitives and high-level vector words, because hints cause two code paths to be generated. The " { $snippet "optimized." } " word can be used to make sure that the fast code path consists entirely of calls to primitives." $nl "If the " { $snippet "interpolate" } " word was to be used in several places with different types of vectors, it would be best to declare it " { $link POSTPONE: inline } "." $nl "In the " { $snippet "interpolate" } " word, there is still a call to the " { $link } " primitive, because the return value at the end is being boxed on the heap. In the next example, no memory allocation occurs at all because the SIMD vectors are stored inside a struct class (see " { $link "classes.struct" } "); also note the use of inlining:" { $code -<" USING: compiler.tree.debugger math.vectors math.vectors.simd ; +"""USING: compiler.tree.debugger math.vectors math.vectors.simd ; IN: simd-demo STRUCT: actor @@ -132,13 +132,13 @@ M: actor advance ( dt actor -- ) [ >float ] dip [ update-velocity ] [ update-position ] 2bi ; -M\ actor advance optimized."> +M\ actor advance optimized.""" } "The " { $vocab-link "compiler.cfg.debugger" } " vocabulary can give a lower-level picture of the generated code, that includes register assignments and other low-level details. To look at low-level optimizer output, call " { $snippet "test-mr mr." } " on a word or quotation:" { $code -<" USE: compiler.tree.debugger +"""USE: compiler.tree.debugger -M\ actor advance test-mr mr."> } +M\ actor advance test-mr mr.""" } "An example of a high-performance algorithm that uses SIMD primitives can be found in the " { $vocab-link "benchmark.nbody-simd" } " vocabulary." ; ARTICLE: "math.vectors.simd.intrinsics" "Low-level SIMD primitives" @@ -169,10 +169,10 @@ $nl ARTICLE: "math.vectors.simd.alien" "SIMD data in struct classes" "Struct classes may contain fields which store SIMD data; use one of the following C type names:" { $code -<" float-4 +"""float-4 double-2 float-8 -double-4"> } +double-4""" } "Passing SIMD data as function parameters is not yet supported." ; ARTICLE: "math.vectors.simd" "Hardware vector arithmetic (SIMD)" diff --git a/basis/opengl/capabilities/capabilities-docs.factor b/basis/opengl/capabilities/capabilities-docs.factor index 959b222671..8b43c56f6d 100644 --- a/basis/opengl/capabilities/capabilities-docs.factor +++ b/basis/opengl/capabilities/capabilities-docs.factor @@ -1,5 +1,5 @@ USING: help.markup help.syntax io kernel math quotations -opengl.gl multiline assocs ; +opengl.gl assocs ; IN: opengl.capabilities HELP: gl-version @@ -42,10 +42,10 @@ HELP: has-gl-extensions? { $values { "extensions" "A sequence of extension name strings" } { "?" "A boolean value" } } { $description "Returns true if the set of " { $snippet "extensions" } " is a subset of the implementation-supported extensions returned by " { $link gl-extensions } ". Elements of " { $snippet "extensions" } " can be sequences, in which case true will be returned if any one of the extensions in the subsequence are available." } { $examples "Testing for framebuffer object and pixel buffer support:" - { $code <" { + { $code """{ { "GL_EXT_framebuffer_object" "GL_ARB_framebuffer_object" } "GL_ARB_pixel_buffer_object" -} has-gl-extensions? "> } +} has-gl-extensions?""" } } ; HELP: has-gl-version-or-extensions? diff --git a/basis/opengl/debug/debug-docs.factor b/basis/opengl/debug/debug-docs.factor index 7cb8f9b246..ac666a21c3 100644 --- a/basis/opengl/debug/debug-docs.factor +++ b/basis/opengl/debug/debug-docs.factor @@ -1,15 +1,14 @@ ! (c)2009 Joe Groff bsd license -USING: help.markup help.syntax multiline tools.continuations ; +USING: help.markup help.syntax tools.continuations ; IN: opengl.debug HELP: G { $description "Makes the OpenGL context associated with " { $link G-world } " active for subsequent OpenGL calls. This is intended to be used from the listener, where interactively entered OpenGL calls can be directed to any window. Note that the Factor UI resets the OpenGL context every time a window is updated, so every code snippet entered in the listener must be prefixed with " { $snippet "G" } " in this use case." } -{ $examples { $code <" USING: opengl.debug ui ; +{ $examples { $code """USING: opengl.debug ui ; [ drop t ] find-window G-world set G 0.0 0.0 1.0 1.0 glClearColor -G GL_COLOR_BUFFER_BIT glClear -"> } } ; +G GL_COLOR_BUFFER_BIT glClear""" } } ; HELP: F { $description "Flushes the OpenGL context associated with " { $link G-world } ", thereby committing any outstanding drawing operations." } ; diff --git a/basis/peg/ebnf/ebnf-tests.factor b/basis/peg/ebnf/ebnf-tests.factor index 329156d733..bcd881c03d 100644 --- a/basis/peg/ebnf/ebnf-tests.factor +++ b/basis/peg/ebnf/ebnf-tests.factor @@ -521,10 +521,10 @@ Tok = Spaces (Number | Special ) [ "USE: peg.ebnf [EBNF EBNF]" eval( -- ) ] must-fail -[ <" USE: peg.ebnf [EBNF +[ """USE: peg.ebnf [EBNF lol = a lol = b - EBNF] "> eval( -- ) + EBNF]""" eval( -- ) ] [ error>> [ redefined-rule? ] [ name>> "lol" = ] bi and ] must-fail-with diff --git a/basis/quoted-printable/quoted-printable-tests.factor b/basis/quoted-printable/quoted-printable-tests.factor index abaff9e222..e258cb9a96 100644 --- a/basis/quoted-printable/quoted-printable-tests.factor +++ b/basis/quoted-printable/quoted-printable-tests.factor @@ -1,24 +1,24 @@ ! Copyright (C) 2009 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. -USING: tools.test quoted-printable multiline io.encodings.string +USING: tools.test quoted-printable io.encodings.string sequences io.encodings.8-bit splitting kernel ; IN: quoted-printable.tests -[ <" José was the +[ """José was the person who knew how to write the letters: ő and ü -and we didn't know hów tö do thât"> ] -[ <" Jos=E9 was the +and we didn't know hów tö do thât""" ] +[ """Jos=E9 was the person who knew how to write the letters: =F5 and =FC=20 and w= -e didn't know h=F3w t=F6 do th=E2t"> quoted> latin2 decode ] unit-test +e didn't know h=F3w t=F6 do th=E2t""" quoted> latin2 decode ] unit-test -[ <" Jos=E9 was the=0Aperson who knew how to write the letters:=0A =F5 and =FC=0Aand we didn't know h=F3w t=F6 do th=E2t"> ] -[ <" José was the +[ """Jos=E9 was the=0Aperson who knew how to write the letters:=0A =F5 and =FC=0Aand we didn't know h=F3w t=F6 do th=E2t""" ] +[ """José was the person who knew how to write the letters: ő and ü -and we didn't know hów tö do thât"> latin2 encode >quoted ] unit-test +and we didn't know hów tö do thât""" latin2 encode >quoted ] unit-test : message ( -- str ) 55 [ "hello" ] replicate concat ; diff --git a/basis/regexp/regexp-docs.factor b/basis/regexp/regexp-docs.factor index 3eb4e8a9bf..b8b89626c8 100644 --- a/basis/regexp/regexp-docs.factor +++ b/basis/regexp/regexp-docs.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008, 2009 Doug Coleman, Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. USING: kernel strings help.markup help.syntax math regexp.parser -regexp.ast multiline ; +regexp.ast ; IN: regexp ABOUT: "regexp" @@ -29,9 +29,9 @@ ARTICLE: { "regexp" "intro" } "A quick introduction to regular expressions" "The " { $snippet "+" } " operator matches one or more occurrences of the previous expression; in this case " { $snippet "o" } ". Another useful feature is alternation. Say we want to do this replacement with fooooo or boooo. Then we could use the code" { $code "R/ (f|b)oo+/ \"bar\" re-replace" } "To search a file for all lines that match a given regular expression, you could use code like this:" -{ $code <" "file.txt" ascii file-lines [ R/ (f|b)oo+/ re-contains? ] filter "> } +{ $code """"file.txt" ascii file-lines [ R/ (f|b)oo+/ re-contains? ] filter""" } "To test if a string in its entirety matches a regular expression, the following can be used:" -{ $example <" USE: regexp "fooo" R/ (b|f)oo+/ matches? . "> "t" } +{ $example """USE: regexp "fooo" R/ (b|f)oo+/ matches? .""" "t" } "Regular expressions can't be used for all parsing tasks. For example, they are not powerful enough to match balancing parentheses." ; ARTICLE: { "regexp" "construction" } "Constructing regular expressions" diff --git a/basis/sequences/complex-components/complex-components-docs.factor b/basis/sequences/complex-components/complex-components-docs.factor index 386735aa7d..6209fe535f 100644 --- a/basis/sequences/complex-components/complex-components-docs.factor +++ b/basis/sequences/complex-components/complex-components-docs.factor @@ -1,4 +1,4 @@ -USING: help.markup help.syntax math multiline +USING: help.markup help.syntax math sequences sequences.complex-components ; IN: sequences.complex-components @@ -11,25 +11,22 @@ ABOUT: "sequences.complex-components" HELP: complex-components { $class-description "Sequence wrapper class that transforms a sequence of " { $link complex } " number values into a sequence of " { $link real } " values, interleaving the real and imaginary parts of the complex values in the original sequence." } -{ $examples { $example <" -USING: prettyprint sequences arrays sequences.complex-components ; -{ C{ 1.0 -1.0 } -2.0 C{ 3.0 1.0 } } >array . -"> "{ 1.0 -1.0 -2.0 0 3.0 1.0 }" } } ; +{ $examples { $example """USING: prettyprint sequences arrays sequences.complex-components ; +{ C{ 1.0 -1.0 } -2.0 C{ 3.0 1.0 } } >array .""" +"{ 1.0 -1.0 -2.0 0 3.0 1.0 }" } } ; HELP: { $values { "sequence" sequence } { "complex-components" complex-components } } { $description "Wraps " { $snippet "sequence" } " in a " { $link complex-components } " wrapper." } { $examples -{ $example <" -USING: prettyprint sequences arrays +{ $example """USING: prettyprint sequences arrays sequences.complex-components ; -{ C{ 1.0 -1.0 } -2.0 C{ 3.0 1.0 } } third . -"> "-2.0" } -{ $example <" -USING: prettyprint sequences arrays +{ C{ 1.0 -1.0 } -2.0 C{ 3.0 1.0 } } third .""" +"-2.0" } +{ $example """USING: prettyprint sequences arrays sequences.complex-components ; -{ C{ 1.0 -1.0 } -2.0 C{ 3.0 1.0 } } fourth . -"> "0" } +{ C{ 1.0 -1.0 } -2.0 C{ 3.0 1.0 } } fourth .""" +"0" } } ; { complex-components } related-words diff --git a/basis/sequences/complex/complex-docs.factor b/basis/sequences/complex/complex-docs.factor index 699fd5c4d9..a2f508648d 100644 --- a/basis/sequences/complex/complex-docs.factor +++ b/basis/sequences/complex/complex-docs.factor @@ -1,5 +1,5 @@ -USING: help.markup help.syntax math multiline -sequences sequences.complex ; +USING: help.markup help.syntax math sequences +sequences.complex ; IN: sequences.complex ARTICLE: "sequences.complex" "Complex virtual sequences" @@ -11,21 +11,19 @@ ABOUT: "sequences.complex" HELP: complex-sequence { $class-description "Sequence wrapper class that transforms a sequence of " { $link real } " number values into a sequence of " { $link complex } " values, treating the underlying sequence as pairs of alternating real and imaginary values." } -{ $examples { $example <" -USING: prettyprint specialized-arrays +{ $examples { $example """USING: prettyprint specialized-arrays sequences.complex sequences arrays ; SPECIALIZED-ARRAY: double -double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } >array . -"> "{ C{ 1.0 -1.0 } C{ -2.0 2.0 } C{ 3.0 0.0 } }" } } ; +double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } >array .""" +"{ C{ 1.0 -1.0 } C{ -2.0 2.0 } C{ 3.0 0.0 } }" } } ; HELP: { $values { "sequence" sequence } { "complex-sequence" complex-sequence } } { $description "Wraps " { $snippet "sequence" } " in a " { $link complex-sequence } "." } -{ $examples { $example <" -USING: prettyprint specialized-arrays +{ $examples { $example """USING: prettyprint specialized-arrays sequences.complex sequences arrays ; SPECIALIZED-ARRAY: double -double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } second . -"> "C{ -2.0 2.0 }" } } ; +double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } second .""" +"C{ -2.0 2.0 }" } } ; { complex-sequence } related-words diff --git a/basis/specialized-arrays/specialized-arrays-tests.factor b/basis/specialized-arrays/specialized-arrays-tests.factor index 2698149bac..1b9bd7e2b2 100755 --- a/basis/specialized-arrays/specialized-arrays-tests.factor +++ b/basis/specialized-arrays/specialized-arrays-tests.factor @@ -3,8 +3,8 @@ USING: tools.test alien.syntax specialized-arrays specialized-arrays.private sequences alien.c-types accessors kernel arrays combinators compiler compiler.units classes.struct combinators.smart compiler.tree.debugger math libc destructors -sequences.private multiline eval words vocabs namespaces -assocs prettyprint ; +sequences.private eval words vocabs namespaces assocs +prettyprint ; SPECIALIZED-ARRAY: int SPECIALIZED-ARRAY: bool @@ -124,22 +124,22 @@ SPECIALIZED-ARRAY: fixed-string ] unit-test [ - <" + """ IN: specialized-arrays.tests USING: specialized-arrays ; -SPECIALIZED-ARRAY: __does_not_exist__ "> eval( -- ) +SPECIALIZED-ARRAY: __does_not_exist__ """ eval( -- ) ] must-fail [ ] [ - <" + """ IN: specialized-arrays.tests USING: classes.struct specialized-arrays ; STRUCT: __does_not_exist__ { x int } ; SPECIALIZED-ARRAY: __does_not_exist__ -"> eval( -- ) +""" eval( -- ) ] unit-test [ f ] [ diff --git a/basis/splitting/monotonic/monotonic-docs.factor b/basis/splitting/monotonic/monotonic-docs.factor index 983c5b0dea..0c3e54913b 100644 --- a/basis/splitting/monotonic/monotonic-docs.factor +++ b/basis/splitting/monotonic/monotonic-docs.factor @@ -1,7 +1,6 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: help.markup help.syntax kernel quotations classes sequences -multiline ; +USING: help.markup help.syntax kernel quotations classes sequences ; IN: splitting.monotonic HELP: monotonic-slice @@ -14,7 +13,7 @@ HELP: monotonic-slice { $example "USING: splitting.monotonic math prettyprint ;" "{ 1 2 3 2 3 4 } [ < ] upward-slice monotonic-slice ." - <" { + """{ T{ upward-slice { from 0 } { to 3 } @@ -25,7 +24,7 @@ HELP: monotonic-slice { to 6 } { seq { 1 2 3 2 3 4 } } } -}"> +}""" } } ; @@ -74,7 +73,7 @@ HELP: trends { $example "USING: splitting.monotonic math prettyprint ;" "{ 1 2 3 3 2 1 } trends ." - <" { + """{ T{ upward-slice { from 0 } { to 3 } @@ -90,7 +89,7 @@ HELP: trends { to 6 } { seq { 1 2 3 3 2 1 } } } -}"> +}""" } } ; diff --git a/basis/tools/scaffold/scaffold-tests.factor b/basis/tools/scaffold/scaffold-tests.factor index 4c8698c114..43f62a04e6 100644 --- a/basis/tools/scaffold/scaffold-tests.factor +++ b/basis/tools/scaffold/scaffold-tests.factor @@ -1,20 +1,20 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: tools.test tools.scaffold unicode.case kernel -multiline tools.scaffold.private io.streams.string ; +tools.scaffold.private io.streams.string ; IN: tools.scaffold.tests : undocumented-word ( obj1 obj2 -- obj3 obj4 ) [ >lower ] [ >upper ] bi* ; [ -<" HELP: undocumented-word +"""HELP: undocumented-word { $values { "obj1" object } { "obj2" object } { "obj3" object } { "obj4" object } } { $description "" } ; -"> +""" ] [ [ \ undocumented-word (help.) ] with-string-writer diff --git a/basis/ui/pixel-formats/pixel-formats-docs.factor b/basis/ui/pixel-formats/pixel-formats-docs.factor index b1ab1bc398..ca899cd70f 100644 --- a/basis/ui/pixel-formats/pixel-formats-docs.factor +++ b/basis/ui/pixel-formats/pixel-formats-docs.factor @@ -1,4 +1,4 @@ -USING: destructors help.markup help.syntax kernel math multiline sequences +USING: destructors help.markup help.syntax kernel math sequences vocabs vocabs.parser words namespaces ; IN: ui.pixel-formats @@ -41,7 +41,7 @@ ARTICLE: "ui.pixel-formats-attributes" "Pixel format attributes" { $subsection samples } { $examples "The following " { $link world } " subclass will request a double-buffered window with minimum 24-bit color and depth buffers, and will throw an error if the requirements aren't met:" -{ $code <" +{ $code """ USING: kernel ui.worlds ui.pixel-formats ; IN: ui.pixel-formats.examples @@ -60,7 +60,7 @@ M: picky-depth-buffered-world check-world-pixel-format [ color-bits pixel-format-attribute 24 < [ "Not enough color bits!" throw ] when ] [ depth-bits pixel-format-attribute 24 < [ "Not enough depth bits!" throw ] when ] tri ; -"> } } +""" } } ; HELP: double-buffered diff --git a/basis/urls/encoding/encoding-docs.factor b/basis/urls/encoding/encoding-docs.factor index a021bd6d23..10186227ce 100644 --- a/basis/urls/encoding/encoding-docs.factor +++ b/basis/urls/encoding/encoding-docs.factor @@ -1,5 +1,5 @@ +USING: strings help.markup help.syntax assocs ; IN: urls.encoding -USING: strings help.markup help.syntax assocs multiline ; HELP: url-decode { $values { "str" string } { "decoded" string } } @@ -39,12 +39,12 @@ HELP: query>assoc "USING: prettyprint urls.encoding ;" "\"gender=female&agefrom=22&ageto=28&location=Omaha+NE\"" "query>assoc ." - <" H{ + """H{ { "gender" "female" } { "agefrom" "22" } { "ageto" "28" } { "location" "Omaha NE" } -}"> +}""" } } ; diff --git a/basis/urls/urls-docs.factor b/basis/urls/urls-docs.factor index eb8e452ca4..dd6f8265e6 100644 --- a/basis/urls/urls-docs.factor +++ b/basis/urls/urls-docs.factor @@ -1,6 +1,6 @@ USING: assocs hashtables help.markup help.syntax io.streams.string io.files io.pathnames kernel strings present -math multiline ; +math ; IN: urls HELP: url @@ -112,11 +112,11 @@ HELP: set-query-param } { $examples { $code - <" USING: kernel http.client urls ; + """USING: kernel http.client urls ; URL" http://search.yahooapis.com/WebSearchService/V1/webSearch" clone "concatenative programming (NSFW)" "query" set-query-param "1" "adult_ok" set-query-param -http-get"> +http-get""" } "(For a complete Yahoo! search web service implementation, see the " { $vocab-link "yahoo" } " vocabulary.)" } diff --git a/basis/vocabs/prettyprint/prettyprint-tests.factor b/basis/vocabs/prettyprint/prettyprint-tests.factor index 9ad0aae59d..4da5280115 100644 --- a/basis/vocabs/prettyprint/prettyprint-tests.factor +++ b/basis/vocabs/prettyprint/prettyprint-tests.factor @@ -1,44 +1,44 @@ +USING: vocabs.prettyprint tools.test io.streams.string eval ; IN: vocabs.prettyprint.tests -USING: vocabs.prettyprint tools.test io.streams.string multiline eval ; : manifest-test-1 ( -- string ) - <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ; + """USING: kernel namespaces vocabs.parser vocabs.prettyprint ; - << manifest get pprint-manifest >> "> ; + << manifest get pprint-manifest >>""" ; [ -<" USING: kernel namespaces vocabs.parser vocabs.prettyprint ;"> +"""USING: kernel namespaces vocabs.parser vocabs.prettyprint ;""" ] [ [ manifest-test-1 eval( -- ) ] with-string-writer ] unit-test : manifest-test-2 ( -- string ) - <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ; + """USING: kernel namespaces vocabs.parser vocabs.prettyprint ; IN: vocabs.prettyprint.tests - << manifest get pprint-manifest >> "> ; + << manifest get pprint-manifest >>""" ; [ -<" USING: kernel namespaces vocabs.parser vocabs.prettyprint ; -IN: vocabs.prettyprint.tests"> +"""USING: kernel namespaces vocabs.parser vocabs.prettyprint ; +IN: vocabs.prettyprint.tests""" ] [ [ manifest-test-2 eval( -- ) ] with-string-writer ] unit-test : manifest-test-3 ( -- string ) - <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ; + """USING: kernel namespaces vocabs.parser vocabs.prettyprint ; FROM: math => + - ; QUALIFIED: system QUALIFIED-WITH: assocs a EXCLUDE: parser => run-file ; IN: vocabs.prettyprint.tests - << manifest get pprint-manifest >> "> ; + << manifest get pprint-manifest >>""" ; [ -<" USING: kernel namespaces vocabs.parser vocabs.prettyprint ; +"""USING: kernel namespaces vocabs.parser vocabs.prettyprint ; FROM: math => + - ; QUALIFIED: system QUALIFIED-WITH: assocs a EXCLUDE: parser => run-file ; -IN: vocabs.prettyprint.tests"> +IN: vocabs.prettyprint.tests""" ] -[ [ manifest-test-3 eval( -- ) ] with-string-writer ] unit-test \ No newline at end of file +[ [ manifest-test-3 eval( -- ) ] with-string-writer ] unit-test diff --git a/basis/windows/com/syntax/syntax-docs.factor b/basis/windows/com/syntax/syntax-docs.factor index 62a3c6eaa0..bbfbf39cd1 100644 --- a/basis/windows/com/syntax/syntax-docs.factor +++ b/basis/windows/com/syntax/syntax-docs.factor @@ -1,5 +1,4 @@ -USING: help.markup help.syntax io kernel math quotations -multiline ; +USING: help.markup help.syntax io kernel math quotations ; IN: windows.com.syntax HELP: GUID: @@ -7,14 +6,13 @@ HELP: GUID: { $description "\nCreate a COM globally-unique identifier (GUID) literal at parse time, and push it onto the data stack." } ; HELP: COM-INTERFACE: -{ $syntax <" -COM-INTERFACE: +{ $syntax """COM-INTERFACE: ( ) ( ) ... ; -"> } +""" } { $description "\nFor the interface " { $snippet "" } ", a word " { $snippet "-iid ( -- iid )" } " is defined to push the interface GUID (IID) onto the stack. Words of the form " { $snippet "::" } " are also defined to invoke each method, as well as the methods inherited from " { $snippet "" } ". A " { $snippet "" } " of " { $snippet "f" } " indicates that the interface is a root interface. (Note that COM conventions demand that all interfaces at least inherit from " { $snippet "IUnknown" } ".)\n\nExample:" } -{ $code <" +{ $code """ COM-INTERFACE: IUnknown f {00000000-0000-0000-C000-000000000046} HRESULT QueryInterface ( REFGUID iid, void** ppvObject ) ULONG AddRef ( ) @@ -27,4 +25,4 @@ COM-INTERFACE: ISimple IUnknown {216fb341-0eb2-44b1-8edb-60b76e353abc} COM-INTERFACE: IInherited ISimple {9620ecec-8438-423b-bb14-86f835aa40dd} int getX ( ) void setX ( int newX ) ; -"> } ; +""" } ; diff --git a/basis/windows/com/wrapper/wrapper-docs.factor b/basis/windows/com/wrapper/wrapper-docs.factor index c863bb2762..6a6f6f2bb4 100644 --- a/basis/windows/com/wrapper/wrapper-docs.factor +++ b/basis/windows/com/wrapper/wrapper-docs.factor @@ -1,12 +1,12 @@ USING: help.markup help.syntax io kernel math quotations -multiline alien windows.com windows.com.syntax continuations +alien windows.com windows.com.syntax continuations destructors ; IN: windows.com.wrapper HELP: { $values { "implementations" "an assoc relating COM interface names to arrays of quotations implementing that interface" } { "wrapper" "a " { $link com-wrapper } " tuple" } } { $description "Constructs a " { $link com-wrapper } " tuple. Each key in the " { $snippet "implementations" } " assoc must be the name of an interface defined with " { $link POSTPONE: COM-INTERFACE: } ". The corresponding value must be an array of quotations implementing the methods of that interface in order, including those of its parent interfaces. The " { $snippet "IUnknown" } " methods (" { $link IUnknown::QueryInterface } ", " { $link IUnknown::AddRef } ", and " { $link IUnknown::Release } ") will be defined automatically and must not be specified in the array. These quotations should have stack effects mirroring those of the interface methods being implemented; for example, a method " { $snippet "void foobar ( int foo, int bar )" } " should be implemented with a quotation of effect " { $snippet "( this foo bar -- )" } ". The " { $snippet "this" } " parameter (that is, the leftmost parameter of any COM method) will be automatically converted from an alien pointer to the underlying Factor object before the quotation is invoked.\n\nThe resulting wrapper can be applied to a Factor object using the " { $link com-wrap } " word. The COM interface pointer returned by " { $snippet "com-wrap" } " can then be passed to C functions requiring a COM object as a parameter. The vtables constructed by " { $snippet "" } " are stored on the non-GC heap in order to be accessible to C functions; when the wrapper object and its vtables are no longer needed, the object's resources must be freed using " { $link dispose } ".\n\nExample:" } -{ $code <" +{ $code """ COM-INTERFACE: ISimple IUnknown {216fb341-0eb2-44b1-8edb-60b76e353abc} HRESULT returnOK ( ) HRESULT returnError ( ) ; @@ -30,8 +30,7 @@ COM-INTERFACE: IUnrelated IUnknown {b06ac3f4-30e4-406b-a7cd-c29cead4552c} [ swap x>> + ] ! IUnrelated::xPlus [ spin x>> * + ] ! IUnrealted::xMulAdd } } -} -"> } ; +} """ } ; HELP: com-wrap { $values { "object" "The factor object to wrap" } { "wrapper" "A " { $link com-wrapper } " object" } { "wrapped-object" "A COM object referencing " { $snippet "object" } } } diff --git a/basis/xml/syntax/syntax-docs.factor b/basis/xml/syntax/syntax-docs.factor index 0f04f1b7b2..d0e09663e4 100644 --- a/basis/xml/syntax/syntax-docs.factor +++ b/basis/xml/syntax/syntax-docs.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2005, 2009 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. -USING: help.markup help.syntax xml.data present multiline ; +USING: help.markup help.syntax xml.data present ; IN: xml.syntax ABOUT: "xml.syntax" @@ -50,11 +50,11 @@ ARTICLE: { "xml.syntax" "interpolation" } "XML interpolation syntax" $nl "These forms can be used where a tag might go, as in " { $snippet "[XML <-> XML]" } " or where an attribute might go, as in " { $snippet "[XML /> XML]" } ". When an attribute is spliced in, it is not included if the value is " { $snippet "f" } " and if the value is not a string, the value is put through " { $link present } ". Here is an example of the fry style of XML interpolation:" { $example -{" USING: splitting xml.writer xml.syntax ; +"""USING: splitting xml.writer xml.syntax ; "one two three" " " split [ [XML <-> XML] ] map -<-> XML> pprint-xml"} -{" +<-> XML> pprint-xml""" +""" one @@ -65,10 +65,10 @@ $nl three -"} } +""" } "Here is an example of the locals version:" { $example -{" USING: locals urls xml.syntax xml.writer ; +"""USING: locals urls xml.syntax xml.writer ; [let | number [ 3 ] false [ f ] @@ -82,11 +82,11 @@ $nl url=<-url-> string=<-string-> word=<-word-> /> - XML> pprint-xml ] "} -{" -"} } + XML> pprint-xml ]""" +""" +""" } "XML interpolation can also be used, in conjunction with " { $vocab-link "inverse" } " in pattern matching. For example:" -{ $example {" USING: xml.syntax inverse ; +{ $example """USING: xml.syntax inverse ; : dispatch ( xml -- string ) { { [ [XML <-> XML] ] [ "a" prepend ] } @@ -94,7 +94,7 @@ $nl { [ [XML XML] ] [ "yes" ] } { [ [XML /> XML] ] [ "no" prepend ] } } switch ; -[XML pple XML] dispatch write "} "apple" } ; +[XML pple XML] dispatch write""" "apple" } ; HELP: XML-NS: { $syntax "XML-NS: name http://url" } diff --git a/basis/xml/syntax/syntax-tests.factor b/basis/xml/syntax/syntax-tests.factor index 06ba2028a6..5c1669adb1 100644 --- a/basis/xml/syntax/syntax-tests.factor +++ b/basis/xml/syntax/syntax-tests.factor @@ -47,13 +47,13 @@ XML-NS: foo http://blah.com [ extract-variables ] tri ] unit-test -[ {" +[ """ one y -"} ] [ +""" ] [ [let* | a [ "one" ] c [ "two" ] x [ "y" ] d [ [XML <-x-> XML] ] | +[ """ one @@ -73,14 +73,14 @@ XML-NS: foo http://blah.com three -"} ] [ +""" ] [ "one two three" " " split [ [XML <-> XML] ] map <-> XML> pprint-xml>string ] unit-test -[ {" -"} ] +[ """ +""" ] [ 3 f "http://factorcode.org/" "hello" \ drop false=<-> url=<-> string=<-> word=<->/> XML> pprint-xml>string ] unit-test diff --git a/basis/xml/traversal/traversal-docs.factor b/basis/xml/traversal/traversal-docs.factor index 9f26774647..091f508fce 100644 --- a/basis/xml/traversal/traversal-docs.factor +++ b/basis/xml/traversal/traversal-docs.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2005, 2009 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. -USING: help.markup help.syntax xml.data sequences strings multiline ; +USING: help.markup help.syntax xml.data sequences strings ; IN: xml.traversal ABOUT: "xml.traversal" @@ -22,16 +22,16 @@ ARTICLE: "xml.traversal" "Utilities for traversing XML" ARTICLE: { "xml.traversal" "intro" } "An example of XML processing" "To illustrate how to use the XML library, we develop a simple Atom parser in Factor. Atom is an XML-based syndication format, like RSS. To see the full version of what we develop here, look at " { $snippet "basis/syndication" } " at the " { $snippet "atom1.0" } " word. First, we want to load a file and get a DOM tree for it." -{ $code <" "file.xml" file>xml "> } +{ $code """"file.xml" file>xml""" } "No encoding descriptor is needed, because XML files contain sufficient information to auto-detect the encoding. Next, we want to extract information from the tree. To get the title, we can use the following:" -{ $code <" "title" tag-named children>string "> } +{ $code """"title" tag-named children>string""" } "The " { $link tag-named } " word finds the first tag named " { $snippet "title" } " in the top level (just under the main tag). Then, with a tag on the stack, its children are asserted to be a string, and the string is returned." $nl "For a slightly more complicated example, we can look at how entries are parsed. To get a sequence of tags with the name " { $snippet "entry" } ":" -{ $code <" "entry" tags-named "> } +{ $code """"entry" tags-named""" } "Imagine that, for each of these, we want to get the URL of the entry. In Atom, the URLs are in a " { $snippet "link" } " tag which is contained in the " { $snippet "entry" } " tag. There are multiple " { $snippet "link" } " tags, but one of them contains the attribute " { $snippet "rel=alternate" } ", and the " { $snippet "href" } " attribute has the URL. So, given an element of the sequence produced in the above quotation, we run the code:" -{ $code <" "link" tags-named [ "rel" attr "alternate" = ] find nip "> } +{ $code """"link" tags-named [ "rel" attr "alternate" = ] find nip """ } "to get the link tag on the stack, and" -{ $code <" "href" attr >url "> } +{ $code """"href" attr >url """ } "to extract the URL from it." ; HELP: deep-tag-named diff --git a/basis/xml/writer/writer-docs.factor b/basis/xml/writer/writer-docs.factor index 9971abcdf1..c5a81fb935 100644 --- a/basis/xml/writer/writer-docs.factor +++ b/basis/xml/writer/writer-docs.factor @@ -41,15 +41,15 @@ HELP: pprint-xml HELP: indenter { $var-description "Contains the string which is used for indenting in the XML prettyprinter. For example, to print an XML document using " { $snippet "%%%%" } " for indentation, you can use the following:" } -{ $example {" USING: xml.syntax xml.writer namespaces ; -[XML bar XML] "%%%%" indenter [ pprint-xml ] with-variable "} {" +{ $example """USING: xml.syntax xml.writer namespaces ; +[XML bar XML] "%%%%" indenter [ pprint-xml ] with-variable """ """ %%%%bar -"} } ; +""" } ; HELP: sensitive-tags { $var-description "Contains a sequence of " { $link name } "s where whitespace should be considered significant for prettyprinting purposes. The sequence can contain " { $link string } "s in place of names. For example, to preserve whitespace inside a " { $snippet "pre" } " tag:" } -{ $example {" USING: xml.syntax xml.writer namespaces ; +{ $example """USING: xml.syntax xml.writer namespaces ; [XML something
bing
 bang
    bong
XML] { "pre" } sensitive-tags [ pprint-xml ] with-variable "} {" @@ -64,4 +64,4 @@ bang bang bong -"} } ; +""" } ; diff --git a/basis/xml/writer/writer-tests.factor b/basis/xml/writer/writer-tests.factor index ee09668a53..ad54926a79 100644 --- a/basis/xml/writer/writer-tests.factor +++ b/basis/xml/writer/writer-tests.factor @@ -21,14 +21,14 @@ IN: xml.writer.tests "" reprints-same -{" +""" ]> -bar "} -{" +bar""" +""" ]> -&foo; "} reprints-as +&foo;""" reprints-as -{" +""" @@ -39,15 +39,15 @@ IN: xml.writer.tests ]> bar -"} -{" +""" +""" ]> -&foo;"} pprint-reprints-as +&foo;""" pprint-reprints-as [ t ] [ "" dup string>xml-chunk xml>string = ] unit-test [ "" ] @@ -70,4 +70,4 @@ CONSTANT: test-file "resource:basis/xml/writer/test.xml" [XML <-><-> XML] ] map [XML

Timings

<->
XML] pprint-xml -] unit-test \ No newline at end of file +] unit-test diff --git a/basis/xmode/code2html/code2html-tests.factor b/basis/xmode/code2html/code2html-tests.factor index d57b8ce28d..f00c8a537c 100644 --- a/basis/xmode/code2html/code2html-tests.factor +++ b/basis/xmode/code2html/code2html-tests.factor @@ -6,15 +6,15 @@ kernel io.streams.string xml.writer ; [ ] [ \ (load-mode) reset-memoized ] unit-test [ ] [ - <"