1801
Comment:
|
1833
|
Deletions are marked like this. | Additions are marked like this. |
Line 13: | Line 13: |
Line 16: | Line 15: |
200⌶ ⎕NR'foo' | . 200⌶ ⎕NR'foo' |
Line 20: | Line 19: |
200⌶ (⎕src object) type | . 200⌶ (⎕src object) type |
Line 23: | Line 22: |
||Value ||Object type || ||1 ||Function (use ⎕nr) || ||256 ||Namespace || ||512 ||Interface || ||1024 ||Class || |
|
Line 24: | Line 28: |
||Value||Object type|| ||1||Function (use ⎕nr)|| ||256||Namespace|| ||512||Interface|| ||1024||Class|| |
|
Line 32: | Line 33: |
200⌶(⎕src mynamespace) 1 | . 200⌶(⎕src mynamespace) 1 |
Line 38: | Line 39: |
200⌶(⎕src mynamespace) 256 | . 200⌶(⎕src mynamespace) 256 |
Line 42: | Line 43: |
The attached file lists all of the syntactic colour elements. Note that this list is very version-specific; this list was generated on 2009-11-22 for V12.1, and may be extended, reduced or removed altogether in future versions. | The [[attachment:121_ibeam200.txt|attached file]] lists all of the syntactic colour elements. Note that this list is very version-specific; this list was generated on 2009-11-20 for V12.1, and may be extended, reduced or removed altogether in future versions. |
I-Beams in Dyalog APL
Overview
This section adds more detail to the I-Beam functionality that has been added to Dyalog APL 12.1.
As ever, please remember the caveat that appears in the Language Guide:
WARNING: Although documentation is provided for I-Beam functions, any service provided using I-Beam should be considered as “experimental” and subject to change – without notice - from one release to the next. Any use of I-Beams in applications should therefore be carefully isolated in cover-functions that can be adjusted if necessary.
200: Syntax Colouring
The Language Reference details the use of 200⌶ with function or operator definitions:
- 200⌶ ⎕NR'foo'
However, this I-Beam has been extended to include Namespaces, Classes and Interfaces, using the following syntax:
- 200⌶ (⎕src object) type
where type is one of the following:
Value |
Object type |
1 |
Function (use ⎕nr) |
256 |
Namespace |
512 |
Interface |
1024 |
Class |
Since any vector of character vectors could be passed to 200⌶, the type is used to indicate to the interpreter what it should base its analysis on. So, for example if you run
- 200⌶(⎕src mynamespace) 1
then the namespace-specific tags will appear as 243 - "Mismatched control structure"; you can't have a :Namespace in a function definition !
Whereas if you run
- 200⌶(⎕src mynamespace) 256
then the :Namespace element will appear as a valid one (177).
The attached file lists all of the syntactic colour elements. Note that this list is very version-specific; this list was generated on 2009-11-20 for V12.1, and may be extended, reduced or removed altogether in future versions.