Hecl 脚本是否与本机 J2ME midlet 一样强大?

发布于 2024-08-05 07:46:20 字数 288 浏览 3 评论 0原文

查看 Hecl(带有 J2ME 运行时的脚本语言),我想知道它的功能:

假设我的基础Midlet 具有我编写的方法和变量

  1. Hecl 解释器能否在我的 Midlet 中运行,并与我的类并行运行?
  2. Hecl 脚本可以调用 Midlet 中我的任何方法吗?
  3. 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

  1. Can the Hecl interpreter run within my Midlet, and side-by-side with my classes?
  2. Can the Hecl script call any of my methods within the Midlet?
  3. Can the Hecl script utilize and modify any of my variables?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美男兮 2024-08-12 07:46:20

Jeremy - 此时您最好给我发电子邮件或(甚至更好)写信到 Hecl 邮件列表,而不是依靠我的 RSS feed 来通知我与 Hecl 相关的 SO 文章!

  1. 是的,Hecl 可以作为“嵌入式”解释器运行。例如,您可以用 Java 编写整个应用程序,并且仅使用解释器进行回调以响应事件。

  2. 由于 J2ME 没有反射,因此您必须在方法和解释器可用的内容之间编写粘合剂。不过,这很简单: PutsCmd.java

  3. 要修改变量,您必须再次提供一些粘合剂。但这并不难。有多种方法可以在 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!

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

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文