From: Paul Smith Date: 2009-10-14T05:52:09+09:00 Subject: Re: how to solve a special JRuby and Java syntax conflict? 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]] ? > There does not seem to be another way of populating a matrix, however > using curly braces in JRuby mistakes "a" for a Hash. > > Is there a workaround for this problem ? > > Thank you very much ! > > Best regards, > > Axel > -- > Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - > sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser > > -- Paul Smith http://www.nomadicfun.co.uk paul@pollyandpaul.co.uk