CVS: sml/src/smlnj-lib/PP/devices ansi-term-dev.sml,1.2,1.3

John Reppy <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml/src/smlnj-lib/PP/devices
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5100

Modified Files:
	ansi-term-dev.sml 
Log Message:
  Changed interface to setting mode.


Index: ansi-term-dev.sml
===================================================================
RCS file: /cvsroot/smlnj/sml/src/smlnj-lib/PP/devices/ansi-term-dev.sml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ansi-term-dev.sml	12 Jul 2005 22:08:28 -0000	1.2
--- ansi-term-dev.sml	19 Jul 2005 15:57:51 -0000	1.3
***************
*** 18,26 ****
      val openDev : {dst : TextIO.outstream, wid : int} -> device
  
!   (* enable styled output by passing true to this function.  It returns
!    * the previous state of the device.
     * NOTE: this function raises Fail if called while a style is active.
     *)
!     val enableStyles : (device * bool) -> bool
  
    end = struct
--- 18,31 ----
      val openDev : {dst : TextIO.outstream, wid : int} -> device
  
!   (* enable/disable/query styled output.
!    *
!    *	styleMode (dev, NONE)	-- query current mode
!    *	styleMode (dev, SOME true)	-- enable styled output
!    *	styleMode (dev, SOME false)	-- disable styled output
!    *
!    * This function returns the previous state of the device.
     * NOTE: this function raises Fail if called while a style is active.
     *)
!     val styleMode : (device * bool option) -> bool
  
    end = struct
***************
*** 190,196 ****
     * the previous state of the device.
     *)
!     fun enableStyles (DEV{stk = ref(_::_), ...}, _) =
  	  raise Fail "attempt to change mode inside scope of style"
!       | enableStyles (DEV{mode as ref m, ...}, flg) = (mode := flg; m)
  
    end
--- 195,202 ----
     * the previous state of the device.
     *)
!     fun styleMode (DEV{stk = ref(_::_), ...}, _) =
  	  raise Fail "attempt to change mode inside scope of style"
!       | styleMode (DEV{mode, ...}, NONE) = !mode
!       | styleMode (DEV{mode as ref m, ...}, SOME flg) = (mode := flg; m)
  
    end



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.