Team-CC-Corp / JVML-JIT

A continuation of JVML which JITs Java bytecode to Lua bytecode rather than interpreting.
MIT License
30 stars 4 forks source link

More valueOf methods for primitives #39

Open ghost opened 9 years ago

ghost commented 9 years ago

In the normal standard library, there is Integer.valueOf(String) and the same for the other primitives. These should be added to the JVML-JIT standard library.

ElvishJerricco commented 9 years ago

We have these already don't we? What primitive classes don't we have this for?

ghost commented 9 years ago

We don't have the ones that take a string.

ElvishJerricco commented 9 years ago

Oh! Gotcha.

ghost commented 9 years ago

Yeah, would be really nice to have these. Just a small thing I ran into. Reason? Peripheral.call returns objects...

ElvishJerricco commented 9 years ago

Well yea it has to. But I don't see how that's related. It returns Integer objects for ints, Double objects for doubles, etc. Just cast to the appropriate type.

ghost commented 9 years ago

right, but still.. what happens if i want to parse an int from cmd? also, what happens if its a double/float? could they be mixed up?

ElvishJerricco commented 9 years ago

Well Peripheral.call does intelligently choose between Integer and Double. Anyway yea these methods would be nice to have. I'll look into it

ghost commented 9 years ago

alrighty, great. also, if yevano happens to see this can you hop on ts?

i need help. too long without yielding from peripheral:74 ... super confused