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]

<input-port> overloading for automatic stream conversion


It seems I'm allways suggesting things like this but here goes:

Would it be advantagous to compile procs with InPort parameters into
overloaded methods like this:

  (define (some-proc arg1 :: <input-port>)

=>

  public void someProc(gnu.mapping.InPort arg1)
  {
      .
      .
      .
  }

  public void someProc(java.io.Reader arg1)
  {
      someProc(new gnu.mapping.InPort(arg1));
  }

  public void someProc(java.io.InputStream arg1)
  {
     someProc(new gnu.mapping.InPort(arg1));
  }

I am using Kawa more and more to quickly define efficient interfaces
to Java code... this would make their inter-operation much easier.

I can see a few things where these sorts of optimizations would be
nice for some of the time but I can also see that it might not be what
all people want all of the time.

Perhaps some sort of pluggable optimization thingy would be usefull
in Kawa... Per? Anything up your sleeve?


Nic


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