README.txt in patternmatching-0.1.4 vs README.txt in patternmatching-0.2.0
- old
+ new
@@ -21,13 +21,11 @@
Note: Default equivalence used in structured pattern matching is
based on "pattern === data",
so "foo(Numeric)" matches "foo(100)".
-Notice: Current implementation is not thread safe now.
-Need the receiver object(NOT an argument) calling pattern matching
-synchronized when multi-threaded access.
+From ver. 0.2.0, thread unsafeness restriction is removed.
== Demonstration of usage
Symbols(e.g. ":a", ":right_value")
in patterns is passed as variable
@@ -140,10 +138,49 @@
seems something do
puts "no name"
end
end # => "He is Jiro"
+=== Field Access Example
+It is ver. 0.2.0 API
+
+ 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"
+
== Forum
Visit the project forum in RubyForge.
== How to submit patches
@@ -156,14 +193,14 @@
== License
This code is free to use under the terms of the MIT license.
-== Link
+== Links
-* Web Site: http://patternmatching.rubyforge.org/
-* Project Page: http://rubyforge.org/projects/patternmatching/
-* API Doc: http://patternmatching.rubyforge.org/rdoc/
+* {Web Site}[http://patternmatching.rubyforge.org/]
+* {Project Page}[http://rubyforge.org/projects/patternmatching/]
+* {API Doc}[http://patternmatching.rubyforge.org/rdoc/]
== Contact
Comments are welcome. Send a message to the forum.