Module SchemeSource

Sourcetype t =
  1. | Int of int
  2. | Real of float
  3. | Bool of bool
  4. | Char of int
  5. | Str of string
  6. | Sym of string
  7. | Nil
  8. | Pair of t * t
  9. | Vector of t array
  10. | Struct of string * t list
  11. | Image of Scheme_image.t
  12. | Proc of proc
  13. | Void
Sourceand proc =
  1. | Prim of string
  2. | Closure of lambda * env
  3. | Cont of kont
  4. | Make of string * int
  5. | Get of string * int * string
  6. | Is of string
Sourceand loc = int
Sourceand env = (string * loc) list
Sourceand expr = {
  1. desc : desc;
  2. span : Sexpr.span;
}
Sourceand desc =
  1. | Quote of t
  2. | Var of string
  3. | Lambda of lambda
  4. | If of expr * expr * expr
  5. | Set of string * expr
  6. | App of expr * expr list
  7. | Seq of expr list
  8. | Define of string * expr
  9. | Define_struct of string * string list
  10. | Big_bang of expr * (string * expr) list
Sourceand lambda = {
  1. params : string list;
  2. rest : string option;
  3. locals : string list;
  4. body : expr list;
  5. name : string;
}
Sourceand kont =
  1. | Halt
  2. | K_if of expr * expr * env * kont
  3. | K_app of t list * expr list * env * Sexpr.span * kont
  4. | K_set of loc * kont
  5. | K_seq of expr list * env * kont
  6. | K_define of string * kont
  7. | K_big_bang of t list * (string * expr) list * string list * env * Sexpr.span * kont
Sourcetype style =
  1. | Write
  2. | Constructor
Sourceval print : style -> t -> string
Sourceval display : t -> string
Sourceval list : t list -> t
Sourceval to_list : t -> t list option
Sourceval truthy : t -> bool
Sourceval equal : t -> t -> bool
Sourceval kind : t -> string