This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Android REPL - add* syntax-sugar not available in constructor
- From: teyc <teyc at cognoware dot com>
- To: kawa at sourceware dot org
- Date: Sat, 28 Jan 2012 17:11:28 -0800 (PST)
- Subject: Android REPL - add* syntax-sugar not available in constructor
I'm starting to have fun with the REPL Helmut provided.
The following works,
#|kawa:76|# (*activity*:run-on-ui-thread
(runnable
(lambda ()
((android.widget.Toast:makeText
*activity*
"Hello from REPL"
android.widget.Toast:LENGTH_LONG):show))
as does the following
#|kawa:78|#
(*activity*:runOnUiThread
(runnable
(lambda ()
(*activity*:setContentView
(android.widget.TextView *activity* text: "Changed Content")))))
Unfortunately, the REPL running under Android doesn't recognize the
"addView" in the constructor.
It is not a big problem, but the syntax sugar makes for rather nice way of
laying out the UI without the verbosity in Java. Are are any magic switches
left?
#|kawa:319|#
(android.widget.LinearLayout *activity*
orientation: android.widget.LinearLayout:VERTICAL
view:
(android.widget.TextView *activity*
text: "Hello, Android REPL from Kawa Scheme!"))
java.lang.RuntimeException: no such field view in
android.widget.LinearLayout
at gnu.kawa.reflect.SlotSet.apply(SlotSet.java:115)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java:239)
at gnu.kawa.reflect.Invoke.apply(Invoke.java:99)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:180)
at kawa.Shell.run(Shell.java:279)
at kawa.Shell.run(Shell.java:194)
at kawa.Shell.run(Shell.java:175)
at kawa.TelnetRepl.apply0(TelnetRepl.java:23)
at gnu.mapping.RunnableClosure.run(RunnableClosure.java:78)
at gnu.mapping.Future.run(Future.java:44)
--
View this message in context: http://old.nabble.com/Android-REPL---add*-syntax-sugar-not-available-in-constructor-tp33222365p33222365.html
Sent from the Sourceware - kawa list mailing list archive at Nabble.com.