Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 58 lines (41 sloc) 0.957 kB
0324899 @substack readme and example
authored
1 disorder
2 ========
3
4 Compute expressions out of order, like `where` or `let` blocks in haskell.
5
6 example
7 =======
8
9 ``` js
10 var disorder = require('disorder');
11
12 var vars = disorder({
13 x : function (y, f, z) { return z * f(y + 1) },
14 y : function (z) { return z * 2 },
15 z : 5,
90b2c67 @substack example works now
authored
16 f : function (y) { return function (n) { return y * n } },
0324899 @substack readme and example
authored
17 });
18 console.dir(vars);
19 ```
20
90b2c67 @substack example works now
authored
21 output:
22
23 ```
24 { z: 5, y: 10, f: [Function], x: 550 }
25 ```
26
0324899 @substack readme and example
authored
27 methods
28 =======
29
30 ```
31 var disorder = require('disorder')
32 ```
33
34 disorder(exprs)
35 ---------------
36
37 Given an object of variable expressions `exprs` that maps names to function
38 expressions or constants, return an object that solves the dependency graph, if
39 possible.
40
41 Each expression can be a constant value or a function to express a dependant
42 value. To specify dependencies, use the variable expression name in the
43 arguments list.
44
45 install
46 =======
47
48 With [npm](http://npmjs.org) do:
49
50 ```
51 npm install disorder
52 ```
53
54 license
55 =======
56
57 MIT
Something went wrong with that request. Please try again.