From fbaa75a41cc484da0b0c4c3be4872985e58c1cef Mon Sep 17 00:00:00 2001 From: Takashi Suwa Date: Thu, 12 Sep 2024 14:59:12 +0900 Subject: [PATCH] add `CrossRef` --- .../stdlib/stdlib.0.0.1/src/cross-ref.satyg | 19 +++++++++++++++++++ .../stdlib/stdlib.0.0.1/src/stdlib.satyh | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 lib-satysfi/packages/stdlib/stdlib.0.0.1/src/cross-ref.satyg diff --git a/lib-satysfi/packages/stdlib/stdlib.0.0.1/src/cross-ref.satyg b/lib-satysfi/packages/stdlib/stdlib.0.0.1/src/cross-ref.satyg new file mode 100644 index 000000000..44104925e --- /dev/null +++ b/lib-satysfi/packages/stdlib/stdlib.0.0.1/src/cross-ref.satyg @@ -0,0 +1,19 @@ +module CrossRef :> sig + type key = string + type data = string + val register : key -> data -> unit + val get : key -> option data + val probe : key -> option data +end = struct + + type key = string + + type data = string + + val register = register-cross-reference %PRIMITIVE + + val get = get-cross-reference %PRIMITIVE + + val probe = probe-cross-reference %PRIMITIVE + +end diff --git a/lib-satysfi/packages/stdlib/stdlib.0.0.1/src/stdlib.satyh b/lib-satysfi/packages/stdlib/stdlib.0.0.1/src/stdlib.satyh index 67692b5ae..407be9ef4 100644 --- a/lib-satysfi/packages/stdlib/stdlib.0.0.1/src/stdlib.satyh +++ b/lib-satysfi/packages/stdlib/stdlib.0.0.1/src/stdlib.satyh @@ -22,6 +22,7 @@ use PaperSize use Deco use HDecoSet use VDecoSet +use CrossRef module Stdlib :> sig % Basic @@ -310,6 +311,13 @@ module Stdlib :> sig val paper : deco-set val quote-round : length -> length -> color -> deco-set end + module CrossRef : sig + type key = string + type data = string + val register : key -> data -> unit + val get : key -> option data + val probe : key -> option data + end end = struct include Basic module Int = Int @@ -335,4 +343,5 @@ end = struct module Deco = Deco module HDecoSet = HDecoSet module VDecoSet = VDecoSet + module CrossRef = CrossRef end