I can think of a case where it makes sense to leave the term window "without an input prompt":
When you want to use smoutput several times in a row (perhaps from inside several different routines). That said, if there were some way for J to send an incomplete line to the console, you could re-issue the prompt that was hidden by your output. Thanks, -- Raul On Fri, Nov 14, 2014 at 7:15 PM, Henry Rich <[email protected]> wrote: > I'm not asking you to fix it because you need the fix. I'm asking you to > fix it because it's broken. I can't think of any situation where it makes > sense to leave the term window without an input prompt. > > If I'm mistaken, and there is some situation where the best behavior is to > do that, please describe that situation. > > smoutput is a very common tool for debugging in J, and I can't see why not > make it useful in event handlers. > > All you need to do is print out a prompt before returning to immediate > execution, if there has been typeout. > > Henry Rich > > > On 11/14/2014 7:07 PM, bill lam wrote: >> >> if the REPL is waiting for user input, anything not typed by users are >> interruption. If those interruptions are not coming from the frontend ide, >> the frontend can make no assumption, your suggestion may fit for your >> students' exercise but at least I don't need it. >> >> On 15.11.2014, at 7:41, Henry Rich <[email protected]> wrote: >> >>> No, Bill, there's no interruption. The user has an event handler, and >>> he's not doing anything except waiting for the event. The user's not >>> typing. He's waiting for the event handler to run. >>> >>> The problem is, when the event handler runs, its typeout corrupts the >>> display, leaving it without an input line. >>> >>> I know there are workarounds. I'm working with beginners. The ones that >>> have done a little programming wonder why I'm teaching J. Let's not make >>> their lives difficult - just make it easy for them to see what's happening. >>> >>> >>> Henry Rich >>> >>> On 11/14/2014 6:29 PM, bill lam wrote: >>>> >>>> I would be fine because I know I am interrupting the REPL. Imagine when >>>> you >>>> are typing a sentence in term but an event was triggered. >>>> In case I need to race with the smoutput, I would log output to a file. >>>> On Nov 15, 2014 7:13 AM, "Henry Rich" <[email protected]> wrote: >>>> >>>>> You wouldn't be fine with this part of the current J8 if you were >>>>> trying >>>>> to use it. >>>>> >>>>> The user's not interrupting anything. The user is just trying to debug >>>>> an >>>>> event handler. The handler runs - good. The handler types out what >>>>> the >>>>> user wanted to see - good. The IDE leaves the display without an input >>>>> line - bad. It's a bug in the IDE. >>>>> >>>>> Having the user create a form so that they can type a line of output is >>>>> asking a lot of a user. Why not just make sure the term window always >>>>> has >>>>> a place to type a command? That's being user-friendly. >>>>> >>>>> Henry Rich >>>>> >>>>> >>>>> On 11/14/2014 6:06 PM, bill lam wrote: >>>>> >>>>>> I do not remember how it worked in J6, but I'm fine with the current >>>>>> J8. >>>>>> The origin of the problem is a user trying to interrupt the REPL, so >>>>>> it is >>>>>> his/her responsibility to fix. Perhaps you should ask students to >>>>>> create >>>>>> a >>>>>> form and print output there. >>>>>> On Nov 15, 2014 6:52 AM, "Henry Rich" <[email protected]> wrote: >>>>>> >>>>>> No, I just want an easy display of typeout. The interruption of >>>>>> keyboard >>>>>>> >>>>>>> entry you describe was in J6 and I was OK with it. >>>>>>> >>>>>>> Right now, I'm trying to get beginning programmers to see what >>>>>>> happens >>>>>>> when events occur. They have written websocket handlers, and I want >>>>>>> them >>>>>>> to be able to put typeout in them to see what happens. The problem >>>>>>> is >>>>>>> that >>>>>>> when they type out, it takes away the prompt, and the line containing >>>>>>> the >>>>>>> prompt. >>>>>>> >>>>>>> Working like J6 did would be fine here. >>>>>>> >>>>>>> Henry Rich >>>>>>> >>>>>>> On 11/14/2014 3:39 PM, Raul Miller wrote: >>>>>>> >>>>>>> As a general rule, typing interactively when event handlers are >>>>>>> going >>>>>>>> >>>>>>>> off is problematic. >>>>>>>> >>>>>>>> Imagine, for example, that you were typing something arbitrary, >>>>>>>> like: >>>>>>>> >>>>>>>> A quick brown fox jumps over the lazy dog. >>>>>>>> >>>>>>>> Now, imagine that an event handler goes off ever place a . is >>>>>>>> inserted: >>>>>>>> >>>>>>>> A q.uick .bro.wn. f.ox ju.mps o.ve.r t.he. lazy. dog. >>>>>>>> >>>>>>>> It's going to be a mess no matter what you do, >>>>>>>> >>>>>>>> But this can be worked around by using a different approach. >>>>>>>> >>>>>>>> For example, on unix, you can use tail -f filename to display >>>>>>>> everything that gets appended to a file. With that, and a separate >>>>>>>> window, you can use fappend in J to have event handler messages show >>>>>>>> up without messing up your interactive display. (On windows, I guess >>>>>>>> you'd have to install cygwin to get the tail command) >>>>>>>> >>>>>>>> Would something like that work for you? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> ------------------------------------------------------------ >>>>>>>> ---------- >>>>>>>> >>>>>>> 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 >>>>> >>>> ---------------------------------------------------------------------- >>>> 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 >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
