Talk:Tree from nesting levels: Difference between revisions

Content added Content deleted
Line 111: Line 111:
::::: But as you say – where the inconsistency of the type becomes a problem, a note in the preamble and a variant representation will be enough [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 20:21, 4 February 2021 (UTC)
::::: But as you say – where the inconsistency of the type becomes a problem, a note in the preamble and a variant representation will be enough [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 20:21, 4 February 2021 (UTC)
:::: Considering the first level as a forest with the current wording seems fine. You do have a good point about the [] case being inconsistent though. Following the pattern <pre>[3] => [[[3]]], [2] => [[2]], [1] => [1], [] => ???</pre> then it seems like [] should map to 'nothing' instead of []. Also for the sum type in the python above, why is it between Int and None? Isn't the choice between Int and Tree? [[User:Garbanzo|Garbanzo]] ([[User talk:Garbanzo|talk]]) 03:40, 7 February 2021 (UTC)
:::: Considering the first level as a forest with the current wording seems fine. You do have a good point about the [] case being inconsistent though. Following the pattern <pre>[3] => [[[3]]], [2] => [[2]], [1] => [1], [] => ???</pre> then it seems like [] should map to 'nothing' instead of []. Also for the sum type in the python above, why is it between Int and None? Isn't the choice between Int and Tree? [[User:Garbanzo|Garbanzo]] ([[User talk:Garbanzo|talk]]) 03:40, 7 February 2021 (UTC)

==Source==
I formed the task from working on [https://stackoverflow.com/questions/65992295/how-to-organize-elements-in-array-by-their-level/65993607#65993607 this problem] someone else had on Stack Overflow. I hope it helps those who asked for more info. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 06:02, 7 February 2021 (UTC)