This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Kawa JTable String[][] arrays
- From: Per Bothner <per at bothner dot com>
- To: Fabian Boucsein <Fabian dot Boucsein at gmx dot de>
- Cc: Tom Bousso <tombousso at gmail dot com>, kawa at sourceware dot org
- Date: Fri, 10 Nov 2017 08:01:46 -0800
- Subject: Re: Kawa JTable String[][] arrays
- Authentication-results: sourceware.org; auth=none
- References: <trinity-7674b18c-b1b6-49e9-a7a7-46c0d172acfc-1510218373929@3c-app-gmx-bs67> <CAN9NfqOiFMUGgoyTddB89BwwD6h5etESy_Fi=-XOxnQXETsr2A@mail.gmail.com> <e8a06a71-d353-ba4d-2e38-5abb85955558@bothner.com> <trinity-04a5af7c-37c2-44e1-bbbf-f72f1f5c74ff-1510328667207@3c-app-gmx-bs65>
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/