public inbox for rhug-rhats@sourceware.org
 help / color / mirror / Atom feed
* javascript + gcj
@ 2001-10-06 17:28 Anthony Green
  0 siblings, 0 replies; only message in thread
From: Anthony Green @ 2001-10-06 17:28 UTC (permalink / raw)
  To: Java@Gcc. Gnu. Org, rhug-rhats

FYI... I've just imported the Netscape/Mozilla javascript package (rhino) into
rhug.

In addition to the main library, lib-org-mozilla.so, it will install two
programs...

    js - a javascript shell

    jsc - a javscript compiler for generating .class files (compilable with
gcj)

javascript is actually kind of cool.  It looks quite practical as a general
scripting language because the gcj runtime loads relatively quickly.  Here's a
javascript version of libjava/scripts/showval.java, for instance..

---- cut here -----------------------------------------
#!/usr/local/bin/js

ch = arguments[0].lastIndexOf ('.');

className = arguments[0].substring (0, ch);
constName = arguments[0].substring (ch + 1);

klass = java.lang.Class.forName (className);
field = klass.getField (constName);

print (constName + " = " + field.getInt (null));
---- cut here -----------------------------------------

AG


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-10-06 17:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-06 17:28 javascript + gcj Anthony Green

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