Skip to content

Conversation

@vsotnikov
Copy link

No description provided.

@@ -1,4 +1,15 @@
(ns otus-02.homework.palindrome)
(ns otus-02.homework.palindrome
(:require [clojure.string :as cs]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

это не ошибка, а скорее совет на будущее - одно или дву буквенные алиасы не рекомендуется использовать так как в будущем будет тяжело понять что это значит
в данном случае можно использовать string в качестве алиаса

(ns otus-02.homework.palindrome
(:require [clojure.string :as cs]))

(defn- bad-char? [c]
Copy link
Collaborator

Choose a reason for hiding this comment

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

в принципе тот же совет что и выше про алиасы, лучше называть переменные и аргументы какими то осмысленными словами. через месяц или два становится очень трудно понять что значит буква c

(when-not (bad-char? c)
c))
(defn- rm-bad-chars [s]
(apply str (map bad-char-to-nil s)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

хорошее решение через map
еще мы на втором уроке говорили про clojure.string/replace эта функция здесь хорошо бы подошла

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.

2 participants