This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building on MacOS X and arrays from slib


Frederick Ross wrote:
I'd really like to have the SLIB array functions.

Is the Kawa SRFI-25 array functions not enough? I assume you've checked out: http://www.gnu.org/software/kawa/Arrays.html Note you can call share array on a uniform vector. See the and of the above-mentioned web-page and http://www.gnu.org/software/kawa/Uniform-vectors.html Also see the end of this reply.

The SRFI-25 arrays uses by Kawa seem to be widely implemented
than the SLIB/SRFI-47 arrays, though I guess not all SRFI-25
implementations allow wrapping unform vector like Kawa does.

If there is demand, it probably won't be difficult to add the SLIB
array interface as well.   One complication is that the make-array
function in SRFI-47 is different from that of SRFI-25, though it is
possible to distinguish them depending on the arguments.

The policy on slib
at the moment appears to be "throw it in, see if it works."

There are two problems with slib: (1) As distributed, it isn't designed for the compiler-oriented architecture of Kawa. This is mainly a problem with things like macro expanders or anything else which makes global changes. Not necessarily a fundamental problem. (2) It's a hodge-podge of features and utilities, often overlapping.

However, it would be nice to support SLIB.  Ideally, I'd like
to support the SLIB primitives to the extent that no kawa.init
file is needed.

Maybe a project for a volunteer?

../../gnu/mapping/OutPort.java:10: gnu.mapping.OutPort is not abstract
and does not override abstract method print(java.io.PrintWriter) in
gnu.mapping.Printablepublic class OutPort extends PrintConsumer
implements Printable

gnu.mapping.Printable no longer exists in Kawa. It has been replaced by gnu.text.Printable.

You must have some old version of kawa in your CLASSPATH.

Now what I'd really like is to be able to put a reshaped array form on
top of a native one dimensional array of doubles, but at a guess
that's deep black magic.

Not really. The basic idea is in the manual, at the end of http://www.gnu.org/software/kawa/Arrays.html

If you have an existing Java double array, you can create an f46vector
by using the F64Vector (double[] data) constructor:

(define jarr (<double[]> 1.0 2.0 3.0 4.0 5.0 6.0))
(define farr (gnu.lists.F64Vector:new jarr))
(define farr2
  (share-array farr (shape 0 2 0 3) (lambda (i j) (+ (* 2 i) j))))
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]