On Sun, 16 Mar 2025 00:34:45 GMT, John R Rose <jr...@openjdk.org> wrote:

> Comments on visual noise and side effects in `toString`.
> 
> `renderWrapped` is clever for a single stable value, but it makes for a very 
> noisy display string, with confusing doubly-nested `[]`, for composite stable 
> values. I'm talking about `StableFunction` mainly, I guess.
> 
> I suggest omitting the inner `[]` for such composites. A simple boolean on 
> `renderWrapped` will do that trick. In that case, `renderWrapped` has the job 
> of either presenting a fixed (recognizable) sentinel string, or else 
> forwards, without further editorial comment, to the `toString` of the 
> contained value.

The `toString()` for `StableValue` is inspired by `Optional` which works in the 
same way by adding `[ ]` around the contents. Any more thought in the reviewer 
community on how we should handle this?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23972#issuecomment-2743849237

Reply via email to