Œ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 ]