public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: "Sudarshan S Chawathe" <chaw@eip10.org>
To: Duncan Mak <duncanmak@gmail.com>
Cc: kawa mailing list <kawa@sourceware.org>
Subject: Re: Working with string keys in a java.util.Map
Date: Fri, 03 Jul 2020 17:52:57 -0400	[thread overview]
Message-ID: <31504.1593813177@localhost> (raw)
In-Reply-To: Your message of "Fri, 03 Jul 2020 17:46:19 -0400." <CABgWrqrETRMdLoEmwyrCRFrDJ9=sk4BJ3W-91XAABkiXDJWS0w@mail.gmail.com>

I've had to get Java "String"s from Kawa strings often for similar
reasons when using other JVM libraries, etc., and I have just used
'(String "kawa string)'; it seems to work well, although it does
introduce clutter.

Regards,

-chaw

> Date: Fri, 3 Jul 2020 17:46:19 -0400
> Subject: Working with string keys in a java.util.Map
> To: kawa mailing list <kawa@sourceware.org>
> From: Duncan Mak via Kawa <kawa@sourceware.org>
> 
> Hello all,
> 
> I've been playing around with the java.nio APIs.
> 
> Using Files:readAttributes, you can get a Map<String, Object> of attributes.
> 
> #|kawa:80|# attrs
> {owner=duncan, lastAccessTime=2020-07-03T00:12:53.682826Z,
> lastModifiedTime=2019-04-22T18:53:02.529968Z, gid=20,
> creationTime=2019-04-22T18:53:02Z, isRegularFile=true, nlink=1,
> fileKey=(dev=1000007,ino=12896309012), ino=12896309012, mode=33261,
> uid=501, size=20799, dev=16777223, isSymbolicLink=false,
> permissions=[GROUP_READ, OWNER_READ, OTHERS_READ, OTHERS_EXECUTE,
> OWNER_WRITE, GROUP_EXECUTE, OWNER_EXECUTE], rdev=0,
> ctime=2019-04-22T18:53:02.533688Z, isOther=false, isDirectory=false,
> group=staff}
> 
> #|kawa:81|# (attrs:containsKey "owner")
> #f
> #|kawa:82|# (attrs:get "owner")
> #!null
> #|kawa:83|# (attrs:get "gid")
> #!null
> 
> I think this is failing because the literal string that I typed in is a
> gnu.lists.IString (https://www.gnu.org/software/kawa/Strings.html) and I
> don't see a function to force any one of Kawa's many string representations
> into a java.lang.String.
> 
> -- 
> Duncan.
> 
> 

  reply	other threads:[~2020-07-03 21:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 21:46 Duncan Mak
2020-07-03 21:52 ` Sudarshan S Chawathe [this message]
2020-07-03 22:33   ` Per Bothner
2020-07-04  1:30     ` Jamison Hope
2020-07-04  4:04       ` Duncan Mak
2020-07-04  4:29         ` Sudarshan S Chawathe
2020-07-04  5:24         ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31504.1593813177@localhost \
    --to=chaw@eip10.org \
    --cc=duncanmak@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).