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/rt-transition/system/Basis/Implementation/IO/bin-io.sml
ViewVC logotype

Diff of /sml/branches/rt-transition/system/Basis/Implementation/IO/bin-io.sml

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

revision 2848, Thu Nov 8 21:59:14 2007 UTC revision 2849, Thu Nov 8 23:17:09 2007 UTC
# Line 1  Line 1 
1  (* bin-io-fn.sml  (* bin-io.sml
2   *   *
3   * COPYRIGHT (c) 1995 AT&T Bell Laboratories.   * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
4     * COPYRIGHT (c) 2007 Fellowship of SML/NJ
5   *   *
6   * QUESTION: what operations should raise exceptions when the stream is   * QUESTION: what operations should raise exceptions when the stream is
7   * closed?   * closed?
# Line 11  Line 12 
12      structure Int = IntImp      structure Int = IntImp
13      structure Position = PositionImp      structure Position = PositionImp
14  in  in
15  functor BinIOFn (  structure BinIO : BIN_IO = struct
16    
17      structure OSPrimIO : OS_PRIM_IO      structure PIO = BinPrimIO
       where PrimIO = BinPrimIO  
   
   ) : BIN_IO = struct  
   
     structure PIO = OSPrimIO.PrimIO  
18      structure A = Word8Array      structure A = Word8Array
19      structure AS = Word8ArraySlice      structure AS = Word8ArraySlice
20      structure V = Word8Vector      structure V = Word8Vector
# Line 613  Line 609 
609    
610    (** Open files **)    (** Open files **)
611      fun openIn fname =      fun openIn fname =
612            mkInstream(StreamIO.mkInstream(OSPrimIO.openRd fname, empty))            mkInstream(StreamIO.mkInstream(PIO.openRd fname, empty))
613              handle ex => raise IO.Io{function="openIn", name=fname, cause=ex}              handle ex => raise IO.Io{function="openIn", name=fname, cause=ex}
614      fun openOut fname =      fun openOut fname =
615            mkOutstream(StreamIO.mkOutstream(OSPrimIO.openWr fname, IO.BLOCK_BUF))            mkOutstream(StreamIO.mkOutstream(PIO.openWr fname, IO.BLOCK_BUF))
616              handle ex => raise IO.Io{function="openOut", name=fname, cause=ex}              handle ex => raise IO.Io{function="openOut", name=fname, cause=ex}
617      fun openAppend fname =      fun openAppend fname =
618            mkOutstream(StreamIO.mkOutstream(OSPrimIO.openApp fname, IO.NO_BUF))            mkOutstream(StreamIO.mkOutstream(PIO.openApp fname, IO.NO_BUF))
619              handle ex => raise IO.Io{function="openAppend", name=fname, cause=ex}              handle ex => raise IO.Io{function="openAppend", name=fname, cause=ex}
620    
621    end (* BinIOFn *)    end (* BinIOFn *)

Legend:
Removed from v.2848  
changed lines
  Added in v.2849

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