Mirko,

I was unsure of what you meant when you first mentioned a macro.  It should be pointed out that unlike in the C world, a lisp macro is not a forced inline version of a function.  The is an inline declaration statement that (on efficiency minded compilers) inlines functions in your code.  Macros are used for different things that functions.  99.9% (perhaps 100%) of the time, using a macro as you have described is not a good idea as you can get better functionality by defining an function (inlined if necessary).

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).

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.

Zach


On Fri, May 16, 2008 at 3:44 PM, Tamas K Papp <tpapp@princeton.edu> wrote:
On Fri, May 16, 2008 at 05:02:18PM -0400, Liam Healy wrote:

> amenable to changing it, but I think Zach's suggestion about
> packages is what I intended: you shouldn't really program in
> the GSLL package; make your own package like gsll-user and
> you can do whatever you want.

I would agree.  Putting gsll: before function names is the way to go.

> I don't think copying should be part of the library call because
> the user is compelled to pay a copying penalty which may
> (and should) be minimized by working in foreign arrays throughout

I second that.  In a lot of calculations, many matrices are
intermediate results and will be discarded anyhow, there is little
sense in copying them.

> As a side point, I am working on incorporating
> foreign-friendly arrays, and there is a separate function
> (currently called make-array*) that creates arrays, similar to
> make-array, but the type specification is mandatory.  If
> you are using SBCL, the C array is the CL array;
> if not, the right thing will always happen (once debugged...).

I am looking forward to that...

Tamas
_______________________________________________
Gsll-devel mailing list
Gsll-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel