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

View of /sml/branches/SMLNJ/src/smlnj-lib/Util/plist-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 475 - (download) (annotate)
Wed Nov 10 22:59:58 1999 UTC (19 years, 8 months ago) by monnier
File size: 1060 byte(s)
version 110.24
(* plist-sig.sml
 *
 * COPYRIGHT (c) 1999 Bell Labs, Lucent Technologies.
 *
 * Property lists using Stephen Weeks's implementation.
 *)

signature PROP_LIST = 
  sig 
    type holder 

    val newHolder : unit -> holder 

    val clearHolder : holder -> unit

  (* newProp (selHolder, init)
   * creates a new property for objects of type 'a and returns
   * functions to get the property and clear it.  The function
   * selHolder is used to select the holder field from an object
   * and init is used to create the initial property value.
   * Typically, properties are reference cells, so that they can
   * be modified.  The difference between peekFn and getFn is that
   * peekFn returns NONE when the property has not yet been created,
   * whereas getFn will allocate and initialize the property.
   *)
    val newProp : (('a -> holder) * ('a -> 'b)) -> {
	    peekFn : 'a -> 'b option,
	    getFn  : 'a -> 'b,
	    clrFn  : 'a -> unit
	  }

    val newFlag : ('a -> holder) -> {
	    getFn : 'a -> bool,
	    setFn : ('a * bool) -> unit
	  }

  end


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