In java i would read the whole file in to byte array and do some processing with it. Now i want to implement the same algorithm in clojure.
What i am wondering is can i use a list instead of an array?
I know i can create array from clojure but what is the lisp way of handling this?
If the file in question is very large, you should always consider using a memory mapped file. clojure.contrib.mmap
offers some functions to deal with that.
I know i can create array from clojure but what is the lisp way of handling this?
I don't know about the Lisp way, but the Clojure way allows you to use the sequence functions on arrays, so you don't have to decide between efficient representation and comfortable handling (which in my opinion is one of the points that makes Clojure so pragmatic).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With