Closed MassD closed 10 years ago
At a first glance, I'd rename and rewrite your is_letter_dig
function:
let is_alphanumeric = function 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' -> true | _ -> false
For readability, I'd move the n <> 0
test outside the recursive function.
Other than that, it looks pretty good. Thanks for your contributions !
Post-scriptum: make sure 9a
is detected as invalid because it starts with a digit.
Thanks for the suggestions.
Hi Victor
If you have time, could you please have a look at problem 96, the syntax checker?
Syntax checker. (medium)
More example is here: http://www.haskell.org/haskellwiki/99_questions/95_to_99
I have solved this problem here:
https://github.com/MassD/99-Problems-OCaml/blob/master/91-99/p96.ml
do you think my solution is correct? I feel it is too simple. If you believe it is correct, I can produce a pull request.