I don't have the answer to your question, but you'd better take "base" into consideration:

1
2
3
4
let a2l a =
  let x0,y0 = Array2.base1 a, Array2.base2 a in
  let x1,y1 = x0 + Array2.length1 a - 1, y0 + Array2.length2 a - 1 in
  [for x in x0..x1 -> [for y in y0..y1 -> a.(x,y)]];;
By on 1/5/2008 2:07 PM ()

Thanks a bunch for that. :)

I guess I didn't realize that you could set the base (like 0- or 1-indexed) of the Array2 data structure.

And I keep forgetting about the list comprehensions! Man those are nice.

By on 1/5/2008 2:53 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper