✨ ARCANUM RUNE DIFFICULTY: Apprentice Structural

The Adapter

Translating an alien geometric dialect into the local runic syntax.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Adapter
ARCANUM SCHOOL: Transmutation // Geometry Mancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
alien_cast =: 3 : 'y * 2'

NB. Local expects a string input, alien expects an integer
adapter_cast =: 3 : 0
  alien_cast ". y
)

NB. Usage: adapter_cast '42'

Functions wrapping other functions to mutate the input/output shapes are the heart of adapters in J.

Runic Tags: #adapter #translation #arrays