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

SCM Repository

[smlnj] View of /sml/branches/primop-branch-gkuan/cm/tools/main/lsplit-arg.sml
ViewVC logotype

View of /sml/branches/primop-branch-gkuan/cm/tools/main/lsplit-arg.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2787 - (download) (annotate)
Sat Sep 29 05:18:54 2007 UTC (13 years, 7 months ago) by gkuan
File size: 865 byte(s)
Creating private branch of sml/branches/primop-branch-3 for experimental Translate rewrite
(* lsplit-arg.sml
 *   Convert string representation of a lambda-plitting specification
 *   into something matching Control.LambdaSplitting.localsetting.
 *   (That type is simply int option option, so we do all this without
 *   actually referring to that structure in order to avoid additional
 *   static dependencies.)
 *
 * (C) 2002 Lucent Technologies, Bell Laboratories
 *
 * Author: Matthias Blume (blume@research.bell-lab.com)
 *)
structure LSplitArg : sig
    val arg : string -> int option option option
end = struct
    val UseDefault = NONE
    val Suggest = SOME
    fun arg "default" = SOME UseDefault
      | arg "infinity" = SOME (Suggest (SOME 100000000))
      | arg "on" = SOME (Suggest (SOME 0))
      | arg "off" = SOME (Suggest NONE)
      | arg n =
	(case Int.fromString n of
	     SOME i => SOME (Suggest (SOME i))
	   | NONE => NONE)
end

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