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]

getInputStream


To me these two pieces of code look equivalent

      Runtime rt = Runtime.getRuntime();
      Process p = rt.exec("sleep 1000");
      InputStream is = p.getInputStream();
--------------------
      (define rt (invoke-static <java.lang.Runtime> 'get-runtime))
      (define p (invoke rt 'exec "sleep 1000"))
      (define is (invoke p 'get-input-stream))

But in the second case the last define triggers an exception:

java.lang.RuntimeException: apply not implemented for PrimProcedure java.io.InputStream java.lang.UNIXProcess.getInputStream() - java.lang.IllegalAccessException: java/lang/UNIXProcess
	at gnu.expr.PrimProcedure.applyV(PrimProcedure.java, Compiled Code)
	at gnu.mapping.MethodProc.applyN(MethodProc.java, Compiled Code)
	at gnu.kawa.reflect.Invoke.applyN(Invoke.java, Compiled Code)
	at gnu.kawa.reflect.Invoke.applyN(Invoke.java, Compiled Code)
	at gnu.expr.ApplyExp.eval(ApplyExp.java, Compiled Code)
	at gnu.expr.SetExp.eval(SetExp.java, Compiled Code)
	at gnu.expr.Expression.eval(Expression.java, Compiled Code)
	at gnu.expr.ModuleExp.evalModule(ModuleExp.java, Compiled Code)
	at kawa.Shell.run(Shell.java, Compiled Code)
	at kawa.Shell.run(Shell.java, Compiled Code)
	at kawa.Shell.run(Shell.java, Compiled Code)
	at kawa.repl.main(repl.java, Compiled Code)


-- 
walter pelissero
http://www.pelissero.org


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