nydp 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +77 -56
- data/lib/lisp/core-000.nydp +1 -1
- data/lib/lisp/core-010-precompile.nydp +49 -29
- data/lib/lisp/core-012-utils.nydp +12 -8
- data/lib/lisp/core-015-documentation.nydp +41 -15
- data/lib/lisp/core-017-builtin-dox.nydp +621 -100
- data/lib/lisp/core-020-utils.nydp +33 -6
- data/lib/lisp/core-025-warnings.nydp +1 -1
- data/lib/lisp/core-030-syntax.nydp +64 -48
- data/lib/lisp/core-035-flow-control.nydp +20 -28
- data/lib/lisp/core-037-list-utils.nydp +84 -21
- data/lib/lisp/core-040-utils.nydp +8 -5
- data/lib/lisp/core-041-string-utils.nydp +17 -11
- data/lib/lisp/core-043-list-utils.nydp +140 -77
- data/lib/lisp/core-045-dox-utils.nydp +1 -0
- data/lib/lisp/core-050-test-runner.nydp +8 -12
- data/lib/lisp/core-070-prefix-list.nydp +19 -15
- data/lib/lisp/core-080-pretty-print.nydp +13 -5
- data/lib/lisp/core-090-hook.nydp +11 -11
- data/lib/lisp/core-100-utils.nydp +51 -66
- data/lib/lisp/core-110-hash-utils.nydp +34 -7
- data/lib/lisp/core-120-settings.nydp +14 -9
- data/lib/lisp/core-130-validations.nydp +28 -13
- data/lib/lisp/core-900-benchmarking.nydp +420 -47
- data/lib/lisp/tests/000-empty-args-examples.nydp +5 -0
- data/lib/lisp/tests/andify-examples.nydp +1 -1
- data/lib/lisp/tests/auto-hash-examples.nydp +6 -1
- data/lib/lisp/tests/best-examples.nydp +1 -1
- data/lib/lisp/tests/boot-tests.nydp +1 -1
- data/lib/lisp/tests/date-examples.nydp +129 -102
- data/lib/lisp/tests/destructuring-examples.nydp +1 -1
- data/lib/lisp/tests/dox-tests.nydp +2 -2
- data/lib/lisp/tests/hash-examples.nydp +58 -33
- data/lib/lisp/tests/list-tests.nydp +137 -1
- data/lib/lisp/tests/pretty-print-tests.nydp +12 -0
- data/lib/lisp/tests/rotate-2d-array-examples.nydp +26 -0
- data/lib/lisp/tests/sort-examples.nydp +5 -5
- data/lib/lisp/tests/string-tests.nydp +30 -5
- data/lib/lisp/tests/syntax-tests.nydp +10 -2
- data/lib/lisp/tests/time-examples.nydp +8 -1
- data/lib/lisp/tests/unparse-tests.nydp +13 -7
- data/lib/nydp/assignment.rb +15 -28
- data/lib/nydp/builtin/abs.rb +4 -3
- data/lib/nydp/builtin/apply.rb +8 -10
- data/lib/nydp/builtin/cdr_set.rb +1 -1
- data/lib/nydp/builtin/comment.rb +1 -3
- data/lib/nydp/builtin/date.rb +11 -28
- data/lib/nydp/builtin/divide.rb +3 -10
- data/lib/nydp/builtin/ensuring.rb +6 -21
- data/lib/nydp/builtin/error.rb +2 -4
- data/lib/nydp/builtin/eval.rb +9 -4
- data/lib/nydp/builtin/greater_than.rb +7 -8
- data/lib/nydp/builtin/handle_error.rb +10 -34
- data/lib/nydp/builtin/hash.rb +24 -45
- data/lib/nydp/builtin/inspect.rb +1 -3
- data/lib/nydp/builtin/is_equal.rb +4 -7
- data/lib/nydp/builtin/less_than.rb +6 -7
- data/lib/nydp/builtin/log.rb +7 -0
- data/lib/nydp/builtin/math_ceiling.rb +1 -3
- data/lib/nydp/builtin/math_floor.rb +1 -3
- data/lib/nydp/builtin/math_power.rb +1 -3
- data/lib/nydp/builtin/math_round.rb +2 -2
- data/lib/nydp/builtin/minus.rb +7 -14
- data/lib/nydp/builtin/parse.rb +5 -5
- data/lib/nydp/builtin/parse_in_string.rb +5 -7
- data/lib/nydp/builtin/plus.rb +14 -31
- data/lib/nydp/builtin/pre_compile.rb +1 -3
- data/lib/nydp/builtin/puts.rb +4 -8
- data/lib/nydp/builtin/quit.rb +1 -1
- data/lib/nydp/builtin/rand.rb +6 -11
- data/lib/nydp/builtin/random_string.rb +2 -4
- data/lib/nydp/builtin/rng.rb +25 -0
- data/lib/nydp/builtin/ruby_wrap.rb +27 -14
- data/lib/nydp/builtin/script_run.rb +1 -3
- data/lib/nydp/builtin/set_intersection.rb +3 -4
- data/lib/nydp/builtin/set_union.rb +3 -4
- data/lib/nydp/builtin/sort.rb +2 -7
- data/lib/nydp/builtin/string_match.rb +5 -13
- data/lib/nydp/builtin/string_replace.rb +2 -7
- data/lib/nydp/builtin/string_split.rb +3 -8
- data/lib/nydp/builtin/sym.rb +2 -9
- data/lib/nydp/builtin/thread_locals.rb +2 -2
- data/lib/nydp/builtin/time.rb +38 -44
- data/lib/nydp/builtin/times.rb +6 -15
- data/lib/nydp/builtin/to_integer.rb +8 -14
- data/lib/nydp/builtin/to_string.rb +2 -13
- data/lib/nydp/builtin/type_of.rb +10 -16
- data/lib/nydp/builtin/vm_info.rb +2 -10
- data/lib/nydp/builtin.rb +15 -37
- data/lib/nydp/compiler.rb +29 -19
- data/lib/nydp/cond.rb +95 -88
- data/lib/nydp/context_symbol.rb +11 -9
- data/lib/nydp/core.rb +74 -73
- data/lib/nydp/core_ext.rb +88 -24
- data/lib/nydp/date.rb +22 -19
- data/lib/nydp/error.rb +2 -3
- data/lib/nydp/function_invocation.rb +76 -289
- data/lib/nydp/helper.rb +18 -9
- data/lib/nydp/interpreted_function.rb +159 -25
- data/lib/nydp/lexical_context.rb +9 -8
- data/lib/nydp/lexical_context_builder.rb +1 -1
- data/lib/nydp/literal.rb +3 -7
- data/lib/nydp/loop.rb +72 -0
- data/lib/nydp/namespace.rb +52 -0
- data/lib/nydp/pair.rb +146 -50
- data/lib/nydp/parser.rb +9 -11
- data/lib/nydp/plugin.rb +88 -19
- data/lib/nydp/runner.rb +141 -23
- data/lib/nydp/symbol.rb +16 -26
- data/lib/nydp/symbol_lookup.rb +3 -2
- data/lib/nydp/tokeniser.rb +1 -1
- data/lib/nydp/truth.rb +2 -37
- data/lib/nydp/version.rb +1 -1
- data/lib/nydp.rb +33 -44
- data/nydp.gemspec +2 -1
- data/spec/date_spec.rb +26 -32
- data/spec/embedded_spec.rb +22 -22
- data/spec/error_spec.rb +12 -16
- data/spec/foreign_hash_spec.rb +21 -36
- data/spec/hash_non_hash_behaviour_spec.rb +12 -29
- data/spec/hash_spec.rb +36 -49
- data/spec/literal_spec.rb +6 -6
- data/spec/nydp_spec.rb +14 -14
- data/spec/pair_spec.rb +8 -8
- data/spec/parser_spec.rb +41 -37
- data/spec/rand_spec.rb +1 -4
- data/spec/spec_helper.rb +3 -3
- data/spec/string_atom_spec.rb +15 -16
- data/spec/symbol_spec.rb +27 -52
- data/spec/thread_local_spec.rb +23 -8
- data/spec/time_spec.rb +4 -10
- data/spec/tokeniser_spec.rb +10 -10
- metadata +25 -13
- data/lib/nydp/builtin/modulo.rb +0 -11
- data/lib/nydp/builtin/regexp.rb +0 -7
- data/lib/nydp/builtin/sqrt.rb +0 -7
- data/lib/nydp/builtin/string_pad_left.rb +0 -7
- data/lib/nydp/builtin/string_pad_right.rb +0 -7
- data/lib/nydp/hash.rb +0 -9
- data/lib/nydp/image_store.rb +0 -21
- data/lib/nydp/vm.rb +0 -129
@@ -1,100 +1,621 @@
|
|
1
|
-
(dox
|
2
|
-
(
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
(dox-add-doc '
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
(dox
|
12
|
-
|
13
|
-
(dox-add-doc '
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
(dox
|
20
|
-
|
21
|
-
(dox-add-doc '
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
(dox
|
28
|
-
|
29
|
-
(dox-add-doc '
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
(dox
|
35
|
-
|
36
|
-
(dox-add-doc '
|
37
|
-
|
38
|
-
(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
(dox
|
43
|
-
|
44
|
-
(dox-add-doc '
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
(dox
|
51
|
-
|
52
|
-
(dox-add-doc '
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
(dox
|
66
|
-
|
67
|
-
(dox-add-doc '
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
(dox
|
73
|
-
|
74
|
-
(dox-add-doc '
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
(dox-add-doc '
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
(dox
|
87
|
-
|
88
|
-
(dox-add-doc
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
(dox
|
1
|
+
(mac dox/attrs (chaps)
|
2
|
+
`(hash 'chapters ',(if chaps `(,@chaps) `(,(chapter-current)))
|
3
|
+
'plugin ',this-plugin
|
4
|
+
'file ',this-script))
|
5
|
+
|
6
|
+
(dox-add-doc 'cons
|
7
|
+
'def
|
8
|
+
'("with args a and b, returns a new cons cell, (a . b)")
|
9
|
+
'(a b)
|
10
|
+
nil
|
11
|
+
(dox/attrs (list-manipulation)))
|
12
|
+
|
13
|
+
(dox-add-doc 'car
|
14
|
+
'def
|
15
|
+
'("with args a, where a is a cons cell (x . y), return x."
|
16
|
+
"Commonly used to get the first element of a list")
|
17
|
+
'(a)
|
18
|
+
nil
|
19
|
+
(dox/attrs (list-manipulation)))
|
20
|
+
|
21
|
+
(dox-add-doc 'cdr
|
22
|
+
'def
|
23
|
+
'("with args a, where a is a cons cell (x . y), return y."
|
24
|
+
"Commonly used to get contents of a list, excluding the first element")
|
25
|
+
'(a)
|
26
|
+
nil
|
27
|
+
(dox/attrs (list-manipulation)))
|
28
|
+
|
29
|
+
(dox-add-doc 'log
|
30
|
+
'def
|
31
|
+
'("write arg to Nydp.logger ; be sure to assign Nydp.logger first!")
|
32
|
+
'(arg)
|
33
|
+
nil
|
34
|
+
(dox/attrs (nydp-core)))
|
35
|
+
|
36
|
+
(dox-add-doc '+
|
37
|
+
'def
|
38
|
+
'("with rest-args things, return the sum of the elements of things."
|
39
|
+
"Will also increment dates and concatenate strings and lists")
|
40
|
+
'things
|
41
|
+
nil
|
42
|
+
(dox/attrs (math)))
|
43
|
+
|
44
|
+
(dox-add-doc '-
|
45
|
+
'def
|
46
|
+
'("return the result of subtracting all other args from the first arg."
|
47
|
+
"(- a b c d) is equivalent to (- a (+ b c d))")
|
48
|
+
'things
|
49
|
+
nil
|
50
|
+
(dox/attrs (math)))
|
51
|
+
|
52
|
+
(dox-add-doc '*
|
53
|
+
'def
|
54
|
+
'("with rest-args things, return the product of the elements of things.")
|
55
|
+
'things
|
56
|
+
nil
|
57
|
+
(dox/attrs (math)))
|
58
|
+
|
59
|
+
(dox-add-doc '/
|
60
|
+
'def
|
61
|
+
'("return the result of dividing all other args into the first arg."
|
62
|
+
"(/ a b c d) is equivalent to (/ a (* b c d))")
|
63
|
+
'things
|
64
|
+
nil
|
65
|
+
(dox/attrs (math)))
|
66
|
+
|
67
|
+
(dox-add-doc '>
|
68
|
+
'def
|
69
|
+
'("true if each arg is greater than the next arg")
|
70
|
+
'things
|
71
|
+
nil
|
72
|
+
(dox/attrs (math)))
|
73
|
+
|
74
|
+
(dox-add-doc '<
|
75
|
+
'def
|
76
|
+
'("true if each arg is less than the next arg")
|
77
|
+
'things
|
78
|
+
nil
|
79
|
+
(dox/attrs (math)))
|
80
|
+
|
81
|
+
(dox-add-doc '**
|
82
|
+
'def
|
83
|
+
'("returns a to the power of b")
|
84
|
+
'(a b)
|
85
|
+
nil
|
86
|
+
(dox/attrs (math)))
|
87
|
+
|
88
|
+
(dox-add-doc (sym "⌊")
|
89
|
+
'def
|
90
|
+
'("returns the floor of a (round towards -∞)")
|
91
|
+
'(a)
|
92
|
+
nil
|
93
|
+
(dox/attrs (math)))
|
94
|
+
|
95
|
+
(dox-add-doc (sym "⌈")
|
96
|
+
'def
|
97
|
+
'("returns the ceiling of a (round towards +∞)")
|
98
|
+
'(a)
|
99
|
+
nil
|
100
|
+
(dox/attrs (math)))
|
101
|
+
|
102
|
+
(dox-add-doc 'round
|
103
|
+
'def
|
104
|
+
'("returns a rounded half-away from zero")
|
105
|
+
'(a)
|
106
|
+
nil
|
107
|
+
(dox/attrs (math)))
|
108
|
+
|
109
|
+
(dox-add-doc 'mod
|
110
|
+
'def
|
111
|
+
'("return the remainder after diving a by b")
|
112
|
+
'(a b)
|
113
|
+
nil
|
114
|
+
(dox/attrs (math)))
|
115
|
+
|
116
|
+
(dox-add-doc 'eval
|
117
|
+
'def
|
118
|
+
'("evaluate the given lisp expression")
|
119
|
+
'(expr)
|
120
|
+
nil
|
121
|
+
(dox/attrs (nydp-core)))
|
122
|
+
|
123
|
+
(dox-add-doc 'hash
|
124
|
+
'def
|
125
|
+
'("create a new Hash instance")
|
126
|
+
nil
|
127
|
+
nil
|
128
|
+
(dox/attrs (hash-manipulation)))
|
129
|
+
|
130
|
+
(dox-add-doc 'apply
|
131
|
+
'def
|
132
|
+
'("invoke f with args 'args")
|
133
|
+
'(f . args)
|
134
|
+
nil
|
135
|
+
(dox/attrs (nydp-core)))
|
136
|
+
|
137
|
+
(dox-add-doc 'date
|
138
|
+
'def
|
139
|
+
'("create a new date instance")
|
140
|
+
'(year month day)
|
141
|
+
nil
|
142
|
+
(dox/attrs (date-time)))
|
143
|
+
|
144
|
+
(dox-add-doc 'error
|
145
|
+
'def
|
146
|
+
'("raise an exception")
|
147
|
+
'args
|
148
|
+
nil
|
149
|
+
(dox/attrs (flow-control)))
|
150
|
+
|
151
|
+
(dox-add-doc 'parse
|
152
|
+
'def
|
153
|
+
'("parse the given string and return the corresponding lisp objects")
|
154
|
+
'(str)
|
155
|
+
nil
|
156
|
+
(dox/attrs (nydp-core)))
|
157
|
+
|
158
|
+
(dox-add-doc 'p
|
159
|
+
'def
|
160
|
+
'("print a message on $stdout")
|
161
|
+
'args
|
162
|
+
nil
|
163
|
+
(dox/attrs (nydp-core)))
|
164
|
+
|
165
|
+
(dox-add-doc 'sort
|
166
|
+
'def
|
167
|
+
'("return 'things, sorted according to their natural sort order")
|
168
|
+
'things
|
169
|
+
nil
|
170
|
+
(dox/attrs (list-manipulation)))
|
171
|
+
|
172
|
+
(dox-add-doc 'sqrt
|
173
|
+
'def
|
174
|
+
'("return the square root of 'arg")
|
175
|
+
'(arg)
|
176
|
+
nil
|
177
|
+
(dox/attrs (math)))
|
178
|
+
|
179
|
+
(dox-add-doc 'ln
|
180
|
+
'def
|
181
|
+
'("return the natural logarithm of 'arg")
|
182
|
+
'(arg)
|
183
|
+
nil
|
184
|
+
(dox/attrs (math)))
|
185
|
+
|
186
|
+
(dox-add-doc 'sym
|
187
|
+
'def
|
188
|
+
'("return the symbol for the given string 'arg")
|
189
|
+
'(arg)
|
190
|
+
nil
|
191
|
+
(dox/attrs (nydp-core)))
|
192
|
+
|
193
|
+
(dox-add-doc 'list
|
194
|
+
'def
|
195
|
+
'("returns args as a list")
|
196
|
+
'args
|
197
|
+
nil
|
198
|
+
(dox/attrs (nydp-core)))
|
199
|
+
|
200
|
+
(dox-add-doc 'noop
|
201
|
+
'def
|
202
|
+
'("does nothing; returns nil")
|
203
|
+
nil
|
204
|
+
nil
|
205
|
+
(dox/attrs (nydp-core)))
|
206
|
+
|
207
|
+
(dox-add-doc 'x1
|
208
|
+
'def
|
209
|
+
'("just returns arg; the identity function")
|
210
|
+
'(arg)
|
211
|
+
nil
|
212
|
+
(dox/attrs (nydp-core)))
|
213
|
+
|
214
|
+
(dox-add-doc 'caar
|
215
|
+
'def
|
216
|
+
'("car of car; same as (car (car arg))")
|
217
|
+
'(arg)
|
218
|
+
nil
|
219
|
+
(dox/attrs (nydp-core)))
|
220
|
+
|
221
|
+
(dox-add-doc 'cadr
|
222
|
+
'def
|
223
|
+
'("car of cdr; same as (car (cdr arg))")
|
224
|
+
'(arg)
|
225
|
+
nil
|
226
|
+
(dox/attrs (nydp-core)))
|
227
|
+
|
228
|
+
(dox-add-doc 'cdar
|
229
|
+
'def
|
230
|
+
'("cdr of car; same as (cdr (car arg))")
|
231
|
+
'(arg)
|
232
|
+
nil
|
233
|
+
(dox/attrs (nydp-core)))
|
234
|
+
|
235
|
+
(dox-add-doc 'cddr
|
236
|
+
'def
|
237
|
+
'("cdr of cdr; same as (cdr (cdr arg))")
|
238
|
+
'(arg)
|
239
|
+
nil
|
240
|
+
(dox/attrs (nydp-core)))
|
241
|
+
|
242
|
+
(dox-add-doc 'no
|
243
|
+
'def
|
244
|
+
'("t if arg is nil, nil otherwise")
|
245
|
+
'(arg)
|
246
|
+
nil
|
247
|
+
(dox/attrs (nydp-core)))
|
248
|
+
|
249
|
+
(dox-add-doc 'just
|
250
|
+
'def
|
251
|
+
'("just returns arg; the identity function")
|
252
|
+
'(arg)
|
253
|
+
nil
|
254
|
+
(dox/attrs (nydp-core)))
|
255
|
+
|
256
|
+
(dox-add-doc 'isa
|
257
|
+
'def
|
258
|
+
'("t if (type-of obj) is equal to type")
|
259
|
+
'(type obj)
|
260
|
+
nil
|
261
|
+
(dox/attrs (nydp-core)))
|
262
|
+
|
263
|
+
(dox-add-doc 'pair?
|
264
|
+
'def
|
265
|
+
'("t if arg is a cons cell or (equivalently) the start of a list")
|
266
|
+
'(arg)
|
267
|
+
nil
|
268
|
+
(dox/attrs (nydp-core)))
|
269
|
+
|
270
|
+
(dox-add-doc 'hash?
|
271
|
+
'def
|
272
|
+
'("t if arg is a hash")
|
273
|
+
'(arg)
|
274
|
+
nil
|
275
|
+
(dox/attrs (nydp-core)))
|
276
|
+
|
277
|
+
(dox-add-doc 'sym?
|
278
|
+
'def
|
279
|
+
'("t if arg is a symbol, nil otherwise")
|
280
|
+
'(arg)
|
281
|
+
nil
|
282
|
+
(dox/attrs (nydp-core)))
|
283
|
+
|
284
|
+
(dox-add-doc 'ensuring
|
285
|
+
'def
|
286
|
+
'("execute 'try-f, then 'ensure-f afterwards"
|
287
|
+
"'ensure-f will always be executed, even if there is an error in 'try-f"
|
288
|
+
"returns the return value of 'try-f. Similar to try/finally in java, or begin/ensure in ruby.")
|
289
|
+
'(ensure-f try-f)
|
290
|
+
nil
|
291
|
+
(dox/attrs (flow-control)))
|
292
|
+
|
293
|
+
(dox-add-doc 'inspect
|
294
|
+
'def
|
295
|
+
'("return a string representing 'arg, potentially (but not always) in a way that "
|
296
|
+
"can be parsed back in to get the original object")
|
297
|
+
'(arg)
|
298
|
+
nil
|
299
|
+
(dox/attrs (nydp-core)))
|
300
|
+
|
301
|
+
(dox-add-doc 'comment
|
302
|
+
'def
|
303
|
+
'("does nothing at all." "Intercepted inside 'def and 'mac and used for documentation")
|
304
|
+
'(arg)
|
305
|
+
nil
|
306
|
+
(dox/attrs (nydp-core)))
|
307
|
+
|
308
|
+
(dox-add-doc 'parse-in-string
|
309
|
+
'def
|
310
|
+
'("parse the given string assuming a string-open delimiter has already been encountered")
|
311
|
+
'(str)
|
312
|
+
nil
|
313
|
+
(dox/attrs (nydp-core)))
|
314
|
+
|
315
|
+
(dox-add-doc 'rand
|
316
|
+
'def
|
317
|
+
'("return a random number ; with no args, between 0 and 1"
|
318
|
+
"with 1 arg, an integer less than arg"
|
319
|
+
"with two args, an integer >= arg 0 and < arg 1")
|
320
|
+
'args
|
321
|
+
nil
|
322
|
+
(dox/attrs (math)))
|
323
|
+
|
324
|
+
(dox-add-doc 'rng
|
325
|
+
'def
|
326
|
+
'("return a random number generator ; with no args, uses a random seed."
|
327
|
+
"with 1 arg, seeds the rng with that number, for a reproducible sequence of random numbers."
|
328
|
+
"the returned rng is a function which can be called like (rand) ; eg. (let r (rng) (list (r) (r) (r))) ; returns a list of 3 random numbers")
|
329
|
+
'args
|
330
|
+
nil
|
331
|
+
(dox/attrs (math)))
|
332
|
+
|
333
|
+
(dox-add-doc 'random-string
|
334
|
+
'def
|
335
|
+
'("return a random string of length 'len (default 10)")
|
336
|
+
'(len)
|
337
|
+
nil
|
338
|
+
(dox/attrs (string-manipulation)))
|
339
|
+
|
340
|
+
(dox-add-doc 'regexp
|
341
|
+
'def
|
342
|
+
'("return a regular expression compiled from the given string")
|
343
|
+
'(str)
|
344
|
+
nil
|
345
|
+
(dox/attrs (string-manipulation)))
|
346
|
+
|
347
|
+
(dox-add-doc 'to-string
|
348
|
+
'def
|
349
|
+
'("return a human-readable string representation of 'arg")
|
350
|
+
'(arg)
|
351
|
+
nil
|
352
|
+
(dox/attrs (string-manipulation)))
|
353
|
+
|
354
|
+
(dox-add-doc 'string-length
|
355
|
+
'def
|
356
|
+
'("return the length of 'arg")
|
357
|
+
'(arg)
|
358
|
+
nil
|
359
|
+
(dox/attrs (string-manipulation)))
|
360
|
+
|
361
|
+
(dox-add-doc 'string/pad-left
|
362
|
+
'def
|
363
|
+
'("return a new string with 'padding added to the left of 'str such that is 'length characters long")
|
364
|
+
'(str length padding)
|
365
|
+
nil
|
366
|
+
(dox/attrs (string-manipulation)))
|
367
|
+
|
368
|
+
(dox-add-doc 'string/pad-right
|
369
|
+
'def
|
370
|
+
'("return a new string with 'padding added to the right of 'str such that is 'length characters long")
|
371
|
+
'(str length padding)
|
372
|
+
nil
|
373
|
+
(dox/attrs (string-manipulation)))
|
374
|
+
|
375
|
+
(dox-add-doc 'string/force-encoding
|
376
|
+
'def
|
377
|
+
'("send ruby's native #force_encoding to the string argument")
|
378
|
+
'(str encoding)
|
379
|
+
nil
|
380
|
+
(dox/attrs (string-manipulation)))
|
381
|
+
|
382
|
+
(dox-add-doc 'string-replace
|
383
|
+
'def
|
384
|
+
'("replace 'pattern with 'replacement in 'str")
|
385
|
+
'(pattern replacement str)
|
386
|
+
nil
|
387
|
+
(dox/attrs (string-manipulation)))
|
388
|
+
|
389
|
+
(dox-add-doc 'string-split
|
390
|
+
'def
|
391
|
+
'("split 'str delimited by 'delim")
|
392
|
+
'(str delim)
|
393
|
+
nil
|
394
|
+
(dox/attrs (string-manipulation)))
|
395
|
+
|
396
|
+
(dox-add-doc 'string-match
|
397
|
+
'def
|
398
|
+
'("if 'str matches 'pattern, return hash with keys 'match and 'captures ; otherwise nil")
|
399
|
+
'(str pattern)
|
400
|
+
nil
|
401
|
+
(dox/attrs (string-manipulation)))
|
402
|
+
|
403
|
+
(dox-add-doc 'to-list
|
404
|
+
'def
|
405
|
+
'("tries to convert 'thing to a list (for Hash instances, returns a list of two-element lists)")
|
406
|
+
'(thing)
|
407
|
+
nil
|
408
|
+
(dox/attrs (string-manipulation)))
|
409
|
+
|
410
|
+
(dox-add-doc 'time
|
411
|
+
'def
|
412
|
+
'("with no args, return the current time."
|
413
|
+
"With one arg, if 'arg-0 is a number, return the current time plus 'arg-0 seconds."
|
414
|
+
"With one arg, if 'arg-0 is a date, return the time at the beginning of the given date."
|
415
|
+
"With one arg, if 'arg-0 is a time, return the number of seconds between 'arg-0 and now."
|
416
|
+
"With two args, 'arg-0 must be a time."
|
417
|
+
"If 'arg-1 is a number, return 'arg-0 plus 'arg-1 seconds as a time object."
|
418
|
+
"If 'arg-1 is a time, return the number of seconds between the two (- 'arg-0 arg-1)."
|
419
|
+
"Otherwise, expect 3 or more args, to construct a time from"
|
420
|
+
"year, month, date, hours, minutes, seconds, milliseconds, reading arguments in that order,"
|
421
|
+
"where hours, minutes, seconds, and milliseconds are optional")
|
422
|
+
'args
|
423
|
+
nil
|
424
|
+
(dox/attrs (date-time)))
|
425
|
+
|
426
|
+
(dox-add-doc 'thread-locals
|
427
|
+
'def
|
428
|
+
'("return a hash bound to the current thread")
|
429
|
+
nil
|
430
|
+
nil
|
431
|
+
(dox/attrs (nydp-core)))
|
432
|
+
|
433
|
+
(dox-add-doc 'type-of
|
434
|
+
'def
|
435
|
+
'("return a symbol for the type of 'arg")
|
436
|
+
'(arg)
|
437
|
+
nil
|
438
|
+
(dox/attrs (nydp-core)))
|
439
|
+
|
440
|
+
(dox-add-doc 'eq?
|
441
|
+
'def
|
442
|
+
'("return 't if 'arg-0 and 'arg-1 are equal, nil otherwise")
|
443
|
+
'(arg-0 arg-1)
|
444
|
+
nil
|
445
|
+
(dox/attrs (nydp-core)))
|
446
|
+
|
447
|
+
(dox-add-doc 'cdr-set
|
448
|
+
'def
|
449
|
+
'("set the cdr of the given 'cell to 'arg, returns 'cell")
|
450
|
+
'(cell arg)
|
451
|
+
nil
|
452
|
+
(dox/attrs (list-manipulation)))
|
453
|
+
|
454
|
+
(dox-add-doc 'hash-get
|
455
|
+
'def
|
456
|
+
'("return the value stored by 'key in 'hsh")
|
457
|
+
'(hsh key)
|
458
|
+
nil
|
459
|
+
(dox/attrs (hash-manipulation)))
|
460
|
+
|
461
|
+
(dox-add-doc 'hash-set
|
462
|
+
'def
|
463
|
+
'("store 'val under 'key in 'hsh, return 'val")
|
464
|
+
'(hsh key val)
|
465
|
+
nil
|
466
|
+
(dox/attrs (hash-manipulation)))
|
467
|
+
|
468
|
+
(dox-add-doc 'hash-keys
|
469
|
+
'def
|
470
|
+
'("return the list of keys in 'hsh")
|
471
|
+
'(hsh)
|
472
|
+
nil
|
473
|
+
(dox/attrs (hash-manipulation)))
|
474
|
+
|
475
|
+
(dox-add-doc 'hash-key?
|
476
|
+
'def
|
477
|
+
'("return 't if 'key is a key of 'hsh")
|
478
|
+
'(hsh key)
|
479
|
+
nil
|
480
|
+
(dox/attrs (hash-manipulation)))
|
481
|
+
|
482
|
+
(dox-add-doc 'hash-merge
|
483
|
+
'def
|
484
|
+
'("return a new hash containing keys and values from 'h0 and 'h1, where values of 'h1 override values of 'h0")
|
485
|
+
'(h0 h1)
|
486
|
+
nil
|
487
|
+
(dox/attrs (hash-manipulation)))
|
488
|
+
|
489
|
+
(dox-add-doc 'vm-info
|
490
|
+
'def
|
491
|
+
'("return some information about the state of the current thread")
|
492
|
+
nil
|
493
|
+
nil
|
494
|
+
(dox/attrs (nydp-core)))
|
495
|
+
|
496
|
+
(dox-add-doc 'pre-compile
|
497
|
+
'def
|
498
|
+
'("transform parsed forms before the compile and eval stages")
|
499
|
+
'(arg)
|
500
|
+
nil
|
501
|
+
(dox/attrs (nydp-compilation)))
|
502
|
+
|
503
|
+
(dox-add-doc 'script-run
|
504
|
+
'def
|
505
|
+
'("announces the start of a plugin load or a script load."
|
506
|
+
"'event may be one of '(script-start script-end plugin-start plugin-end)"
|
507
|
+
"'name is the name of the script or plugin concerned")
|
508
|
+
'(event name)
|
509
|
+
nil
|
510
|
+
(dox/attrs (nydp-core)))
|
511
|
+
|
512
|
+
(dox-add-doc 'chapter-end
|
513
|
+
'def
|
514
|
+
'("Announce the end of a chapter. Called by 'plugin-start, 'plugin-end, 'script-start, 'script-end")
|
515
|
+
nil
|
516
|
+
nil
|
517
|
+
(dox/attrs (nydp/documentation)))
|
518
|
+
|
519
|
+
(dox-add-doc 'chapter-start
|
520
|
+
'def
|
521
|
+
'("Announce the start of a chapter. Creates a new chapter if the named chapter does not already exist")
|
522
|
+
'(chapter-name description)
|
523
|
+
nil
|
524
|
+
(dox/attrs (nydp/documentation)))
|
525
|
+
|
526
|
+
(dox-add-doc 'chapter-names
|
527
|
+
'def
|
528
|
+
'("Get the names of all the chapters nydp knows about")
|
529
|
+
nil
|
530
|
+
nil
|
531
|
+
(dox/attrs (nydp/documentation)))
|
532
|
+
|
533
|
+
(dox-add-doc 'chapter-current
|
534
|
+
'def
|
535
|
+
'("Get the name of the chapter in progress right now - this is normally the last value sent to 'chapter-start")
|
536
|
+
nil
|
537
|
+
nil
|
538
|
+
(dox/attrs (nydp/documentation)))
|
539
|
+
|
540
|
+
(dox-add-doc 'chapter-delete
|
541
|
+
'def
|
542
|
+
'("Remove the named chapter")
|
543
|
+
'(name)
|
544
|
+
nil
|
545
|
+
(dox/attrs (nydp/documentation)))
|
546
|
+
|
547
|
+
(dox-add-doc 'chapter-find
|
548
|
+
'def
|
549
|
+
'("Get the named chapter")
|
550
|
+
'(name)
|
551
|
+
nil
|
552
|
+
(dox/attrs (nydp/documentation)))
|
553
|
+
|
554
|
+
(dox-add-doc 'set-intersection
|
555
|
+
'def
|
556
|
+
'("return the intersection of the given lists")
|
557
|
+
'args
|
558
|
+
nil
|
559
|
+
(dox/attrs (list-manipulation)))
|
560
|
+
|
561
|
+
(dox-add-doc (sym "⋂")
|
562
|
+
'def
|
563
|
+
'("return the intersection of the given lists")
|
564
|
+
'args
|
565
|
+
nil
|
566
|
+
(dox/attrs (list-manipulation)))
|
567
|
+
|
568
|
+
(dox-add-doc 'set-union
|
569
|
+
'def
|
570
|
+
'("return the union of the given lists")
|
571
|
+
'args
|
572
|
+
nil
|
573
|
+
(dox/attrs (list-manipulation)))
|
574
|
+
|
575
|
+
(dox-add-doc (sym "⋃")
|
576
|
+
'def
|
577
|
+
'("return the union of the given lists")
|
578
|
+
'args
|
579
|
+
nil
|
580
|
+
(dox/attrs (list-manipulation)))
|
581
|
+
|
582
|
+
(dox-add-doc 'dox-add-doc
|
583
|
+
'def
|
584
|
+
'("Store the provided documentation item."
|
585
|
+
"@name@ is the name of the item"
|
586
|
+
"@what@ is the type of the item ('def or 'mac or 'thingy ... this is user-definable, not related to 'type-of)"
|
587
|
+
"@texts@ is a list of strings to store for this item"
|
588
|
+
"@args@ is the args if the item has the notion of args"
|
589
|
+
"@src@ the source code of the item if any"
|
590
|
+
"@chapters@ the chapters to which the item should be added, if any")
|
591
|
+
'(name what texts args src chapters)
|
592
|
+
nil
|
593
|
+
(dox/attrs (nydp/documentation)))
|
594
|
+
|
595
|
+
(dox-add-doc 'dox-add-examples
|
596
|
+
'def
|
597
|
+
'("Add the given examples to the dox for the named item")
|
598
|
+
'(name example-exprs)
|
599
|
+
nil
|
600
|
+
(dox/attrs (nydp/documentation)))
|
601
|
+
|
602
|
+
(dox-add-doc 'dox-types
|
603
|
+
'def
|
604
|
+
'("Get the list of types of documented items")
|
605
|
+
nil
|
606
|
+
nil
|
607
|
+
(dox/attrs (nydp/documentation)))
|
608
|
+
|
609
|
+
(dox-add-doc 'dox-lookup
|
610
|
+
'def
|
611
|
+
'("Get the documentation for the given item")
|
612
|
+
'(name)
|
613
|
+
nil
|
614
|
+
(dox/attrs (nydp/documentation)))
|
615
|
+
|
616
|
+
(dox-add-doc 'dox-items-by-type
|
617
|
+
'def
|
618
|
+
'("Get the list of dox items of a given type")
|
619
|
+
'(type)
|
620
|
+
nil
|
621
|
+
(dox/attrs (nydp/documentation)))
|