Compiler special forms

koskari.compile.specials

Special form handlers for the Koskari compiler.

koskari.compile.specials.special(form_symbol, *, patterns, unpack=None)

Build a Syntax dispatcher whose arms are SpecialTransform instances wrapping the decorated function. unpack selects one of three fixed invoke shapes at decoration time (no per-call unpack dispatch)

Parameters:
  • form_symbol – primary compile-time head symbol for this form

  • patterns – one matcher.Pattern or an iterable (try-order)

  • unpack – only for this decorator: None (receive compiler, source_obj), match (receive compiler, captures_dict), or kwargs (captures merged after compiler). For match and kwargs, captures_dict includes only slots the matcher bound; values are matcher outputs (Datum wrappers may be present). Not available on build_* rule rows.