Hecl 脚本是否与本机 J2ME midlet 一样强大?
查看 Hecl(带有 J2ME 运行时的脚本语言),我想知道它的功能:
假设我的基础Midlet 具有我编写的方法和变量
- Hecl 解释器能否在我的 Midlet 中运行,并与我的类并行运行?
- Hecl 脚本可以调用 Midlet 中我的任何方法吗?
- Hecl 脚本可以利用和修改我的任何变量吗?
提前致谢。
Looking over Hecl, the scripting language with a J2ME runtime, I wonder about its capabilities:
Assuming my base Midlet has methods and variables that I've written
- Can the Hecl interpreter run within my Midlet, and side-by-side with my classes?
- Can the Hecl script call any of my methods within the Midlet?
- Can the Hecl script utilize and modify any of my variables?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Jeremy - 此时您最好给我发电子邮件或(甚至更好)写信到 Hecl 邮件列表,而不是依靠我的 RSS feed 来通知我与 Hecl 相关的 SO 文章!
是的,Hecl 可以作为“嵌入式”解释器运行。例如,您可以用 Java 编写整个应用程序,并且仅使用解释器进行回调以响应事件。
由于 J2ME 没有反射,因此您必须在方法和解释器可用的内容之间编写粘合剂。不过,这很简单: PutsCmd.java
要修改变量,您必须再次提供一些粘合剂。但这并不难。有多种方法可以在 Hecl 值和 Java 值之间来回映射。
无论如何,我会时不时地观看 SO,但邮件列表或电子邮件可能是解决更详细问题的更好地方。
Jeremy - at this point you'd be better off emailing me or (even better) writing to the Hecl mailing list, rather than relying on my RSS feed to notify me of SO articles related to Hecl!
Yes, Hecl can run as an 'embedded' interpreter. For instance, you could write an entire app in Java and only use the interpreter for callbacks in response to events.
Since J2ME doesn't have Reflection, you have to write the glue between your methods and what's available to the interpreter. It's pretty easy, though: PutsCmd.java
To modify variables, once again, you'd have to provide some glue. It's not that hard though. There are ways to map back and forth between Hecl values and Java values.
In any case, I watch SO from time to time, but the mailing list or email would probably be a better place for more detailed questions.