On this page:
expo
expo.macro
expo.modifier
expo_  meta.Parsed
expo_  meta.After  Prefix  Parsed
expo_  meta.After  Infix  Parsed
expo_  meta.Parsed  Modifier
8.12
7.13.2 Export Macros🔗ℹ

space

expo

The space for bindings of identifiers that can be used within export for exports and export modifiers.

Like expr.macro, but defines a macro for use in export.

expo.macro 'range $(from :: Int) .. $(to :: Int): $id':

  let [name, ...]:

    for List (i: from.unwrap()..to.unwrap()):

      Syntax.make_id(id +& i, id)

  'names: $name ...'

> namespace ns:

    export:

      range 1..4: cat

    def cat1 = "Felix"

    def cat2 = "Tom"

    def cat3 = "Scratchy"

> ns.cat3

"Scratchy"

definition

expo.modifier prefix_macro_patterns

 

option

 = 

~op_stx: id

 | 

~op_stx id

 | 

~export: exp_id

 | 

~export exp_id

Like defn.macro, but defines an identifier as an export modifier, and an optional ~export declaration provides an exp_id to be bound to the (opaque) export that is being modified.

expo.modifier 'not_greetings':

  'except: hello hi'

> namespace n:

    export:

      not_greetings: all_defined

    def hello = "hello"

    def hi = "hi"

    def bye = "bye"

> n.bye

"bye"

> n.hello

hello: identifier not provided by n

syntax class

syntax_class expo_meta.Parsed:

  kind: ~group

  fields:

    group

 

syntax class

syntax_class expo_meta.AfterPrefixParsed(op_name):

  kind: ~group

  fields:

    group

    [tail, ...]

 

syntax class

syntax_class expo_meta.AfterInfixParsed(op_name):

  kind: ~group

  fields:

    group

    [tail, ...]

Provided as meta.

Analogous to expr_meta.Parsed, expr_meta.AfterPrefixParsed, , and expr_meta.AfterInfixParsed, but for exports.

syntax class

syntax_class expo_meta.ParsedModifier(exp):

  kind: ~group

  fields:

    group

Analogous to expr_meta.Parsed, but parses an export modifier applied to an export. The result is a parsed modified export.