[e-lang] Couple of newbie questions
Chris Rathman
Chris.Rathman at tx.rr.com
Sun Dec 24 14:54:07 CST 2006
I'm trying to translate the examples of the first chapter of SICP into E
(link at bottom). A couple of questions I have.
1). Random number generation: I managed to piece together that you can
use the java random class, along the lines of:
var random := <unsafe:java.util.makeRandom>()
var x := random.nextInt(100)
this gets the desired results. I was just wondering if this is the best
way to generate random numbers in E?
2). Current Time in Milliseconds: One of the function I'm translating
tries to keep tabs on the amount of time. In python, I'd do something like:
var y = timer.time()
Is there a function that returns the current time in milliseconds? I
see that there is a function |(currentTimeMillis) in java.lang.System,
but there doesn't seem to be a makeSystem function (like I did with the
makeRandom above).
SICP in E link:
http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages#E
Thanks,
Chris Rathman
|
More information about the e-lang
mailing list