I have improved the script to work in any user
interface, not just unix. The key action verb is 'k' and it
takes only one one-liner at a time. A very nice feature of
this version is that every recent line can still be
retrieved as usual with Ctrl-Shift-Uparrow or Uparrow
depending on the user interface. Also with the verb 'k' no
*extra* quotes are needed around the verb definition.
NB. jread.ijs
NB. 2/18/5
NB. 4/10/6 revised
NB. 4/11/6 revised
NB. routines to facilitate one-liner definition writing
NB. from left to right ******
NB. example usage: rc '#%/+'
NB. no assignment operator is allowed in the argument to rc
rc =: |.&.;:
NB. this system gets confused by parens
NB. so they must be entered backwards (see example below)
mt =: ''''
keyboard =: [: 1!:1 1:
NB. example usage: exp0 rc '''y. {. 2 / + ~ - 10 * >:'' : 13=:rind'
NB. example usage: exp0 rc '#%/+=: mean'
exp0=:[:"."1 [:;:^:_1"1([:mt&,[:,&mt[:rc[:}:[:}.])^:(mt&-:@{.)each@:;:;.1
NB. usage: k''
NB. at blank line, enter your verb def and then press return
NB. no quotes are needed in the definition
NB. eg. enter: #%/+=:mean
k =: [: ". [: exp0 [: rc keyboard
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm