Topic: APLX Help : Help on APL language : System Methods : ⎕NL Names of members
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

⎕NL Names of public members


Syntax:

    namelist ← objref.⎕NL N
    namelist ← classref.⎕NL N

⎕NL returns a list of the public members of a class as a character matrix. (See also ⎕DESC which provides additional information about the parameters of each method). It can be used as a method either of a class, or of an instance of a class. However, exceptionally, if it is used as a standalone system function within a user-defined method, it is NOT equivalent to ⎕THIS.⎕NL. This is because in this case, the traditional system function ⎕NL will be invoked, which lists ordinary variables, functions, and operators, not class members.

The right argument is a scalar or vector which indicates which types of class member should be included in the result:

Code Type of member
2 Properties
3 Function methods
4 Operator methods
8 Events
10 Constructors

For example:

Point {
  X
  Y

  ∇R←MAG
    R←((X*2)+(Y*2))*0.5
  ∇
}   
      Point.⎕NL 2      ⍝ Applied to a class reference (properties)
X
Y
      PT←⎕NEW 'Point'
      PT.⎕NL 2 3       ⍝ Applied to an object ref (properties and methods)
MAG
X
Y

⎕NL may also be used to list the members of External or System classes:

      PT←'java' ⎕NEW 'java.awt.Point'
      PT.⎕NL 2             ⍝ Properties
x
y
      PT.⎕NL 3             ⍝ Methods
clone
distance
distanceSq
equals
getClass
getLocation
getX
getY
hashCode
move
notify
notifyAll
setLocation
toString
translate
wait

      T←'⎕' ⎕NEW 'Timer'
      T.⎕NL 2             ⍝ Properties
children
class
data
enabled
events
interval
methods
name
opened
properties
self
tie
      T.⎕NL 3             ⍝ Methods
Close
Create
Delete
New
Open
Send
Set
Trigger
      T.⎕NL 8             ⍝ Events
onClose
onDestroy
onOpen
onSend
onTimer

For the R interface, ⎕NL can be used to produce a list of all the R global variables in the current R session (right argument 2), or all the functions which are available in the currently-loaded packages (right argument 3). This will usually be a long list (several thousand functions).


Topic: APLX Help : Help on APL language : System Methods : ⎕NL Names of members
[ Previous | Next | Contents | Index | APL Home ]