Del: Difference between revisions

From NARS2000
Jump to navigationJump to search
m (Paul Robinson moved page Symbol Del to Del: When a symbol is finished, move it to the name)
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
<h1> {del} &mdash; Edit User Function &mdash; Keystroke ALT+G &mdash; Character 8711 or x2211</h1>
<h1> {del} &mdash; Edit User Function &mdash; Keystroke ALT+G &mdash; Character 8711 or x2211</h1>
[[File:APLKB-Del.png]]
==Usage==
==Usage==
The Del symbol <big>{del}</big> is the equivalent of the declaration of a '''Function, Procedure, or Subroutine''' in other programming languages. Functions in APL may or may not return a value. In NARS 2000, unlike other APL systems, the {del} symbol is only used to edit the function, it is not actually used in the header or the body of the function. The system command )EDIT may be used interchangeably with {del}.
:''Main Article: [[Functions]]''
The Del symbol <big>{del}</big> is the equivalent of the declaration of a new '''Function, Procedure, or Subroutine''' in other programming languages. or a request to edit an existing function. Functions in APL may or may not return a value. In NARS 2000, unlike other APL systems, the {del} symbol is only used to edit the function, it is not actually used in the header or the body of the function. The system command )EDIT may be used interchangeably with {del}.


The <big>{del}</big> symbol is used to edit an APL function. There are two forms:
The <big>{del}</big> symbol is used to edit an APL function. There are two forms:
Line 12: Line 15:
where '''''function''''' is the name of the function to edit; '''''leftarg←''''' if used, is the result value of this function; '''''rightarg''''', if used, is the argument to pass to the function; ''''';local1''''' etc. are optional local variables used by the function. 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. If arguments or local variables were provided as part of the declaration of a new function, they will appear in the function header on line 0 as used in the definition which was given.
where '''''function''''' is the name of the function to edit; '''''leftarg←''''' if used, is the result value of this function; '''''rightarg''''', if used, is the argument to pass to the function; ''''';local1''''' etc. are optional local variables used by the function. 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. If arguments or local variables were provided as part of the declaration of a new function, they will appear in the function header on line 0 as used in the definition which was given.


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 '''{del}''' 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 '''{del}''' 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 unlike the prior practice on older mainframe APL systems such as APL\360 or VSAPL from IBM, 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.


The '''{del}''' symbol is treated exactly as the ''')EDIT''' command, a )EDIT used alone opens a blank window to edit a new function, )EDIT 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 '''{del}''' symbol is treated exactly as the ''')EDIT''' command, a )EDIT used alone opens a blank window to edit a new function, )EDIT 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.
Line 22: Line 25:
or
or
:''')EDIT  z←function5 r;⎕IO'''  
:''')EDIT  z←function5 r;⎕IO'''  
Are identical. Note that arguments are ignored on the <big><apl>{del}</apl></big> symbol or )EDIT command if the function is already defined; if you want to change the function header of an already defined function, you must edit it directly.
Are identical. Note that arguments are ignored on the <big><apl>{del}</apl></big> symbol or )EDIT command if the function is already defined; if you want to change the function header of an already defined function, you must edit line 0 of the function directly.
 
 
{{Keyboard}}


{{Language Toolbar}}
{{Article footer}}
[[Category:Mouse Group 11|D]]
{{Symbol footer|11|D}}
[[Category:Symbols|D]]

Latest revision as of 12:58, 24 November 2014

∇ — Edit User Function — Keystroke ALT+G — Character 8711 or x2211

Usage

Main Article: Functions

The Del symbol is the equivalent of the declaration of a new Function, Procedure, or Subroutine in other programming languages. or a request to edit an existing function. Functions in APL may or may not return a value. In NARS 2000, unlike other APL systems, the ∇ symbol is only used to edit the function, it is not actually used in the header or the body of the function. The system command )EDIT may be used interchangeably with ∇.

The symbol is used to edit an APL function. There are two forms:

and

function

(or)

leftarg←function rightarg;local1;local2 etc.

where function is the name of the function to edit; leftarg← if used, is the result value of this function; rightarg, if used, is the argument to pass to the function; ;local1 etc. are optional local variables used by the function. 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. If arguments or local variables were provided as part of the declaration of a new function, they will appear in the function header on line 0 as used in the definition which was given.

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

If 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 () symbol.) Note that unlike the prior practice on older mainframe APL systems such as APL\360 or VSAPL from IBM, 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 will result in a SYNTAX ERROR when the function is executed.

The symbol is treated exactly as the )EDIT command, a )EDIT used alone opens a blank window to edit a new function, )EDIT 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

∇ z←function5 r;⎕IO

or

)EDIT z←function5 r;⎕IO

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


See Also
System Commands System Variables and Functions Operators


Keyboard
Alt+Shift
Alt ¨ ¯ < > × ÷
Shift ~ ! @ # $ % ^ & * ( ) _ +
Key ` 1 2 3 4 5 6 7 8 9 0 - =
Alt+Shift
Alt ? § π
Shift Q W E R T Y U I O P { } |
Key q w e r t y u i o p [ ] \
Alt+Shift
Alt
Shift A S D F G H J K L : "
Key a s d f g h j k l ; '
Alt+Shift χ
Alt
Shift 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}}}]]