'UTILITY.MSP '
program  vecinit (expression n)
 'makes vector length n'
{
  let lv list(0);
  do
   until n <= length(lv)
   returning lv
   {let lv node(0,lv) }
   lisp (make nl (eval (cons (quote vector) lv)));
}

program  sequence (expression n)
 'makes vector 1,2,3,... n'
{
  let lv list(n);
  do
   i=n
   until n <= length(lv)
   returning lv
   {let i i-1;
   let lv node(i,lv) }
   lisp (make nl (eval (cons (quote vector) lv)));
}


program vjoin (vector #0 v1) (vector #0  v2)
 {
  let rv vecinit(length(v1)+length(v2));
  let l1 length(v1);
  let l2 length(v2);
  do
   i = 1
   until i > l1
    returning rv
    {LISP (setc rv i (v1 i));
     let i i+1;}
  do
   i = 1
   until i > l2
    returning rv
    {LISP (setc rv (+ l1 i) (v2 i));
     let i i+1;}
 }
