]> gitweb.factorcode.org Git - factor.git/commitdiff
move literals vocab to basis
authorJoe Groff <arcata@gmail.com>
Fri, 1 May 2009 03:48:01 +0000 (22:48 -0500)
committerJoe Groff <arcata@gmail.com>
Fri, 1 May 2009 03:48:01 +0000 (22:48 -0500)
12 files changed:
basis/literals/authors.txt [new file with mode: 0644]
basis/literals/literals-docs.factor [new file with mode: 0644]
basis/literals/literals-tests.factor [new file with mode: 0644]
basis/literals/literals.factor [new file with mode: 0644]
basis/literals/summary.txt [new file with mode: 0644]
basis/literals/tags.txt [new file with mode: 0644]
extra/literals/authors.txt [deleted file]
extra/literals/literals-docs.factor [deleted file]
extra/literals/literals-tests.factor [deleted file]
extra/literals/literals.factor [deleted file]
extra/literals/summary.txt [deleted file]
extra/literals/tags.txt [deleted file]

diff --git a/basis/literals/authors.txt b/basis/literals/authors.txt
new file mode 100644 (file)
index 0000000..f13c9c1
--- /dev/null
@@ -0,0 +1 @@
+Joe Groff
diff --git a/basis/literals/literals-docs.factor b/basis/literals/literals-docs.factor
new file mode 100644 (file)
index 0000000..0d61dcb
--- /dev/null
@@ -0,0 +1,61 @@
+! Copyright (C) 2008 Joe Groff.
+! See http://factorcode.org/license.txt for BSD license.
+USING: help.markup help.syntax kernel multiline ;
+IN: literals
+
+HELP: $
+{ $syntax "$ word" }
+{ $description "Executes " { $snippet "word" } " at parse time and adds the result(s) to the parser accumulator." }
+{ $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 <"
+USING: kernel literals prettyprint ;
+IN: scratchpad
+
+CONSTANT: five 5
+{ $ five } .
+    "> "{ 5 }" }
+
+    { $example <"
+USING: kernel literals prettyprint ;
+IN: scratchpad
+
+<< : seven-eleven ( -- a b ) 7 11 ; >>
+{ $ seven-eleven } .
+    "> "{ 7 11 }" }
+
+} ;
+
+HELP: $[
+{ $syntax "$[ code ]" }
+{ $description "Calls " { $snippet "code" } " at parse time and adds the result(s) to the parser accumulator." }
+{ $notes "Since " { $snippet "code" } " is " { $link call } "ed at parse time, it cannot reference any words defined in the same compilation unit." }
+{ $examples
+
+    { $example <"
+USING: kernel literals math prettyprint ;
+IN: scratchpad
+
+<< CONSTANT: five 5 >>
+{ $[ five dup 1+ dup 2 + ] } .
+    "> "{ 5 6 8 }" }
+
+} ;
+
+{ POSTPONE: $ POSTPONE: $[ } related-words
+
+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 <"
+USING: kernel literals math prettyprint ;
+IN: scratchpad
+
+<< CONSTANT: five 5 >>
+{ $ five $[ five dup 1+ dup 2 + ] } .
+    "> "{ 5 5 6 8 }" }
+{ $subsection POSTPONE: $ }
+{ $subsection POSTPONE: $[ }
+;
+
+ABOUT: "literals"
diff --git a/basis/literals/literals-tests.factor b/basis/literals/literals-tests.factor
new file mode 100644 (file)
index 0000000..024c94e
--- /dev/null
@@ -0,0 +1,21 @@
+USING: kernel literals math tools.test ;
+IN: literals.tests
+
+<<
+: six-six-six ( -- a b c ) 6 6 6 ;
+>>
+
+: five ( -- a ) 5 ;
+: seven-eleven ( -- b c ) 7 11 ;
+
+[ { 5 } ] [ { $ five } ] unit-test
+[ { 7 11 } ] [ { $ seven-eleven } ] unit-test
+[ { 6 6 6 } ] [ { $ six-six-six } ] unit-test
+
+[ { 6 6 6 7 } ] [ { $ six-six-six 7 } ] unit-test
+
+[ { 8 8 8 } ] [ { $[ six-six-six [ 2 + ] tri@ ] } ] unit-test
+
+[ { 0.5 2.0 } ] [ { $[ 1.0 2.0 / ] 2.0 } ] unit-test
+
+[ { 1.0 { 0.5 1.5 } 4.0 } ] [ { 1.0 { $[ 1.0 2.0 / ] 1.5 } $[ 2.0 2.0 * ] } ] unit-test
diff --git a/basis/literals/literals.factor b/basis/literals/literals.factor
new file mode 100644 (file)
index 0000000..e55d78a
--- /dev/null
@@ -0,0 +1,6 @@
+! (c) Joe Groff, see license for details
+USING: accessors continuations kernel parser words quotations vectors ;
+IN: literals
+
+SYNTAX: $ scan-word [ def>> call ] curry with-datastack >vector ;
+SYNTAX: $[ parse-quotation with-datastack >vector ;
diff --git a/basis/literals/summary.txt b/basis/literals/summary.txt
new file mode 100644 (file)
index 0000000..dfeb9fe
--- /dev/null
@@ -0,0 +1 @@
+Expression interpolation into sequence literals
diff --git a/basis/literals/tags.txt b/basis/literals/tags.txt
new file mode 100644 (file)
index 0000000..4f4a20b
--- /dev/null
@@ -0,0 +1,2 @@
+extensions
+syntax
diff --git a/extra/literals/authors.txt b/extra/literals/authors.txt
deleted file mode 100644 (file)
index f13c9c1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Joe Groff
diff --git a/extra/literals/literals-docs.factor b/extra/literals/literals-docs.factor
deleted file mode 100644 (file)
index 0d61dcb..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-! Copyright (C) 2008 Joe Groff.
-! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax kernel multiline ;
-IN: literals
-
-HELP: $
-{ $syntax "$ word" }
-{ $description "Executes " { $snippet "word" } " at parse time and adds the result(s) to the parser accumulator." }
-{ $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 <"
-USING: kernel literals prettyprint ;
-IN: scratchpad
-
-CONSTANT: five 5
-{ $ five } .
-    "> "{ 5 }" }
-
-    { $example <"
-USING: kernel literals prettyprint ;
-IN: scratchpad
-
-<< : seven-eleven ( -- a b ) 7 11 ; >>
-{ $ seven-eleven } .
-    "> "{ 7 11 }" }
-
-} ;
-
-HELP: $[
-{ $syntax "$[ code ]" }
-{ $description "Calls " { $snippet "code" } " at parse time and adds the result(s) to the parser accumulator." }
-{ $notes "Since " { $snippet "code" } " is " { $link call } "ed at parse time, it cannot reference any words defined in the same compilation unit." }
-{ $examples
-
-    { $example <"
-USING: kernel literals math prettyprint ;
-IN: scratchpad
-
-<< CONSTANT: five 5 >>
-{ $[ five dup 1+ dup 2 + ] } .
-    "> "{ 5 6 8 }" }
-
-} ;
-
-{ POSTPONE: $ POSTPONE: $[ } related-words
-
-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 <"
-USING: kernel literals math prettyprint ;
-IN: scratchpad
-
-<< CONSTANT: five 5 >>
-{ $ five $[ five dup 1+ dup 2 + ] } .
-    "> "{ 5 5 6 8 }" }
-{ $subsection POSTPONE: $ }
-{ $subsection POSTPONE: $[ }
-;
-
-ABOUT: "literals"
diff --git a/extra/literals/literals-tests.factor b/extra/literals/literals-tests.factor
deleted file mode 100644 (file)
index 024c94e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-USING: kernel literals math tools.test ;
-IN: literals.tests
-
-<<
-: six-six-six ( -- a b c ) 6 6 6 ;
->>
-
-: five ( -- a ) 5 ;
-: seven-eleven ( -- b c ) 7 11 ;
-
-[ { 5 } ] [ { $ five } ] unit-test
-[ { 7 11 } ] [ { $ seven-eleven } ] unit-test
-[ { 6 6 6 } ] [ { $ six-six-six } ] unit-test
-
-[ { 6 6 6 7 } ] [ { $ six-six-six 7 } ] unit-test
-
-[ { 8 8 8 } ] [ { $[ six-six-six [ 2 + ] tri@ ] } ] unit-test
-
-[ { 0.5 2.0 } ] [ { $[ 1.0 2.0 / ] 2.0 } ] unit-test
-
-[ { 1.0 { 0.5 1.5 } 4.0 } ] [ { 1.0 { $[ 1.0 2.0 / ] 1.5 } $[ 2.0 2.0 * ] } ] unit-test
diff --git a/extra/literals/literals.factor b/extra/literals/literals.factor
deleted file mode 100644 (file)
index e55d78a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-! (c) Joe Groff, see license for details
-USING: accessors continuations kernel parser words quotations vectors ;
-IN: literals
-
-SYNTAX: $ scan-word [ def>> call ] curry with-datastack >vector ;
-SYNTAX: $[ parse-quotation with-datastack >vector ;
diff --git a/extra/literals/summary.txt b/extra/literals/summary.txt
deleted file mode 100644 (file)
index dfeb9fe..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Expression interpolation into sequence literals
diff --git a/extra/literals/tags.txt b/extra/literals/tags.txt
deleted file mode 100644 (file)
index 4f4a20b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-extensions
-syntax