# macrocache

Dark Mode

- Manual
- Standard library
- Index
- devel, stable

Search:
Group by:

This module provides an API for macros that need to collect compile time information across module boundaries in global variables. Starting with version 0.19 of Nim this is not directly supported anymore as it breaks incremental compilations. Instead the API here needs to be used.

# Types

    CacheSeq = distinct string

  Source Edit

    CacheTable = distinct string

  Source Edit

    CacheCounter = distinct string

  Source Edit

# Procs

    proc value(c: CacheCounter): int {...}{.magic: "NccValue".}

  Source Edit

    proc inc(c: CacheCounter; by = 1) {...}{.magic: "NccInc".}

  Source Edit

    proc add(s: CacheSeq; value: NimNode) {...}{.magic: "NcsAdd".}

  Source Edit

    proc incl(s: CacheSeq; value: NimNode) {...}{.magic: "NcsIncl".}

  Source Edit

    proc len(s: CacheSeq): int {...}{.magic: "NcsLen".}

  Source Edit

    proc `[]`(s: CacheSeq; i: int): NimNode {...}{.magic: "NcsAt".}

  Source Edit

    proc `[]=`(t: CacheTable; key: string; value: NimNode) {...}{.magic: "NctPut".}

  'key' has to be unique! Source Edit

    proc len(t: CacheTable): int {...}{.magic: "NctLen".}

  Source Edit

    proc `[]`(t: CacheTable; key: string): NimNode {...}{.magic: "NctGet".}

  Source Edit

# Iterators

    iterator items(s: CacheSeq): NimNode {...}{.raises: [], tags: [].}

  Source Edit

    iterator pairs(t: CacheTable): (string, NimNode) {...}{.raises: [], tags: [].}

  Source Edit