macro

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package macro provides Ale's macro expansion system for compile-time code transformation. It handles macro definition, expansion, and the hygiene mechanisms that enable powerful metaprogramming while avoiding variable capture issues. This enables code generation and domain-specific language creation within Ale.

Index

Constants

This section is empty.

Variables

View Source
var (
	CallType = types.MakeBasic("macro")
)

Functions

func Expand

func Expand(ns env.Namespace, v ale.Value) (ale.Value, error)

Expand performs a complete macro expansion

func Expand1

func Expand1(ns env.Namespace, v ale.Value) (ale.Value, error)

Expand1 performs a single macro expansion

Types

type Call

type Call func(env.Namespace, ...ale.Value) ale.Value

Call represents a macro's calling signature

func (Call) Equal

func (Call) Equal(ale.Value) bool

Equal compares this Call to another for equality

func (Call) Get

func (c Call) Get(key ale.Value) (ale.Value, bool)

func (Call) Type

func (c Call) Type() ale.Type

Type makes Call a typed value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL