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/src/smlnj-lib/Util/atom-sig.sml
ViewVC logotype

View of /sml/trunk/src/smlnj-lib/Util/atom-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1756 - (download) (annotate)
Fri Feb 11 15:48:29 2005 UTC (14 years, 7 months ago) by jhr
File size: 1029 byte(s)
  Added Atom.same and Atom.lexCompare functions.
(* atom-sig.sml
 *
 * COPYRIGHT (c) 1996 by AT&T Research
 *
 * AUTHOR:	John Reppy
 *		AT&T Bell Laboratories
 *		Murray Hill, NJ 07974
 *		jhr@research.att.com
 *
 * TODO: add a gensym operation?
 *)

signature ATOM =
  sig

    type atom
	(* Atoms are hashed strings that support fast equality testing. *)

    val atom : string -> atom
    val atom' : substring -> atom
	(* Map a string/substring to the corresponding unique atom. *)

    val toString : atom -> string
	(* return the string representation of the atom *)

    val same : (atom * atom) -> bool
    val sameAtom : (atom * atom) -> bool
	(* return true if the atoms are the same; we provide "sameAtom" for
	 * backward compatibility.
	 *)

    val compare : (atom * atom) -> order
	(* compare two atoms for their relative order; note that this is
	 * not lexical order!
	 *)
    val lexCompare : (atom * atom) -> order
	(* compare two atoms for their lexical order *)

    val hash : atom -> word
	(* return a hash key for the atom *)

  end (* signature ATOM *)

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