Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/ckit/src/ast/uidtabimp-fn.sml
ViewVC logotype

View of /sml/trunk/ckit/src/ast/uidtabimp-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (download) (annotate)
Wed Apr 5 18:34:51 2000 UTC (19 years, 2 months ago) by dbm
File size: 742 byte(s)
Initial revision
(* Copyright (c) 1998 by Lucent Technologies *)

(* imperative uid tables based on hash table library *)
(* polymorphic table operations *)

functor UidtabImpFn (structure Uid:UID) :> UIDTABIMP where type uid = Uid.uid
=
struct

  structure M = HashTableFn
      (struct (* must match HASH_KEY *)
	 type hash_key = Uid.uid
	 val hashVal = Uid.toWord
	 val sameKey = Uid.equal
       end)

  exception NotFound

  type uid = Uid.uid
  type 'a uidtab = 'a M.hash_table

  fun insert (uidtab,uid,v) : unit = M.insert uidtab (uid,v)

  fun find (uidtab,uid) = M.find uidtab uid

  fun listItems uidtab = M.listItems uidtab

  fun listItemsi uidtab = M.listItemsi uidtab

  fun uidtab () = M.mkTable(50, NotFound)

end (* functor UidtabImperFn *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0