cond

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: EUPL-1.2 Imports: 4 Imported by: 1

Documentation

Overview

Package cond provides some special/builtin functions to conditionally evaluate values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginS

func BeginS(eng *eval.Engine, env sxpf.Environment, args *sxpf.List) (eval.Expr, error)

BeginS parses a begin-statement: (begin expr...).

func IfS

func IfS(eng *eval.Engine, env sxpf.Environment, args *sxpf.List) (eval.Expr, error)

IfS parses an if-statement: (if cond then else). If else is missing, a nil is assumed.

Types

type BeginExpr

type BeginExpr struct {
	Front []eval.Expr // all expressions, but the last
	Last  eval.Expr
}

BeginExpr represents the begin form.

func (*BeginExpr) Compute

func (be *BeginExpr) Compute(eng *eval.Engine, env sxpf.Environment) (sxpf.Object, error)

type IfExpr

type IfExpr struct {
	Test  eval.Expr
	True  eval.Expr
	False eval.Expr
}

IfExpr represents the if-then-else form.

func (*IfExpr) Compute

func (ife *IfExpr) Compute(eng *eval.Engine, env sxpf.Environment) (sxpf.Object, error)

Jump to

Keyboard shortcuts

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