Hello Eric,

Thanks!

Looks like I would need more help ...

This what I tried :
  overlay=: 3 : 0
'>' (1!:2) 2 NB. write the prompt
k=.(1!:1) 1     NB. wait for input
k
)

Now, I load the script and can call overlay thus:
  overlay ''

some input
some input

Almost there but not quite....
1) Why is there an additional CRLF added to the output? Can I override that
behavior?
2) Just to see if the input works right, I added a backspace before the
input, Then I have this...
overlay ''
some input (NB. erased the CRLF through use of backspace in the session
window)
some input (NB. this is the read input)

which is exactly what I want. Then using }. I can get the statement I want
to parse...

(At all points, the user must be informed

Any pointers?

Regards,
Yuva



On 1/24/07, Eric Iverson <[EMAIL PROTECTED]> wrote:

I think you went astray in your initial questions on stdin. As I
understand your requirements now you should just use keyboard input.
That is:

input=. 1!:1[1

----- Original Message -----
From: "Yuvaraj Athur Raghuvir" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Wednesday, January 24, 2007 5:31 AM
Subject: [Jprogramming] Continuation of interpreter in J/Windows...


> Hello,
>
> Rethinking on what I want to do, I would like to create scripts that
> superimpose a interpreter on the top of the current active session
> window. I
> started thinking of using the console window but the Ctrl-Z as
> termination
> for stdin was not something I like. I need to terminate the input with
> a
> 'enter' key (CRLF).
>
> So, I plan to use the current active session instead....
>
> 1) My imagination is like this...
>
> load 'c:\user\prompt.ijs'
> prompt ''   NB. starts the interpreter
>>
>
> (NB. this should be the state where the interpreter is waiting for
> user
> input)
>
> Input sequence is terminated by a CRLF ('enter' on the keyboard).
>
> For making this basic mechanism work, I am fine with a simple echo
> behavior.
> So,
>
>> a
> a
>>
>
> The input is consumed, processed and return value printed (in this
> case a
> simple echo).
>
> How can this be done?
>
> 2) The extension to this is to 'escape' into J and return into the
> interpreter.
>
> So, this happens
>> \     NB. the escape character to terminate the interpreter
>         NB. now native J would work
> prompt '' NB. restarts the interpreter
>>      (NB. the prompt of the generator)
>
> This is straight forward as the input character stream is consumed by
> the
> interpreter.
>
>
> Thanks and Regards,
> Yuva
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to