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/trunk/src/system/Basis/Implementation/byte.sml
ViewVC logotype

Diff of /sml/trunk/src/system/Basis/Implementation/byte.sml

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

revision 1380, Wed Sep 17 20:20:51 2003 UTC revision 1381, Wed Sep 17 21:28:41 2003 UTC
# Line 4  Line 4 
4   *   *
5   *)   *)
6    
7  structure Byte : BYTE =  structure Byte : BYTE = struct
   struct  
 (*  
     val chr     : Word8.word -> char = InlineT.cast  
     val ord     : char -> Word8.word = InlineT.cast  
 *)  
8    
9      val byteToChar : Word8.word -> char = InlineT.cast      val byteToChar : Word8.word -> char = InlineT.cast
10      val charToByte : char -> Word8.word = InlineT.cast      val charToByte : char -> Word8.word = InlineT.cast
# Line 17  Line 12 
12      val bytesToString : Word8Vector.vector -> string = InlineT.cast      val bytesToString : Word8Vector.vector -> string = InlineT.cast
13      val stringToBytes : string -> Word8Vector.vector = InlineT.cast      val stringToBytes : string -> Word8Vector.vector = InlineT.cast
14    
15  (*      val unpackStringVec = bytesToString o Word8VectorSlice.vector
16      val vectorToString : (Word8Vector.vector * int * int) -> string      val unpackString = bytesToString o Word8ArraySlice.vector
           = InlineT.cast CharVector.extract  
     val arrayToString : (Word8Array.array * int * int) -> string  
           = InlineT.cast CharArray.extract  
 *)  
   
     fun unpackStringVec (v, start, olen) =  
         StringImp.extract (bytesToString v, start, olen)  
     fun unpackString (a, start, olen) =  
         bytesToString  
             (Word8ArraySlice.vector (Word8ArraySlice.slice (a, start, olen)))  
   
17    
18      local      local
19      (* the substring type is abstract, so we use a cast to an equivalent type      (* the substring type is abstract, so we use a cast to an equivalent type

Legend:
Removed from v.1380  
changed lines
  Added in v.1381

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