## quickstring.api
## AUTHOR: John Reppy
## AT&T Bell Laboratories
## Murray Hill, NJ 07974
## jhr@research.att.com
# Compiled by:
#
src/lib/std/standard.lib# Implemented by:
#
src/lib/src/quickstring--premicrothread.pkg### "In the once-upon-a-time days of the First Age of Magic,
### the prudent sorcerer regarded his own true name as his
### most valued possession but also the greatest threat to
### his continued good health, for -- the stories go -- once
### an enemy, even a weak unskilled enemy, learned the
### sorcerer's true name, then routine and widely known spells
### could destroy or enslave even the most powerful."
###
### -- Vernor Vinge, "True Names"
### "Moving in space, the atoms originally
### were individual units, but inevitably
### they began to collide with each other,
### and in cases where their shapes were
### such as to permit them to interlock,
### they began to form clusters.
### Water, air, fire, and earth,
### these are simply different clusters
### of the changeless atoms."
###
### -- Democritus 439 BC
#
# TODO: add a gensym operation?
api Quickstring {
Quickstring; # Quickstrings are hashed strings that support fast equality testing.
from_string: String -> Quickstring;
from_substring: Substring -> Quickstring;
#
# Map a string/substring to the corresponding unique quickstring.
to_string: Quickstring -> String;
#
# Return the string representation of the quickstring
same: (Quickstring, Quickstring) -> Bool;
#
# Return TRUE if the quickstrings are the same.
compare: (Quickstring, Quickstring) -> Order;
#
# Compare two quickstrings for their relative order.
# Note that this is not lexical order!
lex_compare: (Quickstring, Quickstring) -> Order;
#
# Compare two quickstrings for their lexical order.
hash: Quickstring -> Unt;
#
# Return a hash key for the quickstring.
};
## COPYRIGHT (c) 1996 by AT&T Research
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.