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: double[][] type?


On 03/02/2011 07:39 PM, Per Bothner wrote:
I'm feeling my way into Kawa and using it to plot with the Java
interface to PlPlot. I need to pass an array of type double[][] to a
function (plcont) and can't see how to cast this.

To construct an array, you can do something like::


#|kawa:1|# (double[][] (double[] 3 4 5) (double[] 7 9))
[[3.0 4.0 5.0] [7.0 9.0]]

or:

#|kawa:2|# (double[][] length: 7)
[#!null #!null #!null #!null #!null #!null #!null]

#|kawa:14|# (define arr2::double[][] (double[][] length: 7))
#|kawa:15|# (set! (arr2 0) (double[] 4 5))
#|kawa:16|# (set! (arr2 4) (double[] 3 2))
#|kawa:17|# arr2
[[4.0 5.0] #!null #!null #!null [3.0 2.0] #!null #!null]
--
	--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]