1 (* Copyright (C
) 1999-2006 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
3 * Copyright (C
) 1997-2000 NEC Research Institute
.
5 * MLton is released under a BSD
-style license
.
6 * See the file MLton
-LICENSE for details
.
9 (* Primitive names are special
-- see atoms
/prim
.fun. *)
11 structure Primitive
= struct
15 (* NullString is used for strings that must be passed to C
and hence must be
18 structure NullString8
:>
23 val fromString
: String8
.string -> t
26 type t
= String8
.string
29 if #
"\000" = Vector.subUnsafe (s
, SeqIndex
.- (Vector.length s
, 1))
31 else raise Exn
.Fail8
"NullString.fromString"
33 val empty
= fromString
"\000"
35 structure NullString8Array
= struct type t
= NullString8
.t array
end