scheme

package module
v0.0.0-...-91bc1ab Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

README

scheme

Don't use this, really :)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean bool

func (*Boolean) Capture

func (b *Boolean) Capture(values []string) error

type Expression

type Expression struct {
	Call   []*Expression `"(" @@+ ")"|`
	Val    *Value        `@@|`
	Var    *string       `@Ident|`
	Symbol *string       `@Symbol`
}

func Parse

func Parse(s string) (*Expression, error)

func (Expression) String

func (e Expression) String() string

type SchemeFunction

type SchemeFunction func(args []*Value, scope Scope) (*Value, error)

type Scope

type Scope map[string]*Value

type Value

type Value struct {
	Float   *float64 `  @Float`
	Bool    *Boolean `| @("true" | "false")`
	AString *string  `| @String`
	Func    SchemeFunction
}

func Eval

func Eval(e *Expression, s Scope) (*Value, error)

func (Value) Primitive

func (v Value) Primitive() interface{}

func (Value) String

func (v Value) String() string

func (Value) ToFloat

func (v Value) ToFloat() (float64, error)

Jump to

Keyboard shortcuts

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