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

Portabilityportable
Stabilityexperimental
Maintainergithub.com/justinethier
Safe HaskellSafe-Infered

Language.Scheme.Core

Description

This module contains Core functionality, primarily Scheme expression evaluation.

Synopsis

Documentation

evalLisp :: Env -> LispVal -> IOThrowsError LispValSource

Evaluate lisp code that has already been loaded into haskell

evalString :: Env -> String -> IO StringSource

Evaluate a string containing Scheme code.

For example:

env <- primitiveBindings

evalString env (+ x x x)
3

evalString env (+ x x x (* 3 9))
30

evalString env (* 3 9)
27

evalAndPrint :: Env -> String -> IO ()Source

Evaluate a string and print results to console

primitiveBindings :: IO EnvSource

Environment containing the primitive forms that are built into the Scheme language. Note that this only includes forms that are implemented in Haskell; derived forms implemented in Scheme (such as let, list, etc) are available in the standard library which must be pulled into the environment using (load).

apply :: LispVal -> LispVal -> [LispVal] -> IOThrowsError LispValSource

Call into a Scheme function

continueEval :: Env -> LispVal -> LispVal -> IOThrowsError LispValSource

continueEval is a support function for eval. - - Transformed eval section into CPS by calling into this instead of returning from eval. - This function uses the cont argument to determine whether to keep going or to finally - return a result. -

substr :: (LispVal, LispVal, LispVal) -> IOThrowsError LispValSource

A helper function for the special form (string-set!)

updateVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispValSource

A helper function for the special form (vector-set!)