fork download
  1. let rec formatEqual format argument =
  2. let sFormat = format.ToString()
  3. let sArgument = argument.ToString()
  4. let firstChar = sArgument.Chars(0)
  5. let firstPatternChar = sFormat.Chars(0)
  6. match format with
  7. | "" -> string.Equals("")
  8. | s -> match format.Chars(0) with
  9. // | "?"
  10. // | "*"
  11. | c -> firstPatternChar.Equals(firstChar) && formatEqual format.[1..] string.[1..]
  12.  
  13. let format = System.Console.ReadLine()
  14. let name = System.Console.ReadLine()
  15. let res = formatEqual format name
  16.  
  17. printfn "%b" res
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/iXbkWn/prog.fs(11,9): warning FS0058: Possible incorrect indentation: this token is offside of context started at position (8:12). Try indenting this token further or using standard formatting conventions.

/home/iXbkWn/prog.fs(7,13): error FS0043: The type '( ^a -> string)' does not support the 'equality' constraint because it is a function type

/home/iXbkWn/prog.fs(11,79): error FS0039: The field, constructor or member 'GetSlice' is not defined
stdout
Standard output is empty