Created
March 16, 2017 11:59
-
-
Save HerbM/5abe48e9b55a39086c1923984fcce810 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Text.RegularExpressions | |
exception QuitProgram | |
(* // defining this function causes the initial "> " to not be displayed first | |
let ProcessInput = | |
let input = System.Console.ReadLine() | |
try | |
let f = System.Single.Parse(input) | |
sprintf "%f" f | |
with _ -> input | |
*) | |
[<EntryPoint>] | |
let main argv = // printfn "%A" argv | |
try | |
while true do | |
System.Console.Write("> ") | |
let input = System.Console.ReadLine() | |
if Regex.Match(input, "^\s*q(uit)?|(exit)\s*$").Success then raise QuitProgram | |
System.Console.WriteLine(input) | |
0 | |
with _ -> 0 // return an integer exit code | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment