# HG changeset patch # User wenzelm # Date 897472444 -7200 # Node ID 67c5966611c680e39bbd895d4e96f8b96a06d77a # Parent 44fd9e09c6377542c287f48ac2e4d64bf19ef1ba moved object.ML to General/object.ML; diff -r 44fd9e09c637 -r 67c5966611c6 src/Pure/General/object.ML --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Pure/General/object.ML Wed Jun 10 11:54:04 1998 +0200 @@ -0,0 +1,42 @@ +(* Title: Pure/object.ML + ID: $Id$ + Author: Markus Wenzel, TU Muenchen + +Generic objects of arbitrary type -- fool the ML type system via +exception constructors. +*) + +signature OBJECT = +sig + type T + type kind + val kind: string -> kind + val name_of_kind: kind -> string + val eq_kind: kind * kind -> bool + val kind_error: kind -> 'a +end; + +structure Object: OBJECT = +struct + + +(* anytype values *) + +type T = exn; + + +(* kinds *) + +datatype kind = Kind of string * stamp; + +fun kind name = Kind (name, stamp ()); + +fun name_of_kind (Kind (name, _)) = name; + +fun eq_kind (Kind (_, s1), Kind (_, s2)) = s1 = s2; + +fun kind_error k = + error ("## RUNTIME TYPE ERROR ##\nFailed to access " ^ quote (name_of_kind k) ^ " object"); + + +end; diff -r 44fd9e09c637 -r 67c5966611c6 src/Pure/object.ML --- a/src/Pure/object.ML Wed Jun 10 11:53:37 1998 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -(* Title: Pure/object.ML - ID: $Id$ - Author: Markus Wenzel, TU Muenchen - -Generic objects of arbitrary type -- fool the ML type system via -exception constructors. -*) - -signature OBJECT = -sig - type T - type kind - val kind: string -> kind - val name_of_kind: kind -> string - val eq_kind: kind * kind -> bool - val kind_error: kind -> 'a -end; - -structure Object: OBJECT = -struct - - -(* anytype values *) - -type T = exn; - - -(* kinds *) - -datatype kind = Kind of string * stamp; - -fun kind name = Kind (name, stamp ()); - -fun name_of_kind (Kind (name, _)) = name; - -fun eq_kind (Kind (_, s1), Kind (_, s2)) = s1 = s2; - -fun kind_error k = - error ("## RUNTIME TYPE ERROR ##\nFailed to access " ^ quote (name_of_kind k) ^ " object"); - - -end;