← Back to context

Comment by bakul

7 years ago

This can get a bit tricky. You can do something like this today:

  d:{_sqrt+/(y-x)^2}
  ls: 2 10 # 20 _draw 0 // a list of 10 random points
  +/d':ls // total length

Now if x, y above are vectors of points (as opposed to vectors of pairs), and if points have their own - verb, total length becomes "+/{y-x}':ls". But to define such a - for point, you'd need conversion verbs (or enclose/disclose).