klam 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2e940a2764ea2672c7456f86bcac1607254edac
4
- data.tar.gz: 3160eb40bd0f415fe39842345dcb21a0511a4a5d
3
+ metadata.gz: 462ec6cdadf1b62a21f9aa9fd1234e1602bd7ce8
4
+ data.tar.gz: 40a63f674eede22654c41ff77c7ccd341e52a68e
5
5
  SHA512:
6
- metadata.gz: fb1f82664a88d71b4edcb4deeb4b59d7a4c60117b542881cbcc12d9135b6f871b906f923580f899a48c3f43cc5bf703c8a8cc58a21ab79106118687380c6861c
7
- data.tar.gz: 9bf5e5d5e40188fc7dfd7a3de28557bfc64d579f46ede0cd9991300090b3fc1cbbff8b2939a9b9805576586544bfcb7770e02ea6fb17b9dab9662da31d9f14f7
6
+ metadata.gz: 4cdbfc50ed2c3ce0e41d5e003adf4f431c8a96e3cc36b704515aa2efba5fe7d335ea95abc99140b9b0ff796b82f2f4c04bc910330a5a2d5d578ef7e26e832a81
7
+ data.tar.gz: 01fca217423bb4e6314ab207a894dbc4d662c5463a7a6cfed97c0bb183e294a45fe37d458093fd8043c7dc9d195bbf4d364b49e2d3daf0eb521abe656d2acb2c
data/HISTORY.asciidoc CHANGED
@@ -1,6 +1,12 @@
1
1
  Relase History
2
2
  ==============
3
3
 
4
+ v0.0.5 -- January 31, 2015
5
+ --------------------------
6
+ New Features
7
+ ~~~~~~~~~~~~
8
+ * `Klam::Absvector` is now enumerable
9
+
4
10
  v0.0.4 -- January 30, 2015
5
11
  --------------------------
6
12
  New Features
@@ -18,5 +18,18 @@ module Klam
18
18
  self[i] = x
19
19
  self
20
20
  end
21
+
22
+ # In Shen, the data types that are implemented on top of absvectors
23
+ # use index 0 for auxilliary information. To ease interop scenarios,
24
+ # to_a and each are overridden to skip the first slot.
25
+ def each(&blk)
26
+ to_a.each(&blk)
27
+ end
28
+
29
+ def to_a
30
+ a = super
31
+ a.shift
32
+ a
33
+ end
21
34
  end
22
35
  end
data/lib/klam/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Klam
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe Klam::Absvector do
4
+ describe '#to_a' do
5
+ it 'skips the first element' do
6
+ a = Klam::Absvector.new(3)
7
+ a[0] = 1
8
+ a[1] = 2
9
+ a[2] = 3
10
+ expect(a.to_a).to eq([2,3])
11
+ end
12
+ end
13
+
14
+ describe '#each' do
15
+ it 'skips the first element' do
16
+ a = Klam::Absvector.new(3)
17
+ a[0] = 1
18
+ a[1] = 2
19
+ a[2] = 3
20
+ b = []
21
+ a.each { |x| b << x }
22
+ expect(b).to eq([2,3])
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Spurrier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-30 00:00:00.000000000 Z
11
+ date: 2015-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -158,6 +158,7 @@ files:
158
158
  - spec/functional/primitives/generic_functions_spec.rb
159
159
  - spec/functional/tail_call_optimization_spec.rb
160
160
  - spec/spec_helper.rb
161
+ - spec/unit/klam/absvector_spec.rb
161
162
  - spec/unit/klam/compilation_stages/convert_lexical_variables_spec.rb
162
163
  - spec/unit/klam/compilation_stages/convert_self_tail_calls_to_loops_spec.rb
163
164
  - spec/unit/klam/compilation_stages/curry_abstraction_applications_spec.rb
@@ -211,6 +212,7 @@ test_files:
211
212
  - spec/functional/primitives/generic_functions_spec.rb
212
213
  - spec/functional/tail_call_optimization_spec.rb
213
214
  - spec/spec_helper.rb
215
+ - spec/unit/klam/absvector_spec.rb
214
216
  - spec/unit/klam/compilation_stages/convert_lexical_variables_spec.rb
215
217
  - spec/unit/klam/compilation_stages/convert_self_tail_calls_to_loops_spec.rb
216
218
  - spec/unit/klam/compilation_stages/curry_abstraction_applications_spec.rb