#[repr(usize)]pub enum ContType {
Show 45 variants
Done = 0,
ApplyForced = 1,
IfBranch = 2,
BuiltinForceArg = 3,
BinaryBuiltinFirst = 4,
BinaryBuiltinSecond = 5,
LambdaFirstBind = 6,
LambdaBindArg = 7,
LambdaRestCollect = 8,
EvalExpr = 9,
BeginSeq = 10,
ApplyFirst = 11,
ApplySecond = 12,
ValuesCollect = 13,
DefineValue = 14,
SetValue = 15,
NativeArgsCollect = 16,
QuasiquoteCar = 17,
QuasiquoteCdr = 18,
QuasiquoteUnquoteWrap = 19,
QuasiquoteNestedWrap = 20,
QuasiquoteSplice = 21,
QuasiquoteSpliceAppend = 22,
LetSyntaxBody = 23,
CallWithValuesProducer = 24,
CallWithValuesConsumer = 25,
CallWithValuesApply = 26,
SyntaxCaseMatch = 27,
SyntaxCaseFender = 28,
CallCcApply = 29,
ContinuationApply = 30,
DynamicWindBefore = 31,
DynamicWindBody = 32,
DynamicWindAfter = 33,
DynamicWindAfterCall = 34,
WindIn = 35,
WindOut = 36,
DynamicWindEvalAfter = 37,
DynamicWindCallBody = 38,
FinishContinuationRestore = 39,
MacroResult = 40,
WithExceptionHandlerEvalThunk = 41,
WithExceptionHandlerCallThunk = 42,
ExceptionHandlerFrame = 43,
RaiseEval = 44,
}Expand description
Continuation types for the arena-based trampoline.
Each variant corresponds to a specific point in the evaluation where
a continuation is captured. The #[repr(usize)] ensures stable
discriminants for arena serialization.
Variants§
Done = 0
We’re done - return the value (no data)
ApplyForced = 1
After evaluating function, decide builtin vs lambda Data: (args_expr . (env . call_expr))
IfBranch = 2
After evaluating condition, choose branch Data: (then_expr . (else_expr . env))
BuiltinForceArg = 3
After evaluating argument for builtin (variadic ops like +) Data: (builtin_encoded . (remaining_args . (collected . (call_expr . eval_env))))
BinaryBuiltinFirst = 4
After evaluating first arg of binary builtin, evaluate second arg Data: (builtin_encoded . (second_arg . (call_expr . eval_env)))
BinaryBuiltinSecond = 5
After evaluating both args of binary builtin, apply Data: (builtin_encoded . (first_val . call_expr))
LambdaFirstBind = 6
After evaluating first lambda arg, bind it to param Data: param (single value)
LambdaBindArg = 7
After binding a lambda arg, continue with remaining args Data: (remaining_exprs . (eval_env . (remaining_params . (body . (new_env . call_expr)))))
LambdaRestCollect = 8
Collecting rest arguments for rest-parameter lambda Data: (remaining_exprs . (eval_env . (rest_param . (body . (new_env . (collected . call_expr))))))
EvalExpr = 9
After evaluating expr in eval special form Data: env (single value)
BeginSeq = 10
Processing begin expressions (non-tail) Data: (remaining . env)
ApplyFirst = 11
After evaluating first arg for apply, evaluate second arg (args list) Data: (args_list_expr . env)
ApplySecond = 12
After evaluating both args for apply, perform the application Data: (func . env)
ValuesCollect = 13
Evaluate expressions for values, collecting results Data: (remaining . (collected . env))
DefineValue = 14
After evaluating value for define Data: name (single value)
SetValue = 15
After evaluating value for set! Data: (name . env)
NativeArgsCollect = 16
Evaluate arguments for native function call Data: (remaining . (collected . (id_encoded . env)))
QuasiquoteCar = 17
After evaluating car in quasiquote, evaluate cdr Data: (cdr . (depth_encoded . env))
QuasiquoteCdr = 18
After evaluating cdr in quasiquote, cons with car Data: car_val (single value)
QuasiquoteUnquoteWrap = 19
After evaluating unquote in quasiquote at depth > 1, wrap with unquote symbol Data: Nil (no data)
QuasiquoteNestedWrap = 20
After evaluating inner in nested quasiquote, wrap with quasiquote symbol Data: Nil (no data)
QuasiquoteSplice = 21
After evaluating unquote-splicing, append with rest Data: (cdr . (depth_encoded . env))
QuasiquoteSpliceAppend = 22
After evaluating cdr for splice, append with splice value Data: splice_val (single value)
LetSyntaxBody = 23
After evaluating let-syntax body, restore macro environment Data: saved_macro_env (single value)
CallWithValuesProducer = 24
After evaluating producer for call-with-values, evaluate consumer Data: (consumer_expr . env)
CallWithValuesConsumer = 25
After calling producer, evaluate consumer Data: (consumer_expr . env)
CallWithValuesApply = 26
After evaluating consumer, apply it to producer result Data: (producer_result . env)
SyntaxCaseMatch = 27
After evaluating stx-expr in syntax-case, try pattern matching Data: (literals . (clauses . (env . pattern_bindings)))
SyntaxCaseFender = 28
After evaluating fender in syntax-case, decide to use this clause or continue Data: (output . (bindings . (literals . (remaining_clauses . (env . stx)))))
CallCcApply = 29
After evaluating the procedure argument of call/cc, apply it to the captured continuation Data: captured_continuation (single value)
ContinuationApply = 30
After evaluating the argument to a captured continuation, restore and return Data: captured_continuation (single value)
DynamicWindBefore = 31
After evaluating before thunk in dynamic-wind, call it (no args) Data: (body . (after . (env . saved_dw_chain)))
DynamicWindBody = 32
After calling before thunk, evaluate and call body thunk Data: (after . (env . saved_dw_chain))
DynamicWindAfter = 33
After calling body thunk, evaluate and call after thunk Data: (body_result . saved_dw_chain)
DynamicWindAfterCall = 34
After evaluating after thunk, call it (no args) and return body result Data: (body_result . saved_dw_chain)
WindIn = 35
Executing wind-in thunks (before thunks) during continuation restoration Data: (remaining_frames . (return_val . (target_chain . original_target_chain)))
WindOut = 36
Executing wind-out thunks (after thunks) during continuation restoration Data: (remaining_frames . (return_val . (target_chain . original_target_chain)))
DynamicWindEvalAfter = 37
After evaluating after_expr in dynamic-wind, evaluate and call body Data: (before_thunk . (body_expr . (env . saved_dw_chain)))
DynamicWindCallBody = 38
After evaluating body_expr in dynamic-wind, call body thunk Data: (after_thunk . (env . saved_dw_chain))
FinishContinuationRestore = 39
After winding out/in completes, finish restoring continuation Data: (captured_continuation . return_val)
MacroResult = 40
After evaluating macro transformer body, re-expand the result Data: env (single value - the environment to continue evaluation in)
This continuation enables iterative macro expansion without Rust stack recursion. When a macro invocation is encountered, we push this continuation and evaluate the transformer body. When the body returns, this continuation re-evaluates the expanded result (which may itself be a macro invocation).
WithExceptionHandlerEvalThunk = 41
After evaluating handler-expr in with-exception-handler, evaluate thunk-expr Data: (thunk_expr . env)
WithExceptionHandlerCallThunk = 42
After evaluating thunk-expr in with-exception-handler, call thunk with handler installed Data: (handler . env)
ExceptionHandlerFrame = 43
Installed exception handler frame — marks the dynamic extent Data: (handler . saved_handler_chain)
RaiseEval = 44
After evaluating raise argument, invoke exception handler Data: Nil (no data — continuable flag encoded as env marker)