klam 0.0.9 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +8 -5
- data/HISTORY.asciidoc +21 -0
- data/lib/klam/lexer.rb +1 -1
- data/lib/klam/primitives/arithmetic.rb +1 -1
- data/lib/klam/version.rb +1 -1
- data/spec/unit/klam/lexer_spec.rb +4 -4
- data/spec/unit/klam/primitives/arithmetic_spec.rb +4 -4
- data/spec/unit/klam/primitives/lists_spec.rb +2 -2
- data/spec/unit/klam/primitives/vectors_spec.rb +4 -4
- metadata +24 -56
- data/lib/klam/converters/.list.rb.swp +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c68a51fe21864540fb096aa07d6ccd9d9b017751be133a4d7b97edfeb1946a89
|
|
4
|
+
data.tar.gz: 73cd634d6d1aa173bed9e31fcb85b7428d7cef65a14763ec781190cc502d9f88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0191e54483d1ab554d66b3e3772b384f677aef8460b8ad0efd45cacacf5ff114599ac0d9d7e1adbdc8b9a8fe53821f9bfc042dc47006d14d8cafa97d36fe1382'
|
|
7
|
+
data.tar.gz: e4685c2607818aeb6d8427e902e94dd75e21b50ece686e56b41c19ea2aa08883769d74628ff2009d17217ff26226315878e9ecd60ad1e0d29305ac32e2f9fe8e
|
data/.travis.yml
CHANGED
data/HISTORY.asciidoc
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
Relase History
|
|
2
2
|
==============
|
|
3
3
|
|
|
4
|
+
v0.1.1 -- May 16, 2019
|
|
5
|
+
----------------------
|
|
6
|
+
* Re-release
|
|
7
|
+
|
|
8
|
+
v0.1.0 -- May 16, 2019
|
|
9
|
+
----------------------
|
|
10
|
+
New Features
|
|
11
|
+
~~~~~~~~~~~~
|
|
12
|
+
* Allow comma in symbols. This is required to support Shen 21.0 and above.
|
|
13
|
+
|
|
14
|
+
Compatibility Updates
|
|
15
|
+
~~~~~~~~~~~~~~~~~~~~~
|
|
16
|
+
* Use Integer rather than Fixnum.
|
|
17
|
+
* Quiet rspec warnings w.r.t. specs for raised exceptions.
|
|
18
|
+
|
|
19
|
+
v0.0.9 -- March 17, 2015
|
|
20
|
+
------------------------
|
|
21
|
+
Bug Fixes
|
|
22
|
+
~~~~~~~~~
|
|
23
|
+
* Fixed compatibility issue with Ruby 1.9.3.
|
|
24
|
+
|
|
4
25
|
v0.0.8 -- March 15, 2015
|
|
5
26
|
------------------------
|
|
6
27
|
Performance Improvements
|
data/lib/klam/lexer.rb
CHANGED
|
@@ -18,7 +18,7 @@ module Klam
|
|
|
18
18
|
# the integer 3 by the interger 2 must yield 1.5 rather than 1. We'd
|
|
19
19
|
# like to keep things in integers as much as possible, so we coerce a
|
|
20
20
|
# to a float only if integer division is not possible.
|
|
21
|
-
if a.kind_of?(
|
|
21
|
+
if a.kind_of?(Integer) && b.kind_of?(Integer) && a.remainder(b) != 0
|
|
22
22
|
a = a.to_f
|
|
23
23
|
end
|
|
24
24
|
|
data/lib/klam/version.rb
CHANGED
|
@@ -47,9 +47,9 @@ describe Klam::Lexer do
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
describe 'numbers' do
|
|
50
|
-
it 'reads integers as
|
|
50
|
+
it 'reads integers as Integers' do
|
|
51
51
|
num = lexer("37").next
|
|
52
|
-
expect(num).to be_kind_of(
|
|
52
|
+
expect(num).to be_kind_of(Integer)
|
|
53
53
|
expect(num).to eq(37)
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -84,7 +84,7 @@ describe Klam::Lexer do
|
|
|
84
84
|
it 'treats a trailing decimal followed by EOF as a symbol' do
|
|
85
85
|
l = lexer('7.')
|
|
86
86
|
num = l.next
|
|
87
|
-
expect(num).to be_kind_of(
|
|
87
|
+
expect(num).to be_kind_of(Integer)
|
|
88
88
|
expect(num).to eq(7)
|
|
89
89
|
|
|
90
90
|
sym = l.next
|
|
@@ -95,7 +95,7 @@ describe Klam::Lexer do
|
|
|
95
95
|
it 'treats a trailing decimal followed by non-digit as a symbol' do
|
|
96
96
|
l = lexer('7.a')
|
|
97
97
|
num = l.next
|
|
98
|
-
expect(num).to be_kind_of(
|
|
98
|
+
expect(num).to be_kind_of(Integer)
|
|
99
99
|
expect(num).to eq(7)
|
|
100
100
|
|
|
101
101
|
sym = l.next
|
|
@@ -9,7 +9,7 @@ describe Klam::Primitives::Arithmetic do
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
it 'returns an integer when both arguments are integers' do
|
|
12
|
-
expect(send(:+, 1, 2)).to be_kind_of(
|
|
12
|
+
expect(send(:+, 1, 2)).to be_kind_of(Integer)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
it 'returns a real when either arguments are reals' do
|
|
@@ -28,7 +28,7 @@ describe Klam::Primitives::Arithmetic do
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
it 'returns an integer when both arguments are integers' do
|
|
31
|
-
expect(send(:-, 1, 2)).to be_kind_of(
|
|
31
|
+
expect(send(:-, 1, 2)).to be_kind_of(Integer)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
it 'returns a real when either arguments are reals' do
|
|
@@ -47,7 +47,7 @@ describe Klam::Primitives::Arithmetic do
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
it 'returns an integer when both arguments are integers' do
|
|
50
|
-
expect(send(:*, 1, 2)).to be_kind_of(
|
|
50
|
+
expect(send(:*, 1, 2)).to be_kind_of(Integer)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it 'returns a real when either arguments are reals' do
|
|
@@ -66,7 +66,7 @@ describe Klam::Primitives::Arithmetic do
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
it 'returns an integer when both arguments are integers and there is no remainder' do
|
|
69
|
-
expect(send(:/, 6, 2)).to be_kind_of(
|
|
69
|
+
expect(send(:/, 6, 2)).to be_kind_of(Integer)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
it 'returns a real otherwise' do
|
|
@@ -22,7 +22,7 @@ describe Klam::Primitives::Lists do
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it 'raises an exception when applied to the empty list' do
|
|
25
|
-
expect { hd(@empty_list) }.to raise_error
|
|
25
|
+
expect { hd(@empty_list) }.to raise_error(NoMethodError)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -32,7 +32,7 @@ describe Klam::Primitives::Lists do
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
it 'raises an exception when applied to the empty list' do
|
|
35
|
-
expect { tl(@empty_list) }.to raise_error
|
|
35
|
+
expect { tl(@empty_list) }.to raise_error(NoMethodError)
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -28,13 +28,13 @@ describe Klam::Primitives::Vectors do
|
|
|
28
28
|
it 'raises an error if N is negative' do
|
|
29
29
|
expect {
|
|
30
30
|
send(:"address->", @vec, -1, :foo)
|
|
31
|
-
}.to raise_error
|
|
31
|
+
}.to raise_error(::Klam::Error)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
it 'raises an error if N is >= the size of the V' do
|
|
35
35
|
expect {
|
|
36
36
|
send(:"address->", @vec, 3, :foo)
|
|
37
|
-
}.to raise_error
|
|
37
|
+
}.to raise_error(::Klam::Error)
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
@@ -57,13 +57,13 @@ describe Klam::Primitives::Vectors do
|
|
|
57
57
|
it 'raises an error if N is negative' do
|
|
58
58
|
expect {
|
|
59
59
|
send(:"<-address", @vec, -1)
|
|
60
|
-
}.to raise_error
|
|
60
|
+
}.to raise_error(::Klam::Error)
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
it 'raises an error if N is >= the size of the V' do
|
|
64
64
|
expect {
|
|
65
65
|
send(:"<-address", @vec, 3)
|
|
66
|
-
}.to raise_error
|
|
66
|
+
}.to raise_error(::Klam::Error)
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
|
metadata
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: klam
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Greg Spurrier
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '10.4'
|
|
20
|
-
- - "
|
|
20
|
+
- - "~>"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
22
|
version: '10.4'
|
|
23
23
|
type: :development
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
|
-
- - "
|
|
27
|
+
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
29
|
version: '10.4'
|
|
30
|
-
- - "
|
|
30
|
+
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: '10.4'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: rspec
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
|
-
- - "~>"
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: '3.1'
|
|
40
37
|
- - ">="
|
|
41
38
|
- !ruby/object:Gem::Version
|
|
42
39
|
version: 3.1.0
|
|
40
|
+
- - "~>"
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '3.1'
|
|
43
43
|
type: :development
|
|
44
44
|
prerelease: false
|
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
46
|
requirements:
|
|
47
|
-
- - "~>"
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: '3.1'
|
|
50
47
|
- - ">="
|
|
51
48
|
- !ruby/object:Gem::Version
|
|
52
49
|
version: 3.1.0
|
|
50
|
+
- - "~>"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '3.1'
|
|
53
53
|
- !ruby/object:Gem::Dependency
|
|
54
54
|
name: rspec-autotest
|
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
|
57
|
-
- - "~>"
|
|
58
|
-
- !ruby/object:Gem::Version
|
|
59
|
-
version: '1.0'
|
|
60
57
|
- - ">="
|
|
61
58
|
- !ruby/object:Gem::Version
|
|
62
59
|
version: 1.0.0
|
|
60
|
+
- - "~>"
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '1.0'
|
|
63
63
|
type: :development
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
|
67
|
-
- - "~>"
|
|
68
|
-
- !ruby/object:Gem::Version
|
|
69
|
-
version: '1.0'
|
|
70
67
|
- - ">="
|
|
71
68
|
- !ruby/object:Gem::Version
|
|
72
69
|
version: 1.0.0
|
|
70
|
+
- - "~>"
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: '1.0'
|
|
73
73
|
- !ruby/object:Gem::Dependency
|
|
74
74
|
name: ZenTest
|
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
|
76
76
|
requirements:
|
|
77
|
-
- - "
|
|
77
|
+
- - ">="
|
|
78
78
|
- !ruby/object:Gem::Version
|
|
79
79
|
version: '4.11'
|
|
80
|
-
- - "
|
|
80
|
+
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '4.11'
|
|
83
83
|
type: :development
|
|
84
84
|
prerelease: false
|
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- - "
|
|
87
|
+
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: '4.11'
|
|
90
|
-
- - "
|
|
90
|
+
- - "~>"
|
|
91
91
|
- !ruby/object:Gem::Version
|
|
92
92
|
version: '4.11'
|
|
93
93
|
description: Klam is a Ruby implementation of Kl, the small Lisp on top of which the
|
|
@@ -128,7 +128,6 @@ files:
|
|
|
128
128
|
- lib/klam/constant.rb
|
|
129
129
|
- lib/klam/constant_generator.rb
|
|
130
130
|
- lib/klam/converters.rb
|
|
131
|
-
- lib/klam/converters/.list.rb.swp
|
|
132
131
|
- lib/klam/converters/list.rb
|
|
133
132
|
- lib/klam/environment.rb
|
|
134
133
|
- lib/klam/error.rb
|
|
@@ -200,39 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
200
199
|
- !ruby/object:Gem::Version
|
|
201
200
|
version: '0'
|
|
202
201
|
requirements: []
|
|
203
|
-
|
|
204
|
-
rubygems_version: 2.4.5
|
|
202
|
+
rubygems_version: 3.0.3
|
|
205
203
|
signing_key:
|
|
206
204
|
specification_version: 4
|
|
207
205
|
summary: Klam is a Ruby implementation of the Kl.
|
|
208
|
-
test_files:
|
|
209
|
-
- spec/functional/application_spec.rb
|
|
210
|
-
- spec/functional/atoms_spec.rb
|
|
211
|
-
- spec/functional/extensions/do_spec.rb
|
|
212
|
-
- spec/functional/extensions/interop_spec.rb
|
|
213
|
-
- spec/functional/primitives/assignments_spec.rb
|
|
214
|
-
- spec/functional/primitives/boolean_operations_spec.rb
|
|
215
|
-
- spec/functional/primitives/error_handling_spec.rb
|
|
216
|
-
- spec/functional/primitives/generic_functions_spec.rb
|
|
217
|
-
- spec/functional/tail_call_optimization_spec.rb
|
|
218
|
-
- spec/spec_helper.rb
|
|
219
|
-
- spec/unit/klam/absvector_spec.rb
|
|
220
|
-
- spec/unit/klam/compilation_stages/constantize_constructed_constants_spec.rb
|
|
221
|
-
- spec/unit/klam/compilation_stages/convert_lexical_variables_spec.rb
|
|
222
|
-
- spec/unit/klam/compilation_stages/convert_self_tail_calls_to_loops_spec.rb
|
|
223
|
-
- spec/unit/klam/compilation_stages/curry_abstraction_applications_spec.rb
|
|
224
|
-
- spec/unit/klam/compilation_stages/make_abstractions_variadic_spec.rb
|
|
225
|
-
- spec/unit/klam/converters/list_spec.rb
|
|
226
|
-
- spec/unit/klam/lexer_spec.rb
|
|
227
|
-
- spec/unit/klam/primitives/arithmetic_spec.rb
|
|
228
|
-
- spec/unit/klam/primitives/boolean_operations_spec.rb
|
|
229
|
-
- spec/unit/klam/primitives/error_handling_spec.rb
|
|
230
|
-
- spec/unit/klam/primitives/lists_spec.rb
|
|
231
|
-
- spec/unit/klam/primitives/strings_spec.rb
|
|
232
|
-
- spec/unit/klam/primitives/symbols_spec.rb
|
|
233
|
-
- spec/unit/klam/primitives/time_spec.rb
|
|
234
|
-
- spec/unit/klam/primitives/vectors_spec.rb
|
|
235
|
-
- spec/unit/klam/reader_spec.rb
|
|
236
|
-
- spec/unit/klam/template_spec.rb
|
|
237
|
-
- spec/unit/klam/variable_spec.rb
|
|
238
|
-
- spec/unit/klam/version_spec.rb
|
|
206
|
+
test_files: []
|
|
Binary file
|