public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Peter Lane <peter@peterlane.info>, kawa@sourceware.org
Subject: Re: read in script vs compiled
Date: Thu, 09 Mar 2017 23:48:00 -0000	[thread overview]
Message-ID: <c59a804e-48ab-c676-a7aa-014d4dbda8ac@bothner.com> (raw)
In-Reply-To: <37bfb557-9645-4ae3-7e3c-7c217b664d38@peterlane.info>

On 03/09/2017 03:19 PM, Peter Lane wrote:
> Hi,
>
> I may be misunderstanding something here about how the jvm uses terminal input, and how that interacts with Kawa.
>
> I am trying to get some user input from the terminal in a script, but I receive Null pointer errors with Kawa.  On a little investigation, Kawa does not seem to like input entered from the terminal, but is ok with input from a redirected file or when compiled to a class file and run with java, or in the REPL.  (I'm using bash under ubuntu.)
>> ...
> But I get an exception if I use kawa to run the .class file, or if I run the .scm file as a script:
>
> $ kawa read.scm
> 1
> java.lang.NullPointerException
>     at gnu.expr.Compilation.getFileName(Compilation.java:2641)

There is some awkwardness is how Kawa communicates with the JLine
input editor.  (The complication is because we want to handle multi-line
inputs.)

What needs to happen is that the JLineInPort.parse methods needs to
know if we're reading forms (expressions) or "data".  That shouldn't
be very hard, but it is probably a bit "fiddly" figuring out the
right way to do it.

As a work-around, you can disable jline input-editing:

$ kawa console:use-jline=no read.scm
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

  reply	other threads:[~2017-03-09 23:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 23:19 Peter Lane
2017-03-09 23:48 ` Per Bothner [this message]
2017-03-10  5:51   ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c59a804e-48ab-c676-a7aa-014d4dbda8ac@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=peter@peterlane.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).