Closed skylee03 closed 3 weeks ago
The result of List::debug_write
should be [1,2,3,...,N]
The result of
List::debug_write
should be[1,2,3,...,N]
I'll try to update it, then I can update #688 accordingly.
I noticed that for other data structures, such as Queue
, we used the result of to_string
as the result of debug_write
. Should we do the same for List
to ensure consistency?
fn main {
let q = @queue.of([1, 2, 3])
println(q) // Queue::[1, 2, 3]
debug(q) // Queue::[1, 2, 3]
}
Should the debug_write
also show the type?
The result of List::debug_write should be [1,2,3,...,N]
or List::[1,2,3,...,N]
@Yoorkin
Should the
debug_write
also show the type?
There will be some changes to the built-in Debug
and Show
traits, so we could fix these behaviors later.
The Debug
trait has been removed and the output of println
looks fine. Therefore, this issue can be considered fixed.
The current dubug output cannot accurately display the nested structure of lists.
For example:
It is better to change the output of
debug_write
to a format similar to the one ofto_string
.Related PRs:
716
719