package mazeppa

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t

A mutable symbol generator (traditionally called "gensym").

val create : prefix:string -> unit -> t

Creates a gensym with a given prefix and counter set to 0.

val emit : t -> Symbol.t

Generates a new symbol and then increments the counter.

The symbol will have the form prefix ^ i, where prefix is the prefix passed to create and i is the current counter value.

val latest : t -> Symbol.t

Returns the most recently generated symbol; panics if the counter is 0.

val emit_list : length_list:'a list -> t -> Symbol.t list

Sequentially generates a symbol list with as many elements as in length_list.

val clone : t -> t

Clones the state of this gensym.

val assign : other:t -> t -> unit

Assigns the state of other to this gensym.

val reset : t -> unit

Resets the inner counter to 0.

OCaml

Innovation. Community. Security.