Difference between revisions of "System Command EDIT"

From NARS2000
Jump to navigationJump to search
Line 1: Line 1:
The ''')EDIT''' command is used to edit an APL function. There are two forms:
+
The <apll>)EDIT</apll> command is used to edit an APL function. There are several forms:
:''')EDIT'''
+
<apll><pre>
 +
      )EDIT
 +
</pre></apll>
 
and
 
and
:''')EDIT ''function'' '''
+
<apll><pre>
 +
      )EDIT function
 +
</pre></apll>
 
(or)  
 
(or)  
:''')EDIT ''leftarg←function rightarg;local1;local2'' ''' etc.
+
<apll><pre>
 +
      )EDIT result←leftarg function rightarg;local1 local2
 +
</pre></apll>
 
where ''function'' is the name of the function to edit. If the function exists, an edit window will be opened and the function will be shown in the window. If the function does not exist, a new edit window will open with an empty function other than the function name on line 0.
 
where ''function'' is the name of the function to edit. If the function exists, an edit window will be opened and the function will be shown in the window. If the function does not exist, a new edit window will open with an empty function other than the function name on line 0.
  
 
Function names, like variables, are case sensitive. '''PI''', '''Pi''', '''pI''', and '''pi''' are four different identifiers.
 
Function names, like variables, are case sensitive. '''PI''', '''Pi''', '''pI''', and '''pi''' are four different identifiers.
  
If ''')EDIT''' is used with no function name specified, a new edit window will open and a blank line 0 will be presented to allow you to enter the function header. The function header can be typed in to this window on line 0 (without using the prefix del (<big><apl>{del}</apl></big>) symbol.) Note that to close the edit window, you type Control-E, '''do not''' place the <big>{del}</big> symbol on the function header or use it to attempt to close the function by placing it on the last line of the function; the function editor will raise a syntax error and refuse to save the function with a warning of a SYNTAX ERROR if a {del} appears in the function header; having a {del} within the function will result in a SYNTAX ERROR when the function is executed.
+
If <apll>)EDIT</apll> is used with no function name specified, a new edit window will open and a blank line 0 will be presented to allow you to enter the function header. The function header can be typed in this window on line 0 (without using the prefix del (<apll></apll>) symbol.) Note that to close the edit window, you type Control-E, '''do not''' place the <apll></apll> symbol on the function header or use it to attempt to close the function by placing it on the last line of the function; the function editor will raise a syntax error and refuse to save the function with a warning of a SYNTAX ERROR if a <apll>∇</apll> appears in the function header; having a <apll>∇</apll> within the function results in a recursive call to the function when it is executed.
  
The ''')EDIT''' command is treated exactly as the <big><apl>{del}</apl></big> symbol, a <big><apl>{del}</apl></big> used alone opens a blank window to edit a new function, <big><apl>{del}</apl></big> followed by the name of a function opens a window containing the existing function for editing, or opens a new window to define the contents of the function.
+
The <apll>)EDIT</apll> command is treated exactly as the <apll></apll> symbol, a <apll></apll> used alone opens a blank window to edit a new function, <apll></apll> followed by the name of a function opens a window containing the existing function for editing, or opens a new window to define the contents of the function.
  
A new function may be defined via the )EDIT function or the <big><apl>{del}</apl></big> symbol, so that
+
A new function may be defined via the <apll>)EDIT</apll> function or the <apll></apll> symbol, so that
:)EDIT  z←function5 r;⎕IO  
+
 
 +
<apll><pre>
 +
      )EDIT  z←function5 r;⎕IO
 +
</pre></apll>
 
or
 
or
:∇ z←function5 r;⎕IO
+
<apll><pre>
Are identical. Note that arguments are ignored on the )EDIT or <big><apl>{del}</apl></big> symbol if the function is already defined; if you want to change the function header of an already defined function, you must edit it directly.
+
      ∇ z←function5 r;⎕IO
 +
</pre></apll>
 +
 
 +
are identical. Note that arguments are ignored on the <apll>)EDIT</apll> or <apll></apll> symbol if the function is already defined; if you want to change the function header of an already defined function, you must edit it directly.
  
  
 
{{Commands}}
 
{{Commands}}
 
{{Article footer}}
 
{{Article footer}}

Revision as of 15:31, 17 April 2018

The )EDIT command is used to edit an APL function. There are several forms:

      )EDIT

and

      )EDIT function

(or)

      )EDIT result←leftarg function rightarg;local1 local2

where function is the name of the function to edit. If the function exists, an edit window will be opened and the function will be shown in the window. If the function does not exist, a new edit window will open with an empty function other than the function name on line 0.

Function names, like variables, are case sensitive. PI, Pi, pI, and pi are four different identifiers.

If )EDIT is used with no function name specified, a new edit window will open and a blank line 0 will be presented to allow you to enter the function header. The function header can be typed in this window on line 0 (without using the prefix del () symbol.) Note that to close the edit window, you type Control-E, do not place the symbol on the function header or use it to attempt to close the function by placing it on the last line of the function; the function editor will raise a syntax error and refuse to save the function with a warning of a SYNTAX ERROR if a appears in the function header; having a within the function results in a recursive call to the function when it is executed.

The )EDIT command is treated exactly as the symbol, a used alone opens a blank window to edit a new function, followed by the name of a function opens a window containing the existing function for editing, or opens a new window to define the contents of the function.

A new function may be defined via the )EDIT function or the symbol, so that

      )EDIT  z←function5 r;⎕IO

or

      ∇ z←function5 r;⎕IO

are identical. Note that arguments are ignored on the )EDIT or symbol if the function is already defined; if you want to change the function header of an already defined function, you must edit it directly.


System Commands (not case sensitive)
)CLEAR )CLOSE )COPY )DROP )EDIT )ERASE )EXIT )FNS )FOP )FOPS
)IN )INASCII )LIB )LOAD )NEWTAB )NMS )OFF )OPEN )OPS )OUT
)RESET )SAVE )SI )SIC )SINL )SYMB )ULIB )VARS )XLOAD )WSID


See Also
System Commands System Variables and Functions Operators


Keyboard
A+S
Alt ¨ ¯ < > × ÷
Sh ~ ! @ # $ % ^ & * ( ) _ +
Key ` 1 2 3 4 5 6 7 8 9 0 - =
A+S
Alt ? § π
Sh Q W E R T Y U I O P { } |
Key q w e r t y u i o p [ ] \
A+S
Alt
Sh A S D F G H J K L : "
Key a s d f g h j k l ; '
A+S
Alt
Sh Z X C V B N M < > ?
Key z x c v b n m , . /
NARS 2000 Lang
Tool
Bar
+ - × ÷ * ! ? |
< = >
~ § π .. ,
/ \ ¨ .
_ ¯
Second Row i j k i j k l g p r v x

[[Category:Mouse Group {{{1}}}|{{{2}}}]]