public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Sonny To <son.c.to@gmail.com>, Kawa mailing list <kawa@sourceware.org>
Subject: Re: putting symbols into Environment
Date: Thu, 14 Sep 2017 00:28:00 -0000	[thread overview]
Message-ID: <7ebc09b0-2243-a1c0-4da2-d4f0fb73827e@bothner.com> (raw)
In-Reply-To: <CAJxjsJsoztphnxfX71H-mN6rENB6UNSYPZ+OTi=QNqb24P_8EA@mail.gmail.com>

On 09/13/2017 05:05 PM, Sonny To wrote:
> I'm trying to use the TelnetRepl in an android Service but cannot
> figure out how to put bindings into the environment

>                      env.put(Symbol.makeUninterned("context", null),
> applicationContext)

> I can telnet to it but the "context" symbol is not available
> 
> #|kawa:4|# context
> /dev/stdin:4:1: unbound location: context

That would be expected if you use Symbol.makeUninterned.
An uninterned symbol is a unique object that you can *not*
"lookup".  For example (string->symbol "context") is the
same as 'symbol - but (Symbol:makeUninterned "context") is a completely
different object.

Instead, try Symbol.valueOf("context").

> Do I have the wrong environment? if so how to get the correct environment?

There might be other problems, but fix the above-mentioned problem first.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

  reply	other threads:[~2017-09-14  0:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14  0:05 Sonny To
2017-09-14  0:28 ` Per Bothner [this message]
     [not found]   ` <CAJxjsJv-_yabJvr7PkxyqKS+b7bQ2RoL40ORsfJG5vmRv0KAWA@mail.gmail.com>
2017-09-15 12:48     ` Sonny To
2017-09-15 14:55       ` Per Bothner
2017-09-15 13:48     ` Sonny To

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=7ebc09b0-2243-a1c0-4da2-d4f0fb73827e@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=son.c.to@gmail.com \
    /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).