Order Expressions


Given a list of expressions

  	d:c+b
  	c:-b
  	e:d*a
  	b:10
  	a:20

reorder so that everything is computed before it is used:

	b:10
  	c:-b
  	a:20
  	d:c+b
  	e:d*a

Assume the expressions have been parsed, and one by-product is the dictionary s:

	s:.((`d;`c `b)
      	    (`c;,`b)
      	    (`e;`d `a)
      	    (`b;())
      	    (`a;()))

That is, d uses s.d = c,b, b uses s.b = (), &c. Then

  order:{?|,/(?,/x@)\y}
  order[s;!s]
`b`c`a`d`e

Find the code here.