EvalStep
A Schelme program is a list of Terms.
Dict String (Term a)
schelme code is always executed with a namespace, which maps from symbol names to Terms.
Dict String GlossaryEntry
type for a language reference
{ syntax : String
, description : String
}
data structure used for making a language reference.
EvalTermStep represents the possible states during eval of a single Term. As with all the 'Steps', the state is modified during eval, as is the namespace, although these changes may be thrown away by higher levels of eval.
EvalTermsStep is a set of states used to eval a list of Terms, returning the list of resulting Terms. Mainly for processing function arguments.
EvalBodyStep is for evaling a list of Terms, throwing away the results from all but the last Term. State is modified along the way, as is the namespace. Used for processing the body of a schelme function.
The ListStep is the set of states for evaling a list Term. Evaling a list usually results in function calls - fuctions defined in schelme, functions that modify namespace but not state (builtin) and functions that modify namespace and state (sideeffectors).
{ args : List String
, body : List (Term a)
}
a schelme function is a list of arg names and a list of Terms, which are evaled sequentially when the function is called.
The set of states during eval of a schelme function.
BuiltInStep a -> BuiltInStep a
A builtin function is defined in Elm. It should process any of the BuiltInStep states, hopefully resulting in a BuiltInFinal at the end. BuiltInFinal doesn't include the state ('a'), so any changes mades to state are always thrown away.
The set of states used in defining a BuiltIn function.
SideEffectorStep a -> SideEffectorStep a
A sideeffector function processes SideEffectorSteps, and should eventually return either a SideEffectorFinal or SideEffectorError. Unlike the BuiltIn, the SideEffector returns a modified state ('a') in its Final step.
The steps involved in a SideEffector function. Not all these steps have to be used. Check out the prelude for some examples.
sxpToTerm : Schelme.SExpression.Sxp -> Result (List Parser.DeadEnd) (Term a)
parse an s-expression, yielding a single term.
sxpsToTerms : List Schelme.SExpression.Sxp -> Result (List Parser.DeadEnd) (List (Term a))
parse a series of s-expressions, yielding a list of terms.