ir

package
v0.0.0-...-85505a6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileFunction

func CompileFunction(s core.Signature, vars []interface{}, expr interface{}) core.Value

CompileFunction compiles a function in IR into a thunk.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App represents an application of a function to arguments.

func NewApp

func NewApp(f interface{}, args Arguments, info *debug.Info) App

NewApp creates an App from a function and arguments of expressions in IR.

type Arguments

type Arguments struct {
	// contains filtered or unexported fields
}

Arguments represents arguments passed to a function in IR.

func NewArguments

func NewArguments(ps []PositionalArgument, ks []KeywordArgument) Arguments

NewArguments creates arguments from positional and keyword arguments and expanded dictionaries.

type Case

type Case struct {
	// contains filtered or unexported fields
}

Case represents a case of a pattern and a corresponding value in a switch expression.

func NewCase

func NewCase(p core.Value, v interface{}) Case

NewCase creates a case in a switch expression.

type KeywordArgument

type KeywordArgument struct {
	// contains filtered or unexported fields
}

KeywordArgument represents a keyword argument passed to a function.

func NewKeywordArgument

func NewKeywordArgument(n string, v interface{}) KeywordArgument

NewKeywordArgument creates a keyword argument from a bound name and its value.

type PositionalArgument

type PositionalArgument struct {
	// contains filtered or unexported fields
}

PositionalArgument represents a positional argument passed to a function. It can be a list value and expanded into multiple arguments.

func NewPositionalArgument

func NewPositionalArgument(v interface{}, expanded bool) PositionalArgument

NewPositionalArgument creates a positional argument.

type Switch

type Switch struct {
	// contains filtered or unexported fields
}

Switch represents a switch expression.

func NewSwitch

func NewSwitch(m interface{}, cs []Case, d interface{}) Switch

NewSwitch creates a switch expression.

Jump to

Keyboard shortcuts

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