import { metaesEval , uncps } from "./metaes" ; import { createScript } from "./script" ; import { Continuation , Environment , ErrorContinuation , Evaluate , EvaluationConfig } from "./types" ; param _receiver param _value export function callcc < T , U > ( _receiver , _value ? ) { throw new Error ( "Not intended to be called directly, call from Metaes context." ) ; } let script ; export function lifted < R , T > ( fn , closure ? ) { if ( ! script ) { script = createScript ( ( ... args ) => callcc ( fn , args ) ) ; } return uncps ( metaesEval ) ( script , { values : { callcc , fn } , prev : closure } ) ; } export function liftedAll ( fns , closure ? ) { const result = { } ; for ( let k in fns ) { result [ k ] = lifted ( fns [ k ] , closure ) ; } return result ; }