From ed5173863799378c699da426c4cd41348d0bcbf8 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Sun, 29 Dec 2013 03:02:05 -0800 Subject: [PATCH] adding libraries to the repo --- libraries/LIBRARIES | 5 +++++ libraries/iteration-composition.xml | 1 + libraries/list-utilities.xml | 1 + libraries/stream-tools.xml | 1 + libraries/variadic-reporters.xml | 1 + libraries/word-sentence.xml | 1 + 6 files changed, 10 insertions(+) create mode 100644 libraries/LIBRARIES create mode 100644 libraries/iteration-composition.xml create mode 100644 libraries/list-utilities.xml create mode 100644 libraries/stream-tools.xml create mode 100644 libraries/variadic-reporters.xml create mode 100644 libraries/word-sentence.xml diff --git a/libraries/LIBRARIES b/libraries/LIBRARIES new file mode 100644 index 00000000..f11aa852 --- /dev/null +++ b/libraries/LIBRARIES @@ -0,0 +1,5 @@ +iteration-composition Iteration, composition +list-utilities List utilities +stream-tools Streams (lazy lists) +variadic-reporters Variadic reporters +word-sentence Words, sentences diff --git a/libraries/iteration-composition.xml b/libraries/iteration-composition.xml new file mode 100644 index 00000000..0f16bb6e --- /dev/null +++ b/libraries/iteration-composition.xml @@ -0,0 +1 @@ +Call f(f(f(...(f(x))))) n times where the three input slots are n, f, and x from left to right. The # variable can be used inside f to represent how many times f has been called.Call f(f(f(...(f(x))))) until condition is true, where the three input slots are condition, f, and x from left to right. The # variable can be used inside f or condition to indicate how many times f has been called.Returns the function f(g(x)) where f and g are the two inputs.Like the built-in REPEAT UNTIL block, except that the ending condition is not tested until the script has been run the first time. So the script is run at least once.Run the script repeatedly, as long as the given condition is true. Runs the script at least once before testing the condition.Runs the script repeatedly, as long as the condition is true. Tests the condition before the first time the script is run. Like the built in REPEAT UNTIL except that in this block the condition must be true, not false.Runs the script the specified number of times, like the built-in REPEAT block, but this one provides the # variable that can be used inside the script. Try REPEAT (200) MOVE (#) STEPS RIGHT 92 with the pen down. \ No newline at end of file diff --git a/libraries/list-utilities.xml b/libraries/list-utilities.xml new file mode 100644 index 00000000..dc7ee757 --- /dev/null +++ b/libraries/list-utilities.xml @@ -0,0 +1 @@ +Take any number of input lists, and create a new list containing the items of the input lists. So APPEND [A B] [C D] where the [,,,] are lists reports the list [A B C D] not [[A B] [C D]].
11111
Reports a new list containing the items of the input list, but in the opposite order.
1inputresult
Reports a new list whose items are the same as in the input list, except that if two or more equal items appear in the input list, only the last one is kept in the result.
1
Reports a sorted version of the list in its first input slot, using the comparison function in the second input slot. For a list of numbers, using < as the comparison function will sort from low to high; using > will sort from high to low.
1even itemsmerge11#1#2
\ No newline at end of file diff --git a/libraries/stream-tools.xml b/libraries/stream-tools.xml new file mode 100644 index 00000000..66efceca --- /dev/null +++ b/libraries/stream-tools.xml @@ -0,0 +1 @@ +
4234
1datamapmany1data lists
1001
\ No newline at end of file diff --git a/libraries/variadic-reporters.xml b/libraries/variadic-reporters.xml new file mode 100644 index 00000000..d6ae1775 --- /dev/null +++ b/libraries/variadic-reporters.xml @@ -0,0 +1 @@ +Takes any number of numbers as inputs (use the left and right arrowheads to adjust the number of input slots) and reports the result of adding them all, so ISUM (4) (100) (8)) reports 112.1Takes any number of numbers as inputs (use the left and right arrowheads to adjust the number of input slots) and reports the result of multiplying them all, so (PRODUCT (4) (100) (8)) reports 3200.1Takes any number of Boolean (true/false) inputs (use the left and right arrowheads to adjust the number of input slots) and reports TRUE only if all of the inputs are TRUE, otherwise FALSE. Like AND but for multiple inputs.1Takes any number of Boolean (true/false) inputs (use the left and right arrowheads to adjust the number of input slots) and reports TRUE if at least one input is TRUE, otherwise FALSE.1 \ No newline at end of file diff --git a/libraries/word-sentence.xml b/libraries/word-sentence.xml new file mode 100644 index 00000000..ff2a1a73 --- /dev/null +++ b/libraries/word-sentence.xml @@ -0,0 +1 @@ +Takes a text string as input, and reports a new text string containing all but the first character of the input.
resulti2
Takes a text string as input, divides it into words treating one or more spaces as a word separator (only spaces count; punctuation is part of the word) and reports a text string containing all but the first word, with one space between words and no spaces at the beginning or end. (Note: consider using SENTENCE->LIST and processing the resulting list instead of doing recursion on sentences in text string form. List operations are faster.)
Takes a text string as input, and reports a new text string containing all but the last letter of the input.
resulti1
Takes a text string as input, divides it into words treating one or more spaces as a word separator (only spaces count; punctuation is part of the word) and reports a text string containing all but the last word, with one space between words and no spaces at the beginning or end. (Note: consider using SENTENCE->LIST and processing the resulting list instead of doing recursion on sentences in text string form. List operations are faster.)
1 1 11 1
Takes a text string as input, divides it into words treating one or more spaces as a word separator (only spaces count; punctuation is part of the word) and reports a text string containing only the first word, with no spaces before or after it.
Takes a text string as input, and reports the last character in the string.
Takes a text string as input, divides it into words treating one or more spaces as a word separator (only spaces count; punctuation is part of the word) and reports a text string containing only the last word of the input, with no spaces before or after it.
1 1
Takes a text string as input, and reports TRUE if the string has no characters in it of any kind, otherwise false.
Takes a text string as input, and reports TRUE if the input contains no characters other than spaces (therefore, no words when the string is considered as a sentence), otherwise FALSE.
Takes a text string as input, and reports a list in which each item is a single character from the string.
\ No newline at end of file