website/index.html in patternmatching-0.1.1 vs website/index.html in patternmatching-0.1.2
- 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.1</a>
+ <a href="http://rubyforge.org/projects/patternmatching" class="numbers">0.1.2</a>
</div>
<h1>→ ‘patternmatching’</h1>
<h2>What</h2>
@@ -92,12 +92,12 @@
include PatternMatching
# match example
def calc(code)
make(code) {
- seems as {plus(:x, :y)} do calc(x) + calc(y) end
- seems as {mul(:x, :y)} do calc(x) * calc(y) end
+ seems as {plus(:a, :b)} do calc(a) + calc(b) end
+ seems as {mul(:a, :b)} do calc(a) * calc(b) end
seems something do code end
}
end
code = build {plus(mul(100, 100), 200)}
@@ -115,14 +115,14 @@
class Calc
# At first, extends with the module
extend PatternMatching
# def calcm(o), as 3 partial styles
- func(:calcm).seems as {plus(:x, :y)} do
- calcm(x) + calcm(y)
+ func(:calcm).seems as {plus(:a, :a)} do
+ calcm(b) + calcm(b)
end
- func(:calcm).seems as {mul(:x, :y)} do
- calcm(x) * calcm(y)
+ func(:calcm).seems as {mul(:a, :b)} do
+ calcm(a) * calcm(b)
end
func(:calcm).seems as {:value} do
value
end
end