<div dir="ltr"><div dir="ltr">David Lloyd <<a href="mailto:david.lloyd@redhat.com">david.lloyd@redhat.com</a>> ezt írta (időpont: 2023. jún. 1., Cs, 19:02):<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">What would happen if there was some context which is implemented in some way *other* than ScopedValue? For example, using thread locals, or a field on Thread, or something like that?</div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><br></div></div></blockquote><div><br></div><div>I understand your implication that I'm being a little bit hypocritical by concerning myself with SV, but not with others. And of course that is unfortunate, and I can't do anything about it. But the reason I care more about the SV scope than others is because I see scope to be more important, because this looks to me as a promising emerging concept. That is, we could have a future, where SVs are promoted properly everywhere (for example, StructuredTaskScope propagates it to the child tasks), What I mean by "promoted properly" is that at some point (there are various missing tools for that still) we could have what I would call a "properly scoped" application, where opening a new scope in `main`, whatever I set there will be visible to all application code, and if started so (there could be an implicit virtual scope for `main` as well), then the whole application would sit in a scope tree (even with concurrency considered) which would allow me to reason correctness about my code better. In such a world, a DI framework like I mentioned could be useful (and I believe a lot of other future APIs could benefit from proper scoping).</div></div></div>