From 2f06b42750a2277f312a101f1e5d5945eff38230 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 4 Jul 2008 20:59:08 -0700 Subject: [PATCH] Revert "Shorthand syntax for arrays-of-arrays, arrays-of-quotations, and hashtables" This reverts commit 340abc119a0bc073785b2546406780c1f22c5657. --- extra/arrays/nested-syntax/authors.txt | 1 - .../nested-syntax/nested-syntax-docs.factor | 29 ------------------- .../nested-syntax/nested-syntax-tests.factor | 11 ------- .../arrays/nested-syntax/nested-syntax.factor | 10 ------- extra/arrays/nested-syntax/summary.txt | 1 - extra/arrays/nested-syntax/tags.txt | 1 - 6 files changed, 53 deletions(-) delete mode 100644 extra/arrays/nested-syntax/authors.txt delete mode 100644 extra/arrays/nested-syntax/nested-syntax-docs.factor delete mode 100644 extra/arrays/nested-syntax/nested-syntax-tests.factor delete mode 100644 extra/arrays/nested-syntax/nested-syntax.factor delete mode 100644 extra/arrays/nested-syntax/summary.txt delete mode 100644 extra/arrays/nested-syntax/tags.txt diff --git a/extra/arrays/nested-syntax/authors.txt b/extra/arrays/nested-syntax/authors.txt deleted file mode 100644 index f13c9c1e77..0000000000 --- a/extra/arrays/nested-syntax/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Joe Groff diff --git a/extra/arrays/nested-syntax/nested-syntax-docs.factor b/extra/arrays/nested-syntax/nested-syntax-docs.factor deleted file mode 100644 index 7933aa0882..0000000000 --- a/extra/arrays/nested-syntax/nested-syntax-docs.factor +++ /dev/null @@ -1,29 +0,0 @@ -USING: help.markup help.syntax ; -IN: arrays.nested-syntax - -HELP: {{ -{ $syntax "{{ zim zang ;; zoop ;; zidilly zam ;; ... }}" } -{ $description "Shorthand for a literal array of arrays. Subarrays are separated by the " { $link POSTPONE: ;; } " token." } -{ $examples "The following blocks of code push an equivalent array onto the stack:" { $example "{{ 1 ;; 2 3 ;; 4 5 6 }}" } { $example "{ { 1 } { 2 3 } { 4 5 6 } }" } } ; - -HELP: H{{ -{ $syntax "H{{ zim zang ;; zoop zidilly ;; zam zung ;; ... }}" } -{ $description "Shorthand for a literal hashtable. Key-value pairs are separated by the " { $link POSTPONE: ;; } " token." } -{ $examples "The following blocks of code push an equivalent hash table onto the stack:" { $example "H{{ \"Monday\" 1 ;; \"Tuesday\" 2 ;; \"Wednesday\" 3 ;; \"Thursday\" 4 }}" } { $example "H{ { \"Monday\" 1 } { \"Tuesday\" 2 } { \"Wednesday\" 3 } { \"Thursday\" 4 } }" } } ; - -HELP: [[ -{ $syntax "[[ foo ;; bar bas ;; qux quux quuuux ;; ... ]]" } -{ $description "Shorthand for a literal array of quotations. Each quotation is separated by the " { $link POSTPONE: ;; } " token." } -{ $examples "The following blocks of code are equivalent:" { $example "[[ 1+ ;; 2 + ]] cleave" } { $example "{ [ 1+ ] [ 2 + ] } cleave" } } ; - -{ POSTPONE: {{ POSTPONE: H{{ POSTPONE: [[ } related-words - -HELP: ;; -{ $description "Separator token used in the " { $link POSTPONE: {{ } ", " { $link POSTPONE: H{{ } ", and " { $link POSTPONE: [[ } " literal syntaxes." } ; - -HELP: }} -{ $description "Delimiter token used to close the " { $link POSTPONE: {{ } " and " { $link POSTPONE: H{{ } " literal syntaxes." } ; - -HELP: ]] -{ $description "Delimiter token used to close the " { $link POSTPONE: [[ } " literal syntax." } ; - diff --git a/extra/arrays/nested-syntax/nested-syntax-tests.factor b/extra/arrays/nested-syntax/nested-syntax-tests.factor deleted file mode 100644 index a709840be4..0000000000 --- a/extra/arrays/nested-syntax/nested-syntax-tests.factor +++ /dev/null @@ -1,11 +0,0 @@ -USING: arrays.nested-syntax kernel tools.test ; -IN: arrays.nested-syntax.tests - -[ { { 1 } { 2 3 } { 4 5 6 } } ] -[ {{ 1 ;; 2 3 ;; 4 5 6 }} ] unit-test - -[ H{ { "foo" 1 } { "bar" 2 } { "bas" 3 } } ] -[ H{{ "foo" 1 ;; "bar" 2 ;; "bas" 3 }} ] unit-test - -[ { [ drop ] [ nip ] } ] -[ [[ drop ;; nip ]] ] unit-test diff --git a/extra/arrays/nested-syntax/nested-syntax.factor b/extra/arrays/nested-syntax/nested-syntax.factor deleted file mode 100644 index 9fae0fba9f..0000000000 --- a/extra/arrays/nested-syntax/nested-syntax.factor +++ /dev/null @@ -1,10 +0,0 @@ -USING: arrays hashtables kernel parser quotations sequences splitting ; -IN: arrays.nested-syntax - -: ;; ( -- * ) ";; can only be used in [[ ]] , {{ }} , or H{{ }} blocks" throw ; -DEFER: ]] delimiter -DEFER: }} delimiter - -: [[ \ ]] [ { POSTPONE: ;; } split [ >quotation ] map ] parse-literal ; parsing -: {{ \ }} [ { POSTPONE: ;; } split [ >array ] map ] parse-literal ; parsing -: H{{ \ }} [ { POSTPONE: ;; } split >hashtable ] parse-literal ; parsing diff --git a/extra/arrays/nested-syntax/summary.txt b/extra/arrays/nested-syntax/summary.txt deleted file mode 100644 index a8d507f2ca..0000000000 --- a/extra/arrays/nested-syntax/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Shorthand syntax for defining arrays of quotations or arrays of arrays diff --git a/extra/arrays/nested-syntax/tags.txt b/extra/arrays/nested-syntax/tags.txt deleted file mode 100644 index f4274299b1..0000000000 --- a/extra/arrays/nested-syntax/tags.txt +++ /dev/null @@ -1 +0,0 @@ -extensions