examples/enumerable_matching.rb in patternmatching-0.2.4 vs examples/enumerable_matching.rb in patternmatching-0.2.5
- old
+ new
@@ -6,11 +6,11 @@
# Example for matching Enumerable
inputs = build { exact([1,2,3,4,5]) }
make inputs do
# _! matches rests of list
seems as {exact([:a,:b, _!(:c)])} do
- puts a.to_s + ", " + b.to_s + " and " + c.to_s
+ puts a.to_s + ", " + b.to_s + " and " + c.join(", ")
end
seems something do
puts "not matched"
end
-end # => "1, 2, and 345"
+end # => "1, 2, and 3, 4, 5"