shen-ruby 0.12.0 → 0.12.1

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
  SHA1:
3
- metadata.gz: 2cc8006d7f3fac61a20da31b9abe918d51ccfc56
4
- data.tar.gz: bb145ab8f07ab6ede1cb1eef9ff9ea5aa219d31a
3
+ metadata.gz: ef53ec1dece12e1268ad947755b50ac7f0dde4b7
4
+ data.tar.gz: 1f72b4134912bb154027f240c1ef3fa5f65472ae
5
5
  SHA512:
6
- metadata.gz: 9a3c09ebb9aaf85a1df12b949ea8d820f3924aa7034dad4c425af651d1e898323e2c725e067ded89e81e441abe7d7624e37a53f9e8438af52df30044f0dd3b3f
7
- data.tar.gz: 57339d8ecf2d9cc0e2bcc2e452235e15eb9ce70f4d36244a880cd79cc55706ade719bcc54ef1a9ee9f064964ac77ae63e7fd1ee7da69b38c380ad3eb453e1821
6
+ metadata.gz: 5eef86bddefaf28ffa148243ab05c2818bd9fd52365cc7653c5b17d0b7fc5e46acc0e84ce7112bb5333c54584ce4b164db0ac0d42366183e496c4850198d6f3f
7
+ data.tar.gz: 86e6189fed2c9860123fdf61728bb1b6e0f58a151911f696fad067a5ec16bdf5773ecc84bdb42ca3a6baa6a6cb5168d34426c16297392ca31a562e584488d2bb
data/HISTORY.md CHANGED
@@ -1,11 +1,15 @@
1
1
  # ShenRuby Release History
2
2
 
3
- ## 0.12.0 - January 31, 2014
3
+ ## 0.12.1 - February 1, 2015
4
+ ### Breaking Changes
5
+ - The arity of block arguments to Ruby methods no longer needs to be specified. Now all block arguments are denoted by a `&` followed by the function to pass as the block. Any usages of the old syntax, e.g. `&2`, must be updated to `&`.
6
+
7
+ ## 0.12.0 - January 31, 2015
4
8
  ### Features
5
9
  - Shen -> Ruby interop
6
10
  - See README.md for details
7
11
 
8
- ## 0.11.0 - January 15, 2014
12
+ ## 0.11.0 - January 15, 2015
9
13
  ### Features
10
14
  - KLambda implementation switched to [Klam](https://github.com/gregspurrier/klam). This has many implications, including:
11
15
  - Significant performance increase. E.g., the Shen Test Suite now runs 2.5 times faster than with ShenRuby 0.10.0.
data/README.md CHANGED
@@ -14,7 +14,7 @@ ShenRuby 0.1.0 began to satisfy the first goal by providing a Shen REPL accessib
14
14
  ## Installation
15
15
  NOTE: ShenRuby requires Ruby 1.9 language features. It is tested with Ruby 2.0.0, 2.1.5, and 2.2.0. It has been lightly tested with JRuby 1.7.17. It is functional with Ruby 1.9.3, however its fixed stack size prevents it from passing the Shen Test Suite (see [Setting Stack Size](setting-stack-size) below).
16
16
 
17
- ShenRuby 0.12.0 is the current release. To install it as a gem, use the following command:
17
+ ShenRuby 0.12.1 is the current release. To install it as a gem, use the following command:
18
18
 
19
19
  gem install shen-ruby
20
20
 
@@ -29,7 +29,7 @@ Once the gem has been installed, the Shen REPL can be launched via the `srrepl`
29
29
  released under the Shen license
30
30
  www.shenlanguage.org, version 16
31
31
  running under Ruby, implementation: ruby 2.2.0
32
- port 0.12.0 ported by Greg Spurrier
32
+ port 0.12.1 ported by Greg Spurrier
33
33
 
34
34
 
35
35
  (0-)
@@ -162,7 +162,7 @@ Many Ruby methods take a `Hash` object as their final parameter. Ruby provides a
162
162
  As in Ruby, the key-arrow-value triples must be the final normal arguments to the method.
163
163
 
164
164
  #### Block Parameters
165
- In addition to normal arguments, Ruby methods may also accept blocks. A block argument in ShenRuby is denoted by `&n`--where `n` is the arity of the block expected by the method--followed by a function. Arities from 0 to 5 are supported. If the arity is one, `&` may be used instead of `&1`. The arity marker and the block function must be the last two elements of the argument list.
165
+ In addition to normal arguments, Ruby methods may also accept blocks. A block argument in ShenRuby is denoted by the symbol `&` followed by a function. These must be the final two elements in the method's argument list.
166
166
 
167
167
  For example, to print each character of a string on a separate line using Shen's `pr` and `nl` system functions:
168
168
 
@@ -170,7 +170,7 @@ For example, to print each character of a string on a separate line using Shen's
170
170
 
171
171
  Or, to sum the elements of a list using Ruby's `Enumerable#reduce`:
172
172
 
173
- (rb.reduce [1 2 3] &2 +)
173
+ (rb.reduce [1 2 3] & +)
174
174
 
175
175
  This use of `reduce` is possible because Shen's list and vector types are enumerable in ShenRuby.
176
176
 
@@ -43,8 +43,8 @@
43
43
  \\\\ Parsing of method argument lists
44
44
 
45
45
  (defcc <method-invocation>
46
- Receiver Method <normal-args> <block-args> :=
47
- [rb-send-block Receiver Method | (append <block-args> <normal-args>)];
46
+ Receiver Method <normal-args> <block-arg> :=
47
+ [rb-send-block Receiver Method <block-arg> | <normal-args>];
48
48
  Receiver Method <normal-args> :=
49
49
  [rb-send Receiver Method | <normal-args>];)
50
50
 
@@ -71,17 +71,11 @@
71
71
  (and (symbol? Sym)
72
72
  (= (hdstr (str Sym)) "&"))));)
73
73
 
74
- (defcc <block-args>
75
- <arity-marker> Expr := [<arity-marker> Expr];)
76
-
77
- (defcc <arity-marker>
78
- X := 1 where (= X (intern "&"));
79
- X := 0 where (= X (intern "&0"));
80
- X := 1 where (= X (intern "&1"));
81
- X := 2 where (= X (intern "&2"));
82
- X := 3 where (= X (intern "&3"));
83
- X := 4 where (= X (intern "&4"));
84
- X := 5 where (= X (intern "&5"));)
74
+ (defcc <block-arg>
75
+ <block-marker> Expr := Expr;)
76
+
77
+ (defcc <block-marker>
78
+ X := X where (= X (intern "&"));)
85
79
 
86
80
  (define make-hash-constructor
87
81
  Pairs -> (let Temp (gensym (protect Hash))
@@ -2,7 +2,7 @@
2
2
 
3
3
  \\ Convert a Ruby Enumerable to a Shen vector
4
4
  (define rb-to-l
5
- Enum -> (reverse (rb.reduce Enum [] &2 (/. L X (cons X L))))
5
+ Enum -> (reverse (rb.reduce Enum [] & (/. L X (cons X L))))
6
6
  where (rb.kind_of? Enum rb.#Enumerable)
7
7
  X -> (error (make-string "'~A' is not a Ruby Enumerable" X)))
8
8
 
@@ -1,3 +1,3 @@
1
1
  module ShenRuby
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.1"
3
3
  end
data/shen-ruby.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.required_ruby_version = ">= 1.9.3"
18
18
 
19
- s.add_runtime_dependency 'klam', '0.0.5', '0.0.5'
19
+ s.add_runtime_dependency 'klam', '0.0.6', '0.0.6'
20
20
 
21
21
  s.add_development_dependency 'rake', '~> 10.4.2', '>= 10.4.2'
22
22
  s.add_development_dependency 'rspec', '~> 3.1', '>= 3.1.0'
@@ -71,22 +71,22 @@ describe 'Shen -> Ruby interop', :type => :functional do
71
71
  end
72
72
 
73
73
  it 'supports arities other than 1' do
74
- expect_shen('(rb.reduce [1 2 3] &2 (/. A X (+ A X)))').to eq(6)
75
- expect_shen('(rb.reduce [1 2 3] &2 +)').to eq(6)
76
- expect_shen('(rb.reduce [1 2 3] &2 (function +))').to eq(6)
74
+ expect_shen('(rb.reduce [1 2 3] & (/. A X (+ A X)))').to eq(6)
75
+ expect_shen('(rb.reduce [1 2 3] & +)').to eq(6)
76
+ expect_shen('(rb.reduce [1 2 3] & (function +))').to eq(6)
77
77
  end
78
78
  end
79
79
  end
80
80
 
81
81
  describe "Shen's list type" do
82
82
  it 'implements Enumerable' do
83
- expect_shen('(rb.reduce [1 2 3] &2 +)').to eq(6)
83
+ expect_shen('(rb.reduce [1 2 3] & +)').to eq(6)
84
84
  end
85
85
  end
86
86
 
87
87
  describe "Shen's vector type" do
88
88
  it 'implements Enumerable' do
89
- expect_shen('(rb.reduce (@v 1 2 3 <>) &2 +)').to eq(6)
89
+ expect_shen('(rb.reduce (@v 1 2 3 <>) & +)').to eq(6)
90
90
  end
91
91
  end
92
92
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shen-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Spurrier
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.0.5
20
+ version: 0.0.6
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.0.5
27
+ version: 0.0.6
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement