SE-0311 (3rd review): Task-local values

+1 on the overall proposal. I've been using task-locals for distributed tracing since the first proposal where they prove to be invaluable for implicit context propagation and enjoy the new syntax introduced in the second revision.

I agree that requiring the with-API for this use-case makes sense as it makes the scope of a task-local value very clear.

In Distributed Tracing, we hit a similar "issue" with indentation, where we also offer a withSpan API to ensure proper error handling and automatic ending of a span. At least for this use case, I think something like function wrappers could make it a bit easier and remove the extra level of indentation.

2 Likes