Skip to content

Conversation

@MikePuzanov
Copy link
Owner

No description provided.

Copy link

@DedSec256 DedSec256 left a 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>]

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 "(({}))"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

здесь не хватает [ ]

Comment on lines 3 to 4
let rec check (listOfExp : char List) (listOfStaples : char list) =
let charFunc x = if x = listOfStaples.Head then (check listOfExp.Tail listOfStaples.Tail) else false

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 '['

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listOfExp нигде не используется -- и это подозрительно. Кажется, можно упростить код так, чтобы charFunc не требовалась вовсе

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants