lazylist 0.3.0 → 0.3.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.
data/CHANGES CHANGED
@@ -1,4 +1,7 @@
1
- 2007-04-03 * 0.3.0 * Major work on the implementation:
1
+ 2007-11-27 * 0.3.1 * Comron Sattari <comron@gmail.com> reported a bug
2
+ concerning false values in a lazy list. This problem
3
+ should be corrected now.
4
+ 2007-05-05 * 0.3.0 * Major work on the implementation:
2
5
  - Supports list comprehensions for infinite list like
3
6
  Haskell does by offering a simple DSL.
4
7
  - Added cartesian products to LazyList.
data/Rakefile CHANGED
@@ -1,6 +1,10 @@
1
- require 'rake/gempackagetask'
2
- require 'rbconfig'
1
+ # vim: set et sw=2 ts=2:
3
2
 
3
+ begin
4
+ require 'rake/gempackagetask'
5
+ rescue LoadError
6
+ end
7
+ require 'rbconfig'
4
8
  include Config
5
9
 
6
10
  PKG_NAME = 'lazylist'
@@ -33,35 +37,37 @@ task :clean do
33
37
  rm_rf 'tests/coverage'
34
38
  end
35
39
 
36
- spec = Gem::Specification.new do |s|
37
- s.name = 'lazylist'
38
- s.version = PKG_VERSION
39
- s.summary = "Implementation of lazy lists for Ruby"
40
- s.description = ""
40
+ if defined? Gem
41
+ spec = Gem::Specification.new do |s|
42
+ s.name = 'lazylist'
43
+ s.version = PKG_VERSION
44
+ s.summary = "Implementation of lazy lists for Ruby"
45
+ s.description = ""
41
46
 
42
- s.add_dependency('dslkit', '>= 0.2.2')
47
+ s.add_dependency('dslkit', '>= 0.2.2')
43
48
 
44
- s.files = PKG_FILES
49
+ s.files = PKG_FILES
45
50
 
46
- s.require_path = 'lib'
51
+ s.require_path = 'lib'
47
52
 
48
- s.has_rdoc = true
49
- s.extra_rdoc_files = Dir['lib/**/*.rb']
50
- s.rdoc_options <<
51
- '--title' << 'LazyList -- Infinite lists in Ruby' <<
52
- '--main' << 'LazyList' <<
53
- '--line-numbers'
54
- s.test_files << 'tests/test.rb'
53
+ s.has_rdoc = true
54
+ s.extra_rdoc_files = Dir['lib/**/*.rb']
55
+ s.rdoc_options <<
56
+ '--title' << 'LazyList -- Infinite lists in Ruby' <<
57
+ '--main' << 'LazyList' <<
58
+ '--line-numbers'
59
+ s.test_files << 'tests/test.rb'
55
60
 
56
- s.author = "Florian Frank"
57
- s.email = "flori@ping.de"
58
- s.homepage = "http://lazylist.rubyforge.org"
59
- s.rubyforge_project = "lazylist"
60
- end
61
+ s.author = "Florian Frank"
62
+ s.email = "flori@ping.de"
63
+ s.homepage = "http://lazylist.rubyforge.org"
64
+ s.rubyforge_project = "lazylist"
65
+ end
61
66
 
62
- Rake::GemPackageTask.new(spec) do |pkg|
63
- pkg.need_tar = true
64
- pkg.package_files += PKG_FILES
67
+ Rake::GemPackageTask.new(spec) do |pkg|
68
+ pkg.need_tar = true
69
+ pkg.package_files += PKG_FILES
70
+ end
65
71
  end
66
72
 
67
73
  desc m = "Writing version information for #{PKG_VERSION}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -219,7 +219,11 @@ class LazyList
219
219
  class MemoPromise < Promise
220
220
  # Return the value of this Promise and memoize it for later access.
221
221
  def __value__
222
- @value ||= super
222
+ if defined?(@value)
223
+ @value
224
+ else
225
+ @value = super
226
+ end
223
227
  end
224
228
  end
225
229
 
@@ -253,7 +257,7 @@ class LazyList
253
257
  else
254
258
  LazyList.new(first.head) do
255
259
  t = first.tail
256
- lists = lists.push delay { t } unless t.empty?
260
+ lists = lists.push t unless t.empty?
257
261
  mix(*lists)
258
262
  end
259
263
  end
@@ -541,7 +545,6 @@ class LazyList
541
545
  until s.empty?
542
546
  yield s.head
543
547
  s = s.tail
544
- n -= 1 unless n.nil?
545
548
  end
546
549
  end
547
550
  s
@@ -562,7 +565,6 @@ class LazyList
562
565
  until s.empty?
563
566
  yield s.head
564
567
  s = s.tail
565
- n -= 1 unless n.nil?
566
568
  @head, @tail = s.head, s.tail
567
569
  end
568
570
  end
@@ -1,6 +1,6 @@
1
1
  class LazyList
2
2
  # LazyList version
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: lazylist
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.0
7
- date: 2007-05-05 00:00:00 +02:00
6
+ version: 0.3.1
7
+ date: 2007-11-27 00:00:00 +01:00
8
8
  summary: Implementation of lazy lists for Ruby
9
9
  require_paths:
10
10
  - lib
@@ -25,31 +25,32 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ post_install_message:
28
29
  authors:
29
30
  - Florian Frank
30
31
  files:
31
- - VERSION
32
- - tests
33
- - GPL
34
- - README.en
35
32
  - install.rb
36
- - Rakefile
37
- - examples
38
33
  - lib
34
+ - lib/lazylist
35
+ - lib/lazylist/list_builder.rb
36
+ - lib/lazylist/enumerable.rb
37
+ - lib/lazylist/version.rb
38
+ - lib/lazylist.rb
39
39
  - make_doc.rb
40
40
  - CHANGES
41
+ - README.en
42
+ - VERSION
43
+ - tests
41
44
  - tests/runner.rb
42
45
  - tests/test.rb
43
46
  - tests/test_enumerable.rb
47
+ - Rakefile
48
+ - GPL
49
+ - examples
44
50
  - examples/pi.rb
51
+ - examples/sieve.rb
45
52
  - examples/hamming.rb
46
53
  - examples/examples.rb
47
- - examples/sieve.rb
48
- - lib/lazylist.rb
49
- - lib/lazylist
50
- - lib/lazylist/list_builder.rb
51
- - lib/lazylist/enumerable.rb
52
- - lib/lazylist/version.rb
53
54
  test_files:
54
55
  - tests/test.rb
55
56
  rdoc_options:
@@ -59,10 +60,10 @@ rdoc_options:
59
60
  - LazyList
60
61
  - --line-numbers
61
62
  extra_rdoc_files:
62
- - lib/lazylist.rb
63
63
  - lib/lazylist/list_builder.rb
64
64
  - lib/lazylist/enumerable.rb
65
65
  - lib/lazylist/version.rb
66
+ - lib/lazylist.rb
66
67
  executables: []
67
68
 
68
69
  extensions: []