Browse code
chore: finish cleaning up utils
Edward authored on 10/03/2021 07:57:27
Showing 1 changed files
Showing 1 changed files
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,86 +0,0 @@ |
1 |
- |
|
2 |
-garnet/src/utils/README |
|
3 |
- |
|
4 |
-This file describes the Lisp utilities available in the "GARNET-UTILS" package. |
|
5 |
-These utilities are supposed to be general-purpose (ie, Garnet-independent). |
|
6 |
-While we hope that they are efficient and bug-free, we cannot make any |
|
7 |
-guarantees -- USE AT YOUR OWN RISK! Finally, if you find any improvements |
|
8 |
-or reasonable additions to these utilities, we very much welcome your input. |
|
9 |
-Please send mail to "garnet-bugs@CS.CMU.EDU". |
|
10 |
- |
|
11 |
-The rest of this file first lists and then describes all of the exported |
|
12 |
-functions in the "GARNET-UTILS" package, listed in alphabetical order. |
|
13 |
-If you add new entries, please follow the established format. |
|
14 |
- |
|
15 |
- ;;;;;;;;;;;;;;;;;; |
|
16 |
- ;; Utils List ;; |
|
17 |
- ;;;;;;;;;;;;;;;;;; |
|
18 |
- |
|
19 |
-add-to-list (element list &optional where locator) |
|
20 |
-do2lists ((var1 list1 var2 list2) &rest body) |
|
21 |
-dolist2 ((var1 var2 list) &rest body) |
|
22 |
-m (s-expr) |
|
23 |
-m1 (s-expr) |
|
24 |
-string+ (&rest args) |
|
25 |
-until (test &rest body) |
|
26 |
-while (test &rest body) |
|
27 |
- |
|
28 |
- ;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
29 |
- ;; Utils Descriptions ;; |
|
30 |
- ;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
31 |
- |
|
32 |
-add-to-list (element list &optional where locator) |
|
33 |
- |
|
34 |
- This adds <element> to <list> according to the <where>/<locator> |
|
35 |
- specification according to the rules described in Garnet's |
|
36 |
- Opal manual for "add-component". This can modify destructively. |
|
37 |
- Ex: (add-to-list element list) |
|
38 |
- (add-to-list element list :head) ; or use :front instead of :head |
|
39 |
- (add-to-list element list :tail) ; or use :back instead of :tail |
|
40 |
- (add-to-list element list :before other-element) |
|
41 |
- (add-to-list element list :after other-element) |
|
42 |
- |
|
43 |
-do2lists ((var1 list1 var2 list2 &key either?) &rest body) |
|
44 |
- |
|
45 |
- This is identical to "dolist", except that it iterates over TWO |
|
46 |
- lists, on each iteration binding <var1> to the first element of |
|
47 |
- <list1> and <var2> to the first element of <list2>. The default |
|
48 |
- behavior is to exit when *BOTH* lists are empty, but if you specify |
|
49 |
- "either?" as T, then it exits when EITHER list is empty. |
|
50 |
- Ex: (do2lists (parent parents child children) |
|
51 |
- (s-value child :parent parent)) |
|
52 |
- |
|
53 |
-dolist2 ((var1 var2 list) &rest body) |
|
54 |
- |
|
55 |
- This is identical to "dolist", except that it iterates TWO |
|
56 |
- variables over the list, on each iteration binding <var1> to |
|
57 |
- the first element and <var2> to the second element. |
|
58 |
- Ex: (dolist2 (slot value '(:left 20 :top 30)) |
|
59 |
- (s-value object slot value)) |
|
60 |
- |
|
61 |
-m (s-expr) |
|
62 |
- |
|
63 |
- This is identical to "macroexpand", except that it does not require |
|
64 |
- you to quote the expression, and it pretty-prints the output. |
|
65 |
- Ex: (m (while my-test my-body)) |
|
66 |
- |
|
67 |
-m1 (s-expr) |
|
68 |
- |
|
69 |
- This is to "macroexpand-1" as "m" is to "macroexpand". |
|
70 |
- Ex: (m1 (while my-test my-body)) |
|
71 |
- |
|
72 |
-string+ (&rest args) |
|
73 |
- |
|
74 |
- String summation -- that is, concatenate the strings together. |
|
75 |
- Ex: (string+ "This" " is " "neat!") |
|
76 |
- |
|
77 |
-until (test &rest body) |
|
78 |
- |
|
79 |
- Execute <body> repeatedly until <test> returns non-NIL. |
|
80 |
- Ex: (let ((x 0)) (until (< x 10) (princ (incf x)))) |
|
81 |
- |
|
82 |
-while (test &rest body) |
|
83 |
- |
|
84 |
- While <test> returns non-NIL, repeatedly execute <body>. |
|
85 |
- Ex: (let ((x 0)) (while (< x 10) (princ (incf x)))) |
|
86 |
- |