mll 2.6.1 → 2.6.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/TODO.md +2 -5
- data/lib/mll.rb +2 -2
- data/spec/_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f13ebbaab7d74cd58d37678b5f294c7ffc8e499
|
4
|
+
data.tar.gz: e4edd192a82271406e6554bf827f2acfddf3270f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1645e158efb710ce7db7ce75baeda1873b9a5b64e464fb86c58d33e73ed08004db40bd0d7090621a9deb205bd9b6ac595522083642cdd11eb6f24d6c4c7d591
|
7
|
+
data.tar.gz: 9c6a60b447ab61653366bc05b39cbe172a2c18748c5bdf0bee86b2de59a8238e4121a7ca6aeb1e564168e45d9164ac3b803ede593640cdb825ea6e3fa2f1729a
|
data/Gemfile.lock
CHANGED
data/TODO.md
CHANGED
@@ -23,10 +23,9 @@ module MLL
|
|
23
23
|
stack.each do |ai, ri|
|
24
24
|
# TODO try to make #table lazy (Enumerator instead of Array)
|
25
25
|
def grid
|
26
|
-
lambda do |table, **options|
|
26
|
+
lambda do |table, spacings: [1, 1], **options|
|
27
27
|
# TODO negative spacings?
|
28
|
-
# TODO smth with this
|
29
|
-
# TODO https://reference.wolfram.com/language/ref/Alignment.html
|
28
|
+
# TODO smth with this; maybe check out how Mathematica handles `Table[{1,{2,3},4}]`
|
30
29
|
def riffle
|
31
30
|
lambda do |*args|
|
32
31
|
case args.size
|
@@ -82,8 +81,6 @@ describe MLL do
|
|
82
81
|
# TODO #mapthread ?
|
83
82
|
# TODO #mapindexed ?
|
84
83
|
# TODO "negative levels"
|
85
|
-
describe "Elements of Lists" do
|
86
|
-
# TODO #rest
|
87
84
|
# TODO http://reference.wolfram.com/language/guide/RearrangingAndRestructuringLists.html
|
88
85
|
# TODO http://reference.wolfram.com/language/guide/MathematicalAndCountingOperationsOnLists.html
|
89
86
|
describe "Functional Programming" do
|
data/lib/mll.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module MLL
|
2
2
|
|
3
|
-
VERSION = "2.6.
|
3
|
+
VERSION = "2.6.2"
|
4
4
|
|
5
5
|
class << self
|
6
6
|
|
@@ -149,7 +149,7 @@ module MLL
|
|
149
149
|
end.map &:to_s
|
150
150
|
end
|
151
151
|
rows = table.map{ |row| row.map{ |s| s.count ?\n }.max + 1 }
|
152
|
-
cols = table.transpose.map{ |col| col.flat_map{ |s| s.scan(
|
152
|
+
cols = table.transpose.map{ |col| col.flat_map{ |s| s.scan(/.*/).map(&:size) }.max }
|
153
153
|
|
154
154
|
chars = table.flat_map.with_index do |row, i|
|
155
155
|
row.map.with_index do |s, j|
|
data/spec/_spec.rb
CHANGED
@@ -1322,6 +1322,17 @@ describe MLL do
|
|
1322
1322
|
|
1323
1323
|
end
|
1324
1324
|
|
1325
|
+
example "handle nils" do
|
1326
|
+
|
1327
|
+
expect(grid[[[nil, nil], [nil, "a"]]]).to eq \
|
1328
|
+
" \n" \
|
1329
|
+
" \n" \
|
1330
|
+
" \n" \
|
1331
|
+
" a \n" \
|
1332
|
+
" \n"
|
1333
|
+
|
1334
|
+
end
|
1335
|
+
|
1325
1336
|
end
|
1326
1337
|
|
1327
1338
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Maslov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|