Sujet : Re: REPL in Lisp
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.lispDate : 14. Jul 2024, 02:03:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240713165224.889@kylheku.com>
References : 1 2 3 4 5 6 7
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-13, Julieta Shem <
jshem@yaxenu.org> wrote:
Dependency injection is all about the injection: someone provides your
dependencies for you, and what concrete implementations of those is
something that can and will vary.
>
It's very clear now. Thank you so much.
Therfore, a funtion that is used with different callbacks all the time,
like mapcar in Lisp or qsort in C, is not dependency injection.
Invocations of these functions forget about the callback when they are done.
An API that offers multiple handle instances to the clients, and
the handles can bind callbacks for notification, also doesn't look
like dependency inversion.
There is a a sense that the indirection is used to set up a single
instance of some needed resources which could be, in principle,
set up without indirection.
In the firmware application that I work on, I was asked to resolve a
circular reference between two separate components that were calling
each other's functions. The solution was to register indirect functions
for one calling direction. The registered functions are set once
at startup and do not vary.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca