public static long[] ToLongArray(Obj obj) { if (obj.IsSeq()) { long[] array = obj.GetLongArray(); return(Array.Take(array, array.Length)); } Obj[] elts = obj.GetObjArray(); int len = elts.Length; long[] longs = new long[len]; for (int i = 0; i < len; i++) { longs[i] = elts[i].GetLong(); } return(longs); }