From 098be499d27b53fc1aa3a54cf4a2da7a214f3612 Mon Sep 17 00:00:00 2001 From: brianharvey Date: Tue, 29 Dec 2020 21:14:46 -0800 Subject: [PATCH] Update list-utilities.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Speedup via JS primitives and via compiling hofs. New notation: ☠︎in front of title means this block is for internal use, not for users. --- libraries/list-utilities.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/list-utilities.xml b/libraries/list-utilities.xml index db098c5a..732f3dc9 100644 --- a/libraries/list-utilities.xml +++ b/libraries/list-utilities.xml @@ -1 +1 @@ -Reports a new list containing the items of the input list, but in the opposite order.
ca:capgira _ 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.
ca:elimina els duplicats de _ 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.
ca:ordena _ segons criteri _ copy of datasplitmerge11#1#2
The second input is an "association list," a list of two-item lists. Each of those smaller lists has a "key" as its first item and a "value" as its second. ASSOC reports the first key-value pair in the association list whose key matches the first input.
ca:associació _ _ 11
This block carries out the given script for each item of the given list, like the primitive FOR EACH. What's different is that it provides the # variable, which will contain the item number in the list of each item in turn, 1 while processing item 1, and so on.
ca:_ per cada _ de _ _
Takes as input a function of N inputs and N lists. The function is called with item 1 of all the lists as its inputs, with item 2 of all the lists as its inputs, and so on. (The lists should all be the same length.)
ZIP takes any number of lists as inputs. The lists should all be the same length. ZIP reports a list of lists in which the first item is a list of all the first items, the second item is a list of all the second items, etc. Viewing the inputs as the rows of a matrix, ZIP reports its transpose.
position11
The identity function reports its input.
\ No newline at end of file +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.
ca:elimina els duplicats de _ 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.
ca:ordena _ segons criteri _ copy of datasplitmerge11#1#2
The second input is an "association list," a list of two-item lists. Each of those smaller lists has a "key" as its first item and a "value" as its second. ASSOC reports the first key-value pair in the association list whose key matches the first input.
ca:associació _ _ 11
This block carries out the given script for each item of the given list, like the primitive FOR EACH. What's different is that it provides the # variable, which will contain the item number in the list of each item in turn, 1 while processing item 1, and so on.
ca:_ per cada _ de _ _
de:$flash umgekehrt _ pt:$flash uma lista inversa de _ ca:$flash capgira _
1
Takes a (possibly deep) list as input, and reports a human-readable text form of the list (namely, Lisp notation). Will not work on circular lists.
( )
SENTENCE is the main constructor for sentences, represented as lists of words. It takes zero or more inputs, each of which can be either a list or a text string. If a list, the input is assumed to be a list of words. If a text string, it is converted to a list of words using SENTENCE→LIST. Then all the lists of words are appended to form a new list of words. If the inputs are lists of lists rather than lists of words, SENTENCE, like APPEND, does only one level of flattening, reporting a list of all the items of all the input lists.
ZIP takes any number of lists as inputs. The lists should all be the same length. ZIP reports a list of lists in which the first item is a list of all the first items, the second item is a list of all the second items, etc. Viewing the inputs as the rows of a matrix, ZIP reports its transpose.
1
The identity function reports its input.
Takes as input a function of N inputs and N lists. The function is called with item 1 of all the lists as its inputs, with item 2 of all the lists as its inputs, and so on. (The lists should all be the same length.)
Takes a sentence in text string form and reports the sentence as a list of its words.
de:Satz $arrowRight Liste _ ca:frase $arrowRight llista _ es:frase $arrowRight lista _ fr:phrase $arrowRight liste _ pt:uma lista com as palavras da frase _
\ No newline at end of file