I desperately want to create great and useful programs for myself and others. I am focused on F# and eventually Azure. I want to focus on the “mechanics” of the program first. In doing so, I want to create a super simple “UI”, a basic “do this” and show me the result. Then let me “do that” and show me the result. A console app seems best to me.
Does the following seem to be a good start? Suggestions?
open System let printPrompt () = printf "command:>" let getCommandLineInput _ = printPrompt () System.Console.ReadLine () let writeError value = printfn "ERROR - No Match\nYou typed: %s" value let writeMatch value = printfn "Matched: %s" value let processCommandLineInput commandLineInput = match commandLineInput with | "a" -> writeMatch "a" | "b" -> writeMatch "b" | "exit" -> Environment.Exit 55 | "quit" -> Environment.Exit 55 | _ -> writeError commandLineInput //change to output a 'command'? let progLoop () = let commandLineInput = Seq.initInfinite getCommandLineInput Seq.iter processCommandLineInput commandLineInput [<EntryPoint>] let main argv = progLoop () 0