README.md in damsi-0.0.1 vs README.md in damsi-0.0.2
- old
+ new
@@ -7,37 +7,21 @@
[![Hits-of-Code](https://hitsofcode.com/github/yegor256/damsi)](https://hitsofcode.com/view/github/yegor256/damsi)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/damsi/blob/master/LICENSE.txt)
It's a simulator of a dataflow machine.
-First, you define a dataflow graph and save it to `fibo.dfg`
-(this is the calculator of the 5th Fibonacci number):
+First, you define a dataflow graph and save it to `test.dfg`:
```
-send :fibo n:5
-send :if f:1
-recv :fibo [:n] do
- send :gt n:n
- send :dec1 n:n
- send :dec2 n:n
- send :sum a:n # if tagged
- send :sum b:n # if tagged right
+recv :start do
+ send :sum, :a, 10
+ send :sum, :b, 15
end
-recv :if [:c, :t, :f] do
- if c
- send :fibo n:t
- else
- send :fibo n:f
- end
+recv :sum do |a, b|
+ send :mul, :x, (a+b)
end
-recv :sum [:a, :b] do
- send :if (a + b)
-end
-recv :dec1 [:n] do
- send :fibo n:(n-1)
-end
-recv :dec2 [:n] do
- send :fibo n:(n-2)
+recv :mul do |x|
+ send :stop, :x, x
end
```
This is a Ruby dialect.