package tiny_languages

  1. Overview
  2. Docs
Small languages from scratch: Scheme, Lisp, Smalltalk-80, Pascal, BASIC, JavaScript, HTML, CSS and more

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.3.6.tar.gz
md5=7c636383d146d30ac6f2fa234a6253c8
sha512=c79f3823c5f8f57e5038eb640d487c61168b84aa07c61999d6622ef9fd0c890e2b03b4c6a7cdbbe9352a49e25dda00ac7bb14693cee8e3d7beeed251351a2af0

doc/tiny_languages.scheme/Scheme/index.html

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