[MLton-commit] r5271
Vesa Karvonen
vesak at mlton.org
Tue Feb 20 01:12:13 PST 2007
Working on concept signatures.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/cstringable.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig
----------------------------------------------------------------------
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/cstringable.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/cstringable.sig 2007-02-20 07:37:20 UTC (rev 5270)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/cstringable.sig 2007-02-20 09:11:59 UTC (rev 5271)
@@ -0,0 +1,36 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+(**
+ * C stringables can be embedded into strings. The string representation
+ * is usually human readable and corresponds to C syntax and conventions.
+ *
+ * See also: {STRINGABLE}
+ *)
+signature CSTRINGABLE = sig
+ type cstringable
+
+ val embCString : (cstringable, String.t) Emb.t
+ (**
+ * An embedding of cstringables into strings. It is always equivalent
+ * to {(toCString, fromCString)}.
+ *)
+
+ val fromCString : String.t -> cstringable Option.t
+ (**
+ * Returns {SOME v} if a cstringable {v} can be parsed from a prefix of
+ * the given string, ignoring initial whitespace; {NONE} is returned
+ * otherwise. May raise an exception if a cstringable can be parsed
+ * from the prefix, but the value is not representable as a cstringable
+ * (e.g. causes {Overflow}).
+ *)
+
+ val toCString : cstringable -> String.t
+ (**
+ * Returns a string containing a representation of the given
+ * cstringable.
+ *)
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/cstringable.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig 2007-02-20 07:37:20 UTC (rev 5270)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig 2007-02-20 09:11:59 UTC (rev 5271)
@@ -6,7 +6,9 @@
(**
* Stringables can be embedded into strings. The string representation is
- * usually human readable.
+ * usually human readable and corresponds to SML syntax and conventions.
+ *
+ * See also: {CSTRINGABLE}
*)
signature STRINGABLE = sig
type stringable
More information about the MLton-commit
mailing list