nydp 0.4.0 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +44 -0
- data/lib/lisp/core-010-precompile.nydp +13 -16
- data/lib/lisp/core-012-utils.nydp +21 -6
- data/lib/lisp/core-015-documentation.nydp +60 -19
- data/lib/lisp/core-017-builtin-dox.nydp +50 -39
- data/lib/lisp/core-020-utils.nydp +5 -5
- data/lib/lisp/core-030-syntax.nydp +103 -61
- data/lib/lisp/core-035-flow-control.nydp +18 -9
- data/lib/lisp/core-037-list-utils.nydp +36 -14
- data/lib/lisp/core-039-module.nydp +24 -0
- data/lib/lisp/core-040-utils.nydp +41 -23
- data/lib/lisp/core-041-string-utils.nydp +37 -9
- data/lib/lisp/core-042-date-utils.nydp +21 -1
- data/lib/lisp/core-043-list-utils.nydp +93 -67
- data/lib/lisp/core-045-dox-utils.nydp +5 -0
- data/lib/lisp/core-080-pretty-print.nydp +55 -17
- data/lib/lisp/core-090-hook.nydp +35 -1
- data/lib/lisp/core-100-utils.nydp +130 -28
- data/lib/lisp/core-110-hash-utils.nydp +61 -0
- data/lib/lisp/core-120-settings.nydp +46 -0
- data/lib/lisp/core-130-validations.nydp +51 -0
- data/lib/lisp/{core-060-benchmarking.nydp → core-900-benchmarking.nydp} +108 -5
- data/lib/lisp/tests/accum-examples.nydp +28 -1
- data/lib/lisp/tests/aif-examples.nydp +8 -3
- data/lib/lisp/tests/andify-examples.nydp +7 -0
- data/lib/lisp/tests/at-syntax-examples.nydp +17 -0
- data/lib/lisp/tests/best-examples.nydp +9 -0
- data/lib/lisp/tests/builtin-tests.nydp +19 -0
- data/lib/lisp/tests/case-examples.nydp +14 -0
- data/lib/lisp/tests/cdr-set-examples.nydp +6 -0
- data/lib/lisp/tests/date-examples.nydp +56 -1
- data/lib/lisp/tests/destructuring-examples.nydp +5 -5
- data/lib/lisp/tests/detect-examples.nydp +12 -0
- data/lib/lisp/tests/dp-examples.nydp +24 -0
- data/lib/lisp/tests/empty-examples.nydp +1 -1
- data/lib/lisp/tests/error-tests.nydp +4 -4
- data/lib/lisp/tests/filter-forms-examples.nydp +30 -0
- data/lib/lisp/tests/foundation-test.nydp +12 -0
- data/lib/lisp/tests/hash-examples.nydp +26 -2
- data/lib/lisp/tests/list-grep-examples.nydp +40 -0
- data/lib/lisp/tests/list-tests.nydp +58 -1
- data/lib/lisp/tests/map-hash-examples.nydp +11 -0
- data/lib/lisp/tests/mapreduce-examples.nydp +10 -0
- data/lib/lisp/tests/module-examples.nydp +10 -0
- data/lib/lisp/tests/multi-assign-examples.nydp +6 -0
- data/lib/lisp/tests/parser-tests.nydp +21 -0
- data/lib/lisp/tests/pretty-print-tests.nydp +16 -13
- data/lib/lisp/tests/set-difference-examples.nydp +8 -0
- data/lib/lisp/tests/set-intersection-examples.nydp +32 -0
- data/lib/lisp/tests/set-union-examples.nydp +24 -0
- data/lib/lisp/tests/settings-examples.nydp +40 -0
- data/lib/lisp/tests/sort-examples.nydp +8 -0
- data/lib/lisp/tests/string-tests.nydp +61 -1
- data/lib/lisp/tests/syntax-tests.nydp +5 -1
- data/lib/lisp/tests/to-integer-examples.nydp +16 -0
- data/lib/lisp/tests/validation-examples.nydp +15 -0
- data/lib/lisp/tests/zap-examples.nydp +12 -0
- data/lib/nydp.rb +13 -7
- data/lib/nydp/assignment.rb +10 -3
- data/lib/nydp/builtin.rb +1 -1
- data/lib/nydp/builtin/abs.rb +8 -0
- data/lib/nydp/builtin/cdr_set.rb +1 -6
- data/lib/nydp/builtin/date.rb +15 -1
- data/lib/nydp/builtin/error.rb +1 -1
- data/lib/nydp/builtin/handle_error.rb +1 -1
- data/lib/nydp/builtin/hash.rb +27 -45
- data/lib/nydp/builtin/inspect.rb +1 -1
- data/lib/nydp/builtin/plus.rb +10 -2
- data/lib/nydp/builtin/rand.rb +18 -0
- data/lib/nydp/builtin/random_string.rb +2 -2
- data/lib/nydp/builtin/ruby_wrap.rb +72 -0
- data/lib/nydp/builtin/set_intersection.rb +8 -0
- data/lib/nydp/builtin/set_union.rb +8 -0
- data/lib/nydp/builtin/string_match.rb +2 -2
- data/lib/nydp/builtin/string_pad_left.rb +7 -0
- data/lib/nydp/builtin/string_pad_right.rb +7 -0
- data/lib/nydp/builtin/string_replace.rb +1 -1
- data/lib/nydp/builtin/string_split.rb +1 -2
- data/lib/nydp/builtin/to_integer.rb +23 -0
- data/lib/nydp/builtin/to_string.rb +2 -9
- data/lib/nydp/builtin/type_of.rb +9 -6
- data/lib/nydp/closure.rb +0 -3
- data/lib/nydp/cond.rb +23 -1
- data/lib/nydp/context_symbol.rb +14 -6
- data/lib/nydp/core.rb +45 -33
- data/lib/nydp/core_ext.rb +54 -0
- data/lib/nydp/date.rb +37 -31
- data/lib/nydp/function_invocation.rb +34 -26
- data/lib/nydp/hash.rb +5 -6
- data/lib/nydp/helper.rb +41 -25
- data/lib/nydp/interpreted_function.rb +68 -40
- data/lib/nydp/literal.rb +1 -1
- data/lib/nydp/pair.rb +25 -9
- data/lib/nydp/parser.rb +8 -6
- data/lib/nydp/string_atom.rb +16 -22
- data/lib/nydp/symbol.rb +40 -27
- data/lib/nydp/symbol_lookup.rb +7 -7
- data/lib/nydp/tokeniser.rb +2 -2
- data/lib/nydp/truth.rb +17 -10
- data/lib/nydp/version.rb +1 -1
- data/lib/nydp/vm.rb +7 -2
- data/nydp.gemspec +2 -4
- data/spec/date_spec.rb +115 -22
- data/spec/embedded_spec.rb +12 -12
- data/spec/foreign_hash_spec.rb +14 -2
- data/spec/hash_non_hash_behaviour_spec.rb +7 -7
- data/spec/hash_spec.rb +24 -2
- data/spec/nydp_spec.rb +14 -2
- data/spec/parser_spec.rb +27 -16
- data/spec/rand_spec.rb +45 -0
- data/spec/spec_helper.rb +13 -1
- data/spec/symbol_spec.rb +31 -0
- data/spec/time_spec.rb +1 -1
- metadata +38 -37
- data/lib/nydp/builtin/car.rb +0 -7
- data/lib/nydp/builtin/cdr.rb +0 -7
- data/lib/nydp/builtin/cons.rb +0 -9
data/spec/symbol_spec.rb
CHANGED
@@ -5,6 +5,37 @@ describe Nydp::Symbol do
|
|
5
5
|
let(:foo) { Nydp::Symbol.mk :FOO, ns }
|
6
6
|
let(:vm) { Nydp::VM.new(ns) }
|
7
7
|
|
8
|
+
describe "#inspect" do
|
9
|
+
it "wraps itself in pipe chars if empty" do
|
10
|
+
sym = Nydp::Symbol.mk "", ns
|
11
|
+
expect(sym.inspect).to eq "||"
|
12
|
+
end
|
13
|
+
it "wraps itself in pipe chars if nil" do
|
14
|
+
sym = Nydp::Symbol.mk nil, ns
|
15
|
+
expect(sym.inspect).to eq "||"
|
16
|
+
end
|
17
|
+
it "wraps itself in pipe chars if it has spaces" do
|
18
|
+
sym = Nydp::Symbol.mk "hello world", ns
|
19
|
+
expect(sym.inspect).to eq "|hello world|"
|
20
|
+
end
|
21
|
+
it "wraps itself in pipe chars if it has pipe chars" do
|
22
|
+
sym = Nydp::Symbol.mk "hello|world", ns
|
23
|
+
expect(sym.inspect).to eq '|hello\|world|'
|
24
|
+
end
|
25
|
+
it "wraps itself in pipe chars if it contains quote chars" do
|
26
|
+
sym = Nydp::Symbol.mk "hello 'world'", ns
|
27
|
+
expect(sym.inspect).to eq "|hello 'world'|"
|
28
|
+
end
|
29
|
+
it "wraps itself in pipe chars if it contains doublequote chars" do
|
30
|
+
sym = Nydp::Symbol.mk 'hello "world"', ns
|
31
|
+
expect(sym.inspect).to eq '|hello "world"|'
|
32
|
+
end
|
33
|
+
it "wraps itself in pipe chars if it has other punctuation" do
|
34
|
+
sym = Nydp::Symbol.mk 'hello,(world)', ns
|
35
|
+
expect(sym.inspect).to eq '|hello,(world)|'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
8
39
|
it "returns a ruby symbol in #to_ruby" do
|
9
40
|
sym = Nydp::Symbol.mk :foo, ns
|
10
41
|
expect(sym.to_ruby).to eq :foo
|
data/spec/time_spec.rb
CHANGED
metadata
CHANGED
@@ -1,59 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nydp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conan Dalton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.3'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.3'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '12'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '12'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.1'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.1'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec_numbering_formatter
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
31
|
- - ">="
|
@@ -95,28 +67,36 @@ files:
|
|
95
67
|
- lib/lisp/core-030-syntax.nydp
|
96
68
|
- lib/lisp/core-035-flow-control.nydp
|
97
69
|
- lib/lisp/core-037-list-utils.nydp
|
70
|
+
- lib/lisp/core-039-module.nydp
|
98
71
|
- lib/lisp/core-040-utils.nydp
|
99
72
|
- lib/lisp/core-041-string-utils.nydp
|
100
73
|
- lib/lisp/core-042-date-utils.nydp
|
101
74
|
- lib/lisp/core-043-list-utils.nydp
|
102
75
|
- lib/lisp/core-045-dox-utils.nydp
|
103
76
|
- lib/lisp/core-050-test-runner.nydp
|
104
|
-
- lib/lisp/core-060-benchmarking.nydp
|
105
77
|
- lib/lisp/core-070-prefix-list.nydp
|
106
78
|
- lib/lisp/core-080-pretty-print.nydp
|
107
79
|
- lib/lisp/core-090-hook.nydp
|
108
80
|
- lib/lisp/core-100-utils.nydp
|
81
|
+
- lib/lisp/core-110-hash-utils.nydp
|
82
|
+
- lib/lisp/core-120-settings.nydp
|
83
|
+
- lib/lisp/core-130-validations.nydp
|
84
|
+
- lib/lisp/core-900-benchmarking.nydp
|
109
85
|
- lib/lisp/tests/accum-examples.nydp
|
110
86
|
- lib/lisp/tests/add-hook-examples.nydp
|
111
87
|
- lib/lisp/tests/aif-examples.nydp
|
112
88
|
- lib/lisp/tests/all-examples.nydp
|
113
89
|
- lib/lisp/tests/ampersand-syntax-examples.nydp
|
90
|
+
- lib/lisp/tests/andify-examples.nydp
|
114
91
|
- lib/lisp/tests/any-examples.nydp
|
92
|
+
- lib/lisp/tests/at-syntax-examples.nydp
|
115
93
|
- lib/lisp/tests/auto-hash-examples.nydp
|
116
94
|
- lib/lisp/tests/best-examples.nydp
|
117
95
|
- lib/lisp/tests/boot-tests.nydp
|
118
96
|
- lib/lisp/tests/builtin-tests.nydp
|
119
97
|
- lib/lisp/tests/car-examples.nydp
|
98
|
+
- lib/lisp/tests/case-examples.nydp
|
99
|
+
- lib/lisp/tests/cdr-set-examples.nydp
|
120
100
|
- lib/lisp/tests/collect-tests.nydp
|
121
101
|
- lib/lisp/tests/cons-examples.nydp
|
122
102
|
- lib/lisp/tests/curry-tests.nydp
|
@@ -127,6 +107,7 @@ files:
|
|
127
107
|
- lib/lisp/tests/detect-examples.nydp
|
128
108
|
- lib/lisp/tests/dot-syntax-examples.nydp
|
129
109
|
- lib/lisp/tests/dox-tests.nydp
|
110
|
+
- lib/lisp/tests/dp-examples.nydp
|
130
111
|
- lib/lisp/tests/dynamic-scope-test.nydp
|
131
112
|
- lib/lisp/tests/each-tests.nydp
|
132
113
|
- lib/lisp/tests/empty-examples.nydp
|
@@ -144,10 +125,15 @@ files:
|
|
144
125
|
- lib/lisp/tests/isa-examples.nydp
|
145
126
|
- lib/lisp/tests/k-examples.nydp
|
146
127
|
- lib/lisp/tests/len-examples.nydp
|
128
|
+
- lib/lisp/tests/list-grep-examples.nydp
|
147
129
|
- lib/lisp/tests/list-gsub-examples.nydp
|
148
130
|
- lib/lisp/tests/list-match-examples.nydp
|
149
131
|
- lib/lisp/tests/list-tests.nydp
|
132
|
+
- lib/lisp/tests/map-hash-examples.nydp
|
133
|
+
- lib/lisp/tests/mapreduce-examples.nydp
|
150
134
|
- lib/lisp/tests/mapsum-examples.nydp
|
135
|
+
- lib/lisp/tests/module-examples.nydp
|
136
|
+
- lib/lisp/tests/multi-assign-examples.nydp
|
151
137
|
- lib/lisp/tests/none-examples.nydp
|
152
138
|
- lib/lisp/tests/orequal-examples.nydp
|
153
139
|
- lib/lisp/tests/parser-tests.nydp
|
@@ -162,23 +148,28 @@ files:
|
|
162
148
|
- lib/lisp/tests/returning-examples.nydp
|
163
149
|
- lib/lisp/tests/rfnwith-tests.nydp
|
164
150
|
- lib/lisp/tests/seqf-examples.nydp
|
151
|
+
- lib/lisp/tests/set-difference-examples.nydp
|
152
|
+
- lib/lisp/tests/set-intersection-examples.nydp
|
153
|
+
- lib/lisp/tests/set-union-examples.nydp
|
154
|
+
- lib/lisp/tests/settings-examples.nydp
|
165
155
|
- lib/lisp/tests/sort-examples.nydp
|
166
156
|
- lib/lisp/tests/string-tests.nydp
|
167
157
|
- lib/lisp/tests/syntax-tests.nydp
|
168
158
|
- lib/lisp/tests/time-examples.nydp
|
159
|
+
- lib/lisp/tests/to-integer-examples.nydp
|
169
160
|
- lib/lisp/tests/tuples-examples.nydp
|
170
161
|
- lib/lisp/tests/type-of-examples.nydp
|
171
162
|
- lib/lisp/tests/unparse-tests.nydp
|
163
|
+
- lib/lisp/tests/validation-examples.nydp
|
164
|
+
- lib/lisp/tests/zap-examples.nydp
|
172
165
|
- lib/lisp/tests/zip-examples.nydp
|
173
166
|
- lib/nydp.rb
|
174
167
|
- lib/nydp/assignment.rb
|
175
168
|
- lib/nydp/builtin.rb
|
169
|
+
- lib/nydp/builtin/abs.rb
|
176
170
|
- lib/nydp/builtin/apply.rb
|
177
|
-
- lib/nydp/builtin/car.rb
|
178
|
-
- lib/nydp/builtin/cdr.rb
|
179
171
|
- lib/nydp/builtin/cdr_set.rb
|
180
172
|
- lib/nydp/builtin/comment.rb
|
181
|
-
- lib/nydp/builtin/cons.rb
|
182
173
|
- lib/nydp/builtin/date.rb
|
183
174
|
- lib/nydp/builtin/divide.rb
|
184
175
|
- lib/nydp/builtin/ensuring.rb
|
@@ -202,17 +193,24 @@ files:
|
|
202
193
|
- lib/nydp/builtin/pre_compile.rb
|
203
194
|
- lib/nydp/builtin/puts.rb
|
204
195
|
- lib/nydp/builtin/quit.rb
|
196
|
+
- lib/nydp/builtin/rand.rb
|
205
197
|
- lib/nydp/builtin/random_string.rb
|
198
|
+
- lib/nydp/builtin/ruby_wrap.rb
|
206
199
|
- lib/nydp/builtin/script_run.rb
|
200
|
+
- lib/nydp/builtin/set_intersection.rb
|
201
|
+
- lib/nydp/builtin/set_union.rb
|
207
202
|
- lib/nydp/builtin/sort.rb
|
208
203
|
- lib/nydp/builtin/sqrt.rb
|
209
204
|
- lib/nydp/builtin/string_match.rb
|
205
|
+
- lib/nydp/builtin/string_pad_left.rb
|
206
|
+
- lib/nydp/builtin/string_pad_right.rb
|
210
207
|
- lib/nydp/builtin/string_replace.rb
|
211
208
|
- lib/nydp/builtin/string_split.rb
|
212
209
|
- lib/nydp/builtin/sym.rb
|
213
210
|
- lib/nydp/builtin/thread_locals.rb
|
214
211
|
- lib/nydp/builtin/time.rb
|
215
212
|
- lib/nydp/builtin/times.rb
|
213
|
+
- lib/nydp/builtin/to_integer.rb
|
216
214
|
- lib/nydp/builtin/to_string.rb
|
217
215
|
- lib/nydp/builtin/type_of.rb
|
218
216
|
- lib/nydp/builtin/vm_info.rb
|
@@ -221,6 +219,7 @@ files:
|
|
221
219
|
- lib/nydp/cond.rb
|
222
220
|
- lib/nydp/context_symbol.rb
|
223
221
|
- lib/nydp/core.rb
|
222
|
+
- lib/nydp/core_ext.rb
|
224
223
|
- lib/nydp/date.rb
|
225
224
|
- lib/nydp/error.rb
|
226
225
|
- lib/nydp/function_invocation.rb
|
@@ -256,6 +255,7 @@ files:
|
|
256
255
|
- spec/nydp_spec.rb
|
257
256
|
- spec/pair_spec.rb
|
258
257
|
- spec/parser_spec.rb
|
258
|
+
- spec/rand_spec.rb
|
259
259
|
- spec/spec_helper.rb
|
260
260
|
- spec/string_atom_spec.rb
|
261
261
|
- spec/string_token_spec.rb
|
@@ -283,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
283
|
version: '0'
|
284
284
|
requirements: []
|
285
285
|
rubyforge_project:
|
286
|
-
rubygems_version: 2.2.
|
286
|
+
rubygems_version: 2.5.2.3
|
287
287
|
signing_key:
|
288
288
|
specification_version: 4
|
289
289
|
summary: A civilised yet somewhat dangerous kind of Lisp for a new generation
|
@@ -298,6 +298,7 @@ test_files:
|
|
298
298
|
- spec/nydp_spec.rb
|
299
299
|
- spec/pair_spec.rb
|
300
300
|
- spec/parser_spec.rb
|
301
|
+
- spec/rand_spec.rb
|
301
302
|
- spec/spec_helper.rb
|
302
303
|
- spec/string_atom_spec.rb
|
303
304
|
- spec/string_token_spec.rb
|
data/lib/nydp/builtin/car.rb
DELETED
data/lib/nydp/builtin/cdr.rb
DELETED