m !: n Foreign Conjunction
- interfacing with platform-dependent operating system services outside J's area of responsibility
e.g. system clock, file read/write and user interfaces
- reading and setting global options for J's responses
- managing locales and reporting on their status.
Operands m (section number) and n (function within section m) are always integers from a set of of pre-determined values.
For a detailed catalog of m and n in table form, see Vocabulary/Foreigns.
- By convention choose y to be '' unless a given function needs actual data
- Some Foreigns need an x-argument too (but rarely). Otherwise call the Foreign monadically, i.e. omit x .
1. Return the time-of-day (optionally in a specified format)
See: 6!: Time
6!:0 '' 2007 10 30 13 10 45.312 6!:0 'hh:mm:ss MM/DD/YY' 13:10:48 10/30/07
2. Execute a named J script (silently)
See: 0!: Scripts
0!:0 <jpath '~temp/949.ijs'
3. Signal your own invented error message with any choice of error number (1 to 255)
See: 13!: Debug
'my error message' (13!:8) 255 |my error message | 'my error message' (13!:8)255
Use These Combinations
Combinations using x !: y that have exceptionally good performance include:
What it does Type;
CRC calculation x&(128!:3) Calculates the CRC lookup table when verb is created
whereas x 128!:3 y computes it every time phrase is executed