This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java.sql.ResultSet.getObject() Kawa(?) bug, (as <int> 1)


Hi all,

Per Bothner wrote:
>> #|kawa:9|# (invoke (as <int> 1) 'get-class)
>> class java.lang.Integer
>Yes, that is strange.  I don't know what causes that.
>You might try to make sure the invoke gets compiled.
Actually, I'd appreciate some documentation clarification about compilation vs. interpretation.

BRL users would also benefit from this. For example, it's completely unclear to me whether code from a .brl file ever gets compiled to JVM bytecodes or whether a Lisp (Scheme) interpreter handles all s-expressions.

The only obvious thing is that using BRL doesn't generate .class files in the file system. That doesn't mean it does not generate classes or bytecode inside the JVM - does it?


>to an Object we would get a <java.lang.Integer>, but <gnu.math.IntNum>
>os used for unbounded integers.  But that requires enhancing all of
>Kawa's arithmetic - *after* we carefully define the semantics!)

I believe you meant java.math.BigInteger for unbounded integers?
It seemed to me you use gnu.math.* so as to work with older JVM which don't have java.math.*, while newer Java code (esp. JDBC) use java.math.BigInteger.
Or is it because java.math doesn't supply all numeric functions (exponentiation, boole & bit-and, trigonometry on large numbers??)?
For now, I'm quite happy with Kawa as a Scheme system, because I'm not bothered with stupid divisions between bigints and fixnums. It just works, as in Common Lisp.
jscheme is more troublesome in this area, distinguishing ints from longs and esp. I dislike the 'L suffix to longs :-(


>(let ((one :: <int> 1)) (invoke rs 'getObject one))
This looks as suspicious:
#|kawa:72|# (let ((one :: <int> 1)) (invoke one 'get-class))
class gnu.math.IntNum -- as if the type declaration was ignored.

#|kawa:77|# (let ((one :: <int> 1)) (invoke rs 'getObject one))
Argument  to 'sun.jdbc.odbc.JdbcOdbcResultSet.getObject' has wrong type
	at gnu.expr.GenericProc.applyN(GenericProc.java:74)
	at gnu.kawa.reflect.Invoke.applyN(Invoke.java:149)
	at gnu.kawa.reflect.Invoke.applyN(Invoke.java:49)
	at gnu.mapping.ProcedureN.apply3(ProcedureN.java:46)
	at gnu.mapping.Procedure.apply(Procedure.java:117)
	at gnu.mapping.CallContext.runUntilDone(CallContext.java:235)
	at gnu.expr.ModuleExp.evalModule(ModuleExp.java:189)
	at kawa.Shell.run(Shell.java:229)
	at kawa.Shell.run(Shell.java:180)
	at kawa.Shell.run(Shell.java:167)
	at kawa.repl.processArgs(repl.java:275)
	at kawa.repl.main(repl.java:528)

Does that mean invoke doesn't get compiled?

Regards,
	Jorg Hohle.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]