egison 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -4
  3. data/lib/egison/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5afc8d46f5b374e4e9aa32fb7b8328b9c687fd3
4
- data.tar.gz: 37e963f48ccea8f645d18b16b29cb2a96005c436
3
+ metadata.gz: de7ad9f50fc2017c4546ff5ec489cd05e73fb13e
4
+ data.tar.gz: 093963280669d6413a0729c82902bf342e321c82
5
5
  SHA512:
6
- metadata.gz: a999b3b1b4687d3fbc6b7ec65b5883d2992ba96478a8206ee6d7bf240475bb4113730ac2062e217c9877077f6ab2294268f98e7bcf8ab40182580d3ac459561f
7
- data.tar.gz: 8cd1ee8f05b986418f223980e5c31491562caf7ceb4c020dd211c7d3f2ccfa4924ac6021da90ea6f029476c9dec57d1d89c7477432cfb18e52bb9c8ec88158e3
6
+ metadata.gz: 00bdaec6a09f92e11144f45bdd4835c06ade096c13769350d9766a55ab27a0b5a92ab8c25186e8c5e604ba8adf5b76a722986434e9f3c9ae498c5c1488e33d5f
7
+ data.tar.gz: 314486adbe83a12d08f46c92e0dc062c52555d9f152e158103b0962bd1300f1b3f75093a95b3d3b3948a7529c6580b51021071486923a5e27d927e34a2226cfd
data/README.md CHANGED
@@ -13,7 +13,7 @@ $ gem install egison
13
13
  or
14
14
 
15
15
  ```
16
- $ git clone git://github.com/egison/egison-ruby.git
16
+ $ git clone https://github.com/egison/egison-ruby.git
17
17
  $ cd egison-ruby
18
18
  $ gem build egison.gemspec
19
19
  $ gem install egison-*.gem
@@ -23,13 +23,13 @@ or
23
23
 
24
24
  ```
25
25
  $ gem install bundler (if you need)
26
- $ echo "gem 'egison', :git => 'git://github.com/egison/egison-ruby.git'" > Gemfile
26
+ $ echo "gem 'egison', :git => 'https://github.com/egison/egison-ruby.git'" > Gemfile
27
27
  $ bundle install --path vendor/bundle
28
28
  ```
29
29
 
30
30
  ## Basic Usage
31
31
 
32
- egison library provides `Kernel#match` and `Kernel#match_all`.
32
+ The library provides `Kernel#match_all` and `Kernel#match`.
33
33
 
34
34
  ```
35
35
  require 'egison'
@@ -107,6 +107,16 @@ match_all([1, 2, 3]) do
107
107
  end #=> [[1, 1],[1, 2],[1, 3],[2, 1],[2, 2],[2, 3],[3, 1],[3, 2],[3, 3]]
108
108
  ```
109
109
 
110
+ Note that <code>_[]</code> is provided as syntactic sugar for <code>List.()</code>.
111
+
112
+ ```
113
+ match_all([1, 2, 3]) do
114
+ with(_[_a, _b, *_]) do
115
+ [a, b]
116
+ end
117
+ end #=> [[1, 2]]
118
+ ```
119
+
110
120
  ### Non-linear patterns
111
121
 
112
122
  Non-linear pattern is the most important feature of our pattern-matching system.
@@ -180,6 +190,8 @@ p(poker_hands([["diamond", 4], ["club", 2], ["club", 5], ["heart", 1], ["diamond
180
190
  p(poker_hands([["diamond", 4], ["club", 10], ["club", 5], ["heart", 1], ["diamond", 3]])) #=> "Nothing"
181
191
  ```
182
192
 
193
+ You can find more demonstrations in the [`sample`](https://github.com/egison/egison-ruby/tree/master/sample) directory.
194
+
183
195
  ## About Egison
184
196
 
185
197
  If you get to love the above pattern-matching, please try [the Egison programming language](http://www.egison.org), too.
@@ -187,7 +199,7 @@ Egison is the pattern-matching oriented pure functional programming language.
187
199
  Actually, the original pattern-matching system of Egison is more powerful.
188
200
  For example, we can do following things in the original Egison.
189
201
 
190
- - We can pattern-match against infinite lists
202
+ - We can pattern-match against infinite lists.
191
203
  - We can define new pattern-constructors.
192
204
  - We can modularize useful patterns.
193
205
 
@@ -1,3 +1,3 @@
1
1
  module Egison
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egison
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Egi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-05 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake