From: Paul Smith Date: 2009-10-14T05:56:37+09:00 Subject: Re: how to solve a special JRuby and Java syntax conflict? On Tue, Oct 13, 2009 at 9:52 PM, Paul Smith wrote: > On Tue, Oct 13, 2009 at 8:52 PM, Axel Etzold wrote: >> Dear all, >> >> I am trying to use a Java class in JRuby from an external Java >> library. This runs all very nicely, yet at some point, >> I have to define a matrix. In the Java library, this is >> supposed to be done using this syntax: >> >> double[][] a = { { 1.1, 1.2, 1.3, 1.4 }, { 2.1, 2.2, 2.3, 2.4 }, { 3.1, 3.2, 3.3, 3.4 } }; >> > > a = [[1.1, 1.2, 1.3, 1.4], [2.1, 2.2, 2.3, 2.4], [3.1, 3.2, 3.3, 3.4]] > > ? Sorry, I just realised I haven't got a clue what I'm talking about when it comes to JRuby. However, the [[],[]] notation is how to describe an array of arrays in Ruby, which is what a matrix essentially is. -- Paul Smith http://www.nomadicfun.co.uk paul@pollyandpaul.co.uk