Differences between revisions 3 and 4
Revision 3 as of 2009-11-23 17:52:28
Size: 1833
Editor: AndyShiers
Comment:
Revision 4 as of 2009-11-23 17:59:46
Size: 1857
Editor: KaiJaeger
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
 . 200⌶ ⎕NR'foo'  `200⌶ ⎕NR'foo'`
Line 19: Line 19:
 . 200⌶ (⎕src object) type  `200⌶ (⎕src object) type`
Line 33: Line 33:
 . 200⌶(⎕src mynamespace) 1  `200⌶(⎕src mynamespace) 1`
Line 39: Line 39:
 . 200⌶(⎕src mynamespace) 256  `200⌶(⎕src mynamespace) 256`
Line 44: Line 44:
----
CategoryArticles

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.


CategoryArticles

IBeamsWithDyalog (last edited 2012-07-18 08:51:47 by KaiJaeger)