|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Command::process_line breakup |
Date: | Tue, 10 Jun 2014 18:12:03 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 |
Hi Elias and Peter,
first of all, I am planning to put the commands )LOAD, )SAVE, ... into a separate function. That will replace lines 72-132 in Command.cc by a call to a new function. The remaining lines cannot be broken down further - they are the "main loop" of APL Regarding terminal I/O there are only 3 functions for getting user input: Input::get_line(), Input::get_quad_cr_line(old_prompt), and Input::get_user_line_nabla(&prompt) The first function is for "normal" user input. The second implements the rather specific behavior of ⍞ (overriding the prompt, ⎕PR etc) and the third is for the ∇-editor (printing [line] prompts). If you can sacrifice one of these special cases, for example get_user_line_nabla() if you have your own editor then the number of functions can be reduced further and the input handling becomes even simpler. All that is needed for a new environment is to rewrite these functions. /// Jürgen On 06/05/2014 07:38 PM, Peter Teeson wrote: Well this is an opportunity to bring up something that has been on my mind for some time. |
[Prev in Thread] | Current Thread | [Next in Thread] |