From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69212 invoked by alias); 10 Nov 2017 16:02:33 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 68974 invoked by uid 89); 10 Nov 2017 16:02:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:String, versus, japan, Japan X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Nov 2017 16:02:30 +0000 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eDBlE-0000bd-5g; Fri, 10 Nov 2017 17:02:28 +0100 Received: from 70-36-239-2.dsl.dynamic.fusionbroadband.com ([70.36.239.2] helo=localhost.localdomain) by mailfront11.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1eDBkb-0005KR-Lj; Fri, 10 Nov 2017 17:01:49 +0100 Subject: Re: Kawa JTable String[][] arrays To: Fabian Boucsein Cc: Tom Bousso , kawa@sourceware.org References: From: Per Bothner Message-ID: <97029a38-0311-9544-35e4-baa1f36ce461@bothner.com> Date: Fri, 10 Nov 2017 16:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q4/txt/msg00031.txt.bz2 On 11/10/2017 07:44 AM, Fabian Boucsein wrote: > Thank you very much Per and Tom. > > Per's version works very fine for me. Although i think they should be almost the same. What does ::String[][]? And maybe could you explain the difference between string and String? '::TYPE' (or with a space as in ':: TYPE') is a "type specifier". See https://www.gnu.org/software/kawa/Definitions.html. (define data::String[][] [["Japan" "245"] ["USA" "240"]]) would probably be more readable as (define data ::String[][] [["Japan" "245"] ["USA" "240"]]) (define data :: String[][] [["Japan" "245"] ["USA" "240"]]) Regardless it specifies that 'data' has the type "String[][]'. Normally ["Japan" "245"] evaluates to an immutable vector, but when the required type (in the static context) is a String[] then the compiler converts it for you. Similarly for String[][]/ You can write java.lang.String[][] instead of String[][]. They're not quite the same in terms what conversions they handle, but specify the same data type. The '[]' means a Java array type (as opposed to the multi-dimensional Scheme arrays). https://www.gnu.org/software/kawa/Standard-Types.html explains 'string' versus 'String'. -- --Per Bothner per@bothner.com http://per.bothner.com/