<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi --<div><br></div><div>I fully agree with what Tobias wrote. :-)</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
                        <p style='color: #AAAAAA; margin-top: 10px;'>Am 30.12.2021 13:41:04 schrieb Tobias Pape <das.linux@gmx.de>:</p><div style='font-family:Arial,Helvetica,sans-serif'>Hi<br><br>> On 30. Dec 2021, at 13:22, christoph.thiede@student.hpi.uni-potsdam.de wrote:<br>> <br>> Hi all,<br>> <br>> this fails:<br>> <br>>     {Object >> #halt} flatten.<br><br>I'd argue that this is ok.<br>A compiled method is a collection of stuff, mostly bytecode, and also quite special.<br><br>If you want to unravel some nested collections with compiled methods inside,<br>just use #gather: instead.<br><br><br>> <br>>     CompiledMethod(Object)>>error:<br>>         Receiver: (Object>>#halt "a CompiledMethod(343681)")<br>>         Arguments and temporary variables: <br>>             aString:     'subscript is out of bounds: 1'<br>>         Receiver's instance variables: <br>>     (Object>>#halt "a CompiledMethod(343681)")<br>> <br>>     CompiledMethod(Object)>>errorSubscriptBounds:<br>>         Receiver: (Object>>#halt "a CompiledMethod(343681)")<br>>         Arguments and temporary variables: <br>>             index:     1<br>>         Receiver's instance variables: <br>>     (Object>>#halt "a CompiledMethod(343681)")<br>> <br>>     CompiledMethod(Object)>>at:<br>>         Receiver: (Object>>#halt "a CompiledMethod(343681)")<br>>         Arguments and temporary variables: <br>>             index:     1<br>>         Receiver's instance variables: <br>>     (Object>>#halt "a CompiledMethod(343681)")<br>> <br>>     CompiledMethod(SequenceableCollection)>>do:<br>>         Receiver: (Object>>#halt "a CompiledMethod(343681)")<br>>         Arguments and temporary variables: <br>>             aBlock:     [closure] in [] in CompiledMethod(SequenceableCollection)>>flatten<br>>             index:     1<br>>             indexLimiT:     48<br>>         Receiver's instance variables: <br>>     (Object>>#halt "a CompiledMethod(343681)")<br>> <br>>     [] in CompiledMethod(SequenceableCollection)>>flatten<br>>         Receiver: (Object>>#halt "a CompiledMethod(343681)")<br>>         Arguments and temporary variables: <br>>             stream:     a WriteStream<br>>         Receiver's instance variables: <br>>     (Object>>#halt "a CompiledMethod(343681)")<br>> <br>> You get the problem, we don't want to split up compiled codes. How should we fix it? <br><br>Not. It's an annoyance, yes, but not a problem per se, I'd say.<br><br>> Replace each isString with something like each canBeFlattened? Or just override #flatten on String and CompiledCode instead?<br>> <br><br>no.<br><br>> By the way, I am also not sure whether this is what we expect:<br>> <br>>     {'foo'. 'bar' asText. UUID new} flatten. "#('foo' $b $a $r 188 125 70 227 253 103 13 67 180 100 32 52 18 134 92 153)"<br>> <br><br>It really depends on what you expect. The text-vs-string thing is unfortunate and needs being looked into, yes. but For UUID, some might want it flattened, some not.<br>I presume you see a uuid as something atomic, scalar, while others do not.<br><br>> Maybe also override #flatten on Text and UUID? Any other collections that we do not want to flatten? It is hard to make this decision without knowledge about the domain-specific context ... :-)<br>> <br><br>This makes me think copying over #flatten from other languages was an error.<br>If in doubt, use #gather: which is much more mature.<br><br>Best regards<br> -Tobias<br><br>> Best,<br>> Christoph<br>> <br>> ---<br>> Sent from Squeak Inbox Talk<br><br><br><br></div></blockquote>
                                        </div></body>