mini_kraken 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca30db7b93b0232f1df5321a1e00270395d908e3f7be1d24d3d5a9c19c833914
4
- data.tar.gz: d64051987c0b09abf752b24604854515cabc9e99ff5ee436884c8522d6a75950
3
+ metadata.gz: 79ea33dd475e6dfbed71915177b1581abb5e1ca9a60db04133d11cda7dca9d42
4
+ data.tar.gz: 249bea4319183c929e4c291785c6b74e10606889c789c5e0f2b211197cc6f288
5
5
  SHA512:
6
- metadata.gz: f4fc60b256907317972c51410e52aec821553d7575c24d59b9421f4ba8dbd0136937e70ffb2f9f21556ed205b8b8d54796af68c222df0704b45ebbcf562c3ab3
7
- data.tar.gz: 5caf5af0c016e8dfb5de40244ad71a083eb035e0bcb911ae7bd90e67a784789458c12e46a3cc75a96ae483fd0317d86b6610a7c339cd423050b4d57e642d6cc9
6
+ metadata.gz: '086bf0b30750e908dfee1b7e95eb3b0c0e54dff4f7bd700d54bbf28091aaf02080d458c14508ddcaa580248e0234d1da23553869480e3bea930d46708c115d82'
7
+ data.tar.gz: d3ada8d056819b2ae1af0d442056008600f82633ee52ca8aa672708943fdf517adb60522bfff6673f9cea86985c1bf5ce2a7a3ea73f07504945e660f31ebee49
@@ -1,3 +1,11 @@
1
+ ## [0.1.13] - 2020-07-01
2
+ - Cover all frames from Chapter One of "Reasoned Scheme" book.
3
+ - Fix defect for fused variables that remain fresh
4
+
5
+ ### CHANGED
6
+ - Method `Variable#quote` now takes into account of cases when variables are fused.
7
+ - Method `Vocabulary#names_fused` now copes with cases where no variable with given name can be found.
8
+
1
9
  ## [0.1.12] - 2020-06-29
2
10
  - Supports `conde`, that is, a relation that can take an arbitrary number of arguments.
3
11
  - Cover all frames but one from Chapter One of "Reasoned Scheme" book.
@@ -24,11 +24,17 @@ module MiniKraken
24
24
  name != i_name
25
25
  end
26
26
 
27
- def quote(anEnvironment)
28
- raise StandardError, "class #{anEnvironment}" unless anEnvironment.kind_of?(Vocabulary)
27
+ def quote(env)
28
+ raise StandardError, "class #{env}" unless env.kind_of?(Vocabulary)
29
29
 
30
- val = anEnvironment.quote_ref(self)
31
- val.nil? ? AnyValue.new(name, anEnvironment) : val
30
+ val = env.quote_ref(self)
31
+ unless val
32
+ result = AnyValue.new(name, env, env.names_fused(name))
33
+ else
34
+ result = val
35
+ end
36
+
37
+ result
32
38
  end
33
39
  end # class
34
40
  end # module
@@ -331,8 +331,9 @@ module MiniKraken
331
331
  # variable name.
332
332
  # @param aName [String] User-defined variable name
333
333
  def names_fused(aName)
334
+ # require 'debug'
334
335
  var = name2var(aName)
335
- return [] unless var.fused?
336
+ return [] unless var&.fused?
336
337
 
337
338
  i_name = var.i_name
338
339
  names = []
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniKraken
4
- VERSION = '0.1.12'
4
+ VERSION = '0.1.13'
5
5
  end
@@ -126,6 +126,7 @@ module MiniKraken
126
126
 
127
127
  it 'should return a null list with the succeed goal' do
128
128
  instance = RunStarExpression.new('q', succeeds)
129
+ expect(instance.env.vars).to be_include('q')
129
130
 
130
131
  # (display (run* q succeed)) ;; => (_0)
131
132
  # Reasoned S2, frame 1:16
@@ -968,8 +969,7 @@ module MiniKraken
968
969
  # ((== x y)))) ;; => ((_0 _1)(_0 _0))
969
970
  result = instance.run
970
971
  expect(result.car).to eq(cons(any_value(0), cons(any_value(1))))
971
- # Bug: next line fails
972
- # expect(result.cdr.car).to eq(cons(any_value(0), cons(any_value(0))))
972
+ expect(result.cdr.car).to eq(cons(any_value(0), cons(any_value(0))))
973
973
  end
974
974
 
975
975
  it 'accepts conde with more than two condition lines' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_kraken
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-29 00:00:00.000000000 Z
11
+ date: 2020-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler