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 /smlnj-lib/trunk/Util/fifo.sml
ViewVC logotype

Diff of /smlnj-lib/trunk/Util/fifo.sml

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

revision 2448, Tue Apr 24 15:10:06 2007 UTC revision 2449, Tue Apr 24 15:10:24 2007 UTC
# Line 23  Line 23 
23        | dequeue (Q{rear=[],...}) = raise Dequeue        | dequeue (Q{rear=[],...}) = raise Dequeue
24        | dequeue (Q{rear,...}) = dequeue(Q{front=rev rear,rear=[]})        | dequeue (Q{rear,...}) = dequeue(Q{front=rev rear,rear=[]})
25    
26        fun next (Q{front=(hd::tl),rear}) = SOME(hd, Q{front=tl,rear=rear})
27          | next (Q{rear=[],...}) = NONE
28          | next (Q{rear,...}) = next(Q{front=rev rear,rear=[]})
29    
30      fun delete (Q{front, rear}, pred) = let      fun delete (Q{front, rear}, pred) = let
31            fun doFront [] = {front = doRear(rev rear), rear = []}            fun doFront [] = {front = doRear(rev rear), rear = []}
32              | doFront (x::r) = if (pred x)              | doFront (x::r) = if (pred x)

Legend:
Removed from v.2448  
changed lines
  Added in v.2449

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