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

SCM Repository

[smlnj] Diff of /sml/branches/blume-private-devel/src/smlnj-lib/Controls/control-reps.sml
ViewVC logotype

Diff of /sml/branches/blume-private-devel/src/smlnj-lib/Controls/control-reps.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1634, Tue Sep 28 15:53:10 2004 UTC revision 1635, Tue Sep 28 17:12:31 2004 UTC
# Line 11  Line 11 
11    
12      datatype 'a control = Ctl of {      datatype 'a control = Ctl of {
13          name : Atom.atom,               (* name of the control *)          name : Atom.atom,               (* name of the control *)
14          set : 'a -> unit,               (* function to set the control's value *)          set : 'a option -> unit -> unit,(* function to set the control's value;
15                                             * it is delayed (error checking in 1st
16                                             * stage, actual assignment in 2nd);
17                                             * if the argument is NONE, then
18                                             * the 2nd stage will restore the
19                                             * value that was present during the
20                                             * first stage *)
21          get : unit -> 'a,               (* return the control's value *)          get : unit -> 'a,               (* return the control's value *)
22          priority : priority,            (* control's priority *)          priority : priority,            (* control's priority *)
23          obscurity : int,                (* control's detail level; higher means *)          obscurity : int,                (* control's detail level; higher means *)
# Line 29  Line 35 
35          toString : 'a -> string          toString : 'a -> string
36        }        }
37    
38    (* ">" ordering on priorities *)      fun priorityGT priorities =
39      fun priorityGT ([], _) = false          List.collate Int.compare priorities = GREATER
       | priorityGT (_, []) = true  
       | priorityGT (x::xs, y::ys) =  
           Int.>(x, y) orelse ((x = y) andalso priorityGT(xs, ys))  
   
40    end    end

Legend:
Removed from v.1634  
changed lines
  Added in v.1635

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