On Fri, May 16, 2008 at 04:20:48PM -0600, Zach wrote:
Also, I am happy to see that Liam has posted a reply clearing up the comment on passing arrays by value. In most languages (including CL) certain objects are passed by value (in Lisp, numbers and characters), and some are passed by pointer, err, reference, don't know what exactly to call it (in Lisp, pretty much everything else). This was a point of confusion in my head when I first learned Lisp; it took me a while to realize that Lisp's implicit behavior is exactly the same as C's explicit behavior (with the exception of C's struct copying).
I learned to like the CL approach. My philosophy is that I only copy arrays when they are modified, everywhere else I just pass the "reference".
Foreign Friendly Arrays (FFA) is a library. You will not find info on it in the hyperspec. Look at the author's website (I believe this is your work, Tamas, right?) or the archives of this mailing list for that matter.
The original announcement is here: http://tkpapp.blogspot.com/2007/12/announcement-ffa.html
It is asdf-installable, but one can also get the source from my website.
What ffa does is that it tries to make a Lisp array available to C functions if the implementation and the array type permits (eg pinning in SBCL), and if not, it will be copied back and/or forth as needed. The package has a tutorial which I think explains things well. I prefer to keep my arrays in Lisp, hence this package.
Tamas