Y must be a simple character scalar, or vector which is taken to be the name of a defined function or operator in the active workspace. ⎕LOCK does not apply to dfns or derived functions.
The active referent to the name in the workspace is locked. Stop, trace and monitor settings, established by the ⎕STOP, ⎕TRACE and ⎕MONITOR functions, are cancelled.
The optional left argument X specifies to what extent the function code is hidden. X may be 1, 2 or 3 (the default) with the following meaning:
Locks are additive, so that
1 ⎕LOCK'FOO' ⋄ 2 ⎕LOCK'FOO'
is equivalent to:
3 ⎕LOCK'FOO'
The shy result R is the lock state (1,2 or 3) of Y.
A DOMAIN ERROR is reported if Y is ill-formed.
⎕FX'r←foo' 'r←10' ⎕NR'foo' r←foo r←10 ⍴⎕NR'foo' 2 ⎕LOCK'foo' ⍴⎕NR'foo' 0