Format

From APL Wiki
Revision as of 10:38, 7 February 2020 by Matt (talk | contribs) (Created page with "{{Built-in|Format|⍕}} is a primitive function. == Examples == Format in its monadic form, alongside ravel, allows the user to concatenate numbers with strings:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Format () is a primitive function.

Examples

Format in its monadic form, alongside ravel, allows the user to concatenate numbers with strings:

      supper ← 10
      'I ate ',⍕supper,'shrimp.'
I ate 10 shrimp.

It is very powerful when combined with execute, which allows the user to interpret a string as APL code:

       data ← 7
       ⍎'6 × ',⍕data
42