package ecaml

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

Source file obarray.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
open! Core_kernel
open! Import

module Q = struct
  include Q

  let mapatoms = "mapatoms" |> Symbol.intern
  and obarray = "obarray" |> Symbol.intern
end

include Value.Make_subtype (struct
    let name = "obarray"
    let here = [%here]
    let is_in_subtype = Value.is_vector
  end)

let standard = Current_buffer.value_exn { symbol = Q.obarray; type_ }

let iter t ~f =
  let f =
    Function.create [%here] ~args:[ Q.symbol ] (function
      | [| symbol |] ->
        f (symbol |> Symbol.of_value_exn);
        Value.nil
      | _ -> assert false)
  in
  Symbol.funcall2_i Q.mapatoms (f |> Function.to_value) (t |> to_value)
;;