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.

Есть небольшие замечания, после которых задачи можно зачесть

Comment on lines 47 to 48
if list = [] then
raise(ArgumentException(""))

Choose a reason for hiding this comment

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

учитывая проверки двумя строками ниже, этот кусок кода избыточен (:

Comment on lines 51 to 56
if list = [] then
raise(ArgumentException("Нет такого элемента в списке"))
if List.head list = number then
i
else
findElement (List.tail list) number (i + 1)

Choose a reason for hiding this comment

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

тут лучше использопать паттерн-матчинг для списков

Comment on lines 28 to 29
if List.length list = 0 then
[]

Choose a reason for hiding this comment

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

Во-первых, для определения длины выполняется полный проход по списку.
Во-вторых, этот код избыточен, ибо такая же проверка выполняется двумя строками ниже.


let fibonacci n =
if n < 0 then
raise (ArgumentException"n должно быть неотрицательным")

Choose a reason for hiding this comment

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

Кто украл пробел?

Suggested change
raise (ArgumentException"n должно быть неотрицательным")
raise (ArgumentException "n должно быть неотрицательным")

if list = [] then
listNew
else
reverseListMaker (List.tail list) ((List.head list) :: listNew)

Choose a reason for hiding this comment

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

тут лучше использопать паттерн-матчинг для списков

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.

👍

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