Skip to content

Comments

update-key key naming#57

Closed
darkleaf wants to merge 2 commits intomasterfrom
update-key-naming
Closed

update-key key naming#57
darkleaf wants to merge 2 commits intomasterfrom
update-key-naming

Conversation

@darkleaf
Copy link
Owner

No description provided.

Comment on lines +220 to 222
:dependencies {`a+di-update-key#0-target :optional
`a+di-update-key#1-f :optional
`a+di-update-key#1-arg#0 :optional}
Copy link
Owner Author

Choose a reason for hiding this comment

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

должны зависеть от таргета с предыдущего шага, а он как раз на 1 меньше

Comment on lines +571 to +573
(defn- update-key-key [target idx suffix]
(symbol (str (symbol target) "+di-update-key#" idx "-" suffix)))

Copy link
Owner Author

@darkleaf darkleaf Apr 30, 2025

Choose a reason for hiding this comment

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

что если тут использовать вектор вместо склеивания символа:
[::update-key target idx suffix ...] ?

Comment on lines +234 to +237

;; тут вот расхождение с `:target`
;; нужно подумать над консистентностью
#_#_
Copy link
Owner Author

Choose a reason for hiding this comment

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

может сделать альяс, и сделать мапы плоскими?

(defn- update-key-key [target idx suffix]
(symbol (str (symbol target) "+di-update-key#" idx "-" suffix)))

(defn update-key
Copy link
Owner Author

@darkleaf darkleaf Apr 30, 2025

Choose a reason for hiding this comment

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

или вообще все упростить

f должен возвращать обернутый объект, который останавливается stop исходного.
Например, если исходный объект был AutoClosable, и stop вызывал close, то новый объект должен тоже реализовывать AutoClosable и просировать вызов в исходный close
И это как раз определение декоратоа, что интерфейс должен сохраняться

2ъ f, args - это фабрики, которые можно не останавливать, что у нас всегда так, это ref и template или plain object. Тогда можно их зависимости просто примешать в зависимости таргета.
Можем это по description проверять, и если не так, то падать

Copy link
Owner Author

Choose a reason for hiding this comment

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

ну или прокидывать

(build [_ deps add-to-stop-list]
  ....)

Copy link
Owner Author

Choose a reason for hiding this comment

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

#58

@darkleaf darkleaf mentioned this pull request Apr 30, 2025
@darkleaf darkleaf closed this in #58 May 1, 2025
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.

1 participant