husk-scheme-3.5.4: R5RS Scheme interpreter, compiler, and library.

Portabilityportable
Stabilityexperimental
Maintainergithub.com/justinethier
Safe HaskellSafe-Infered

Language.Scheme.Variables

Contents

Description

This module contains code for working with Scheme variables, and the environments that contain them.

Synopsis

Environments

printEnvSource

Arguments

:: Env

Environment

-> IO String

Contents of the env as a string

Show the contents of an environment

copyEnvSource

Arguments

:: Env

Source environment

-> IO Env

A copy of the source environment

Create a deep copy of an environment

extendEnvSource

Arguments

:: Env

Environment

-> [((String, String), LispVal)]

Extensions to the environment

-> IO Env

Extended environment

Extend given environment by binding a series of values to a new environment.

findNamespacedEnvSource

Arguments

:: Env

Environment to begin the search; parent env's will be searched as well.

-> String

Namespace

-> String

Variable

-> IO (Maybe Env)

Environment, or Nothing if there was no match.

Recursively search environments to find one that contains the given variable.

Getters

getVarSource

Arguments

:: Env

Environment

-> String

Variable

-> IOThrowsError LispVal

Contents of the variable

Retrieve the value of a variable defined in the default namespace

getNamespacedVarSource

Arguments

:: Env

Environment

-> String

Namespace

-> String

Variable

-> IOThrowsError LispVal

Contents of the variable

Retrieve the value of a variable defined in a given namespace

Setters

defineVarSource

Arguments

:: Env

Environment

-> String

Variable

-> LispVal

Value

-> IOThrowsError LispVal

Value

Bind a variable in the default namespace

setVarSource

Arguments

:: Env

Environment

-> String

Variable

-> LispVal

Value

-> IOThrowsError LispVal

Value

Set a variable in the default namespace

setNamespacedVarSource

Arguments

:: Env

Environment

-> String

Namespace

-> String

Variable

-> LispVal

Value

-> IOThrowsError LispVal

Value

Set a variable in a given namespace

defineNamespacedVarSource

Arguments

:: Env

Environment

-> String

Namespace

-> String

Variable

-> LispVal

Value

-> IOThrowsError LispVal

Value

Bind a variable in the given namespace

Predicates

isBoundSource

Arguments

:: Env

Environment

-> String

Variable

-> IO Bool

True if the variable is bound

Determine if a variable is bound in the default namespace

isRecBoundSource

Arguments

:: Env

Environment

-> String

Variable

-> IO Bool

True if the variable is bound

Determine if a variable is bound in the default namespace, in this environment or one of its parents.

isNamespacedBoundSource

Arguments

:: Env

Environment

-> String

Namespace

-> String

Variable

-> IO Bool

True if the variable is bound

Determine if a variable is bound in a given namespace

isNamespacedRecBoundSource

Arguments

:: Env

Environment

-> String

Namespace

-> String

Variable

-> IO Bool

True if the variable is bound

Determine if a variable is bound in a given namespace or a parent of the given environment.