public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* scoping rules
@ 2017-09-17 16:51 Sonny To
  2017-09-17 17:45 ` Per Bothner
  0 siblings, 1 reply; 6+ messages in thread
From: Sonny To @ 2017-09-17 16:51 UTC (permalink / raw)
  To: Kawa mailing list

sorry for the newb question but i find this behavior odd

(let ((handler (android.os.Handler (android.os.Looper:getMainLooper)))
      (c context))
  (handler:post (lambda ()
                        (let ((t (android.widget.Toast:makeText (as
android.app.Application c) "foobar"  1000)))
                          (t:show))
                        )))

To get this example to work I had to bind c context in the top level let
in the second let, I have to use c instead of context directly.
(android.widget.Toast:makeText (as android.app.Application context)
will complain

/dev/stdin:45:93: unbound location: context

it could not see the context binding.
Should it not look in the environment? context is definitely in the
environment because the c binding works

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-18 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-17 16:51 scoping rules Sonny To
2017-09-17 17:45 ` Per Bothner
2017-09-17 18:49   ` Sonny To
2017-09-18  8:29     ` Sonny To
2017-09-18  8:31       ` Sonny To
2017-09-18 12:34       ` Sonny To

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).