Deutsch English Français Italiano |
<20240713165224.889@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.lisp Subject: Re: REPL in Lisp Date: Sun, 14 Jul 2024 00:03:08 -0000 (UTC) Organization: A noiseless patient Spider Lines: 29 Message-ID: <20240713165224.889@kylheku.com> References: <v6nf07$296j5$1@dont-email.me> <v6nfrr$29ajf$2@dont-email.me> <v6okr8$2fhdg$1@dont-email.me> <v6pjio$2kqvg$2@dont-email.me> <875xta5n73.fsf@yaxenu.org> <v6sbof$37ogs$1@dont-email.me> <87sewd1e68.fsf@yaxenu.org> Injection-Date: Sun, 14 Jul 2024 02:03:08 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b878b995a15b13ece19fc6e93d1b7128"; logging-data="3998697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RKsMdMsd0wFXjk9TWRO44miyFAqu10lE=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:s1pQxoXutmAtMkc75shv1Jpg/Hs= Bytes: 2329 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/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca