website/index.html in patternmatching-0.1.4 vs website/index.html in patternmatching-0.2.0
- old
+ new
@@ -31,11 +31,11 @@
<div id="main">
<h1>PatternMatching module</h1>
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/patternmatching"; return false'>
Get Version
- <a href="http://rubyforge.org/projects/patternmatching" class="numbers">0.1.4</a>
+ <a href="http://rubyforge.org/projects/patternmatching" class="numbers">0.2.0</a>
</div>
<h1>→ ‘patternmatching’</h1>
<h2>What</h2>
@@ -69,13 +69,11 @@
<p>Note: Default equivalence used in structured pattern matching is
based on “<code>pattern === data</code>”,
so “<code>foo(Numeric)</code>” matches “<code>foo(100)</code>”.</p>
- <p>Notice: Current implementation is not thread safe now.
-Need the receiver object(NOT an argument) calling pattern matching
-synchronized when multi-threaded access.</p>
+ <p>From ver. 0.2.0, thread unsafeness restriction is removed.</p>
<h2>Demonstration of usage</h2>
@@ -197,10 +195,50 @@
puts "no name"
end
end # => "He is Jiro"
</pre>
+<h3>Field Access Example</h3>
+It is ver 0.2.0 <span class="caps">API</span>
+<pre>
+require "patternmatching"
+
+include PatternMatching
+
+class Foo
+ def initialize
+ @name = "Foo"
+ end
+ attr :name
+ def foo
+ end
+
+ def bar
+ make "bar" do
+ seems as {:val} do
+ foo
+ # To access fields like this.name or this.name = ...
+ the.name = val
+ # To access self as this
+ this
+ end
+ end
+ end
+
+ func(:buzz).seems as {:val} do
+ the.name = val
+ this
+ end
+end
+
+o = Foo.new
+p o.bar == o #=> true
+p o.name #=> "bar"
+p o.buzz("buzz") == o #=> true
+p o.name #=> "buzz"
+</pre>
+
<h2>Forum</h2>
<p>Visit RubyForge project forum.</p>
@@ -218,10 +256,10 @@
<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
- <h2>Link</h2>
+ <h2>Links</h2>
<ul>
<li><a href="http://patternmatching.rubyforge.org/">Web Site</a></li>
<li><a href="http://rubyforge.org/projects/patternmatching/">Project Page</a></li>