-
Notifications
You must be signed in to change notification settings - Fork 0
SequenceOfStaples #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
DedSec256
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Есть небольшие замечания
| open FsUnit | ||
| open Program | ||
|
|
||
| [<Test>] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не хватает теста на пустую строку
|
|
||
| [<Test>] | ||
| let TestExpTrue () = | ||
| let result = checkStaples "(({}))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
здесь не хватает [ ]
| let rec check (listOfExp : char List) (listOfStaples : char list) = | ||
| let charFunc x = if x = listOfStaples.Head then (check listOfExp.Tail listOfStaples.Tail) else false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не очень информативно подобраны имена для параметров check и самой charFunc
| let charFunc x = if x = listOfStaples.Head then (check listOfExp.Tail listOfStaples.Tail) else false | ||
| match listOfExp with | ||
| | h :: tail when h = '[' || h = '(' || h = '{' -> (check tail (h :: listOfStaples)) | ||
| | h :: listOfExp when h = ']' && listOfStaples.Length > 0 -> charFunc '[' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listOfExp нигде не используется -- и это подозрительно. Кажется, можно упростить код так, чтобы charFunc не требовалась вовсе
No description provided.