<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Levente --<div><br></div><div>Thanks. Decompiler only adds the block-arg for not-inlined caseOfs. See ObjectTest >> #testCaseOfOtherwise.</div><div><br></div><div>Hmm... Christoph? =) Otherwise (ha!) I will take a look at it soon-ish.</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;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 18.11.2021 13:51:02 schrieb Levente Uzonyi <leves@caesar.elte.hu>:</p><div style="font-family:Arial,Helvetica,sans-serif">Hi Marcel,
<br>
<br>I just checked how this works, and noticed that the decompiler cannot 
<br>recreate the original code if the otherwise: block has an argument.
<br>
<br>
<br>Levente
<br>
<br>On Thu, 18 Nov 2021, Marcel Taeumel wrote:
<br>
<br>> Merged.
<br>>
<br>>       Am 21.02.2020 17:33:03 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:
<br>>
<br>>       This changeset makes it possible to accept an argument in the otherwise block of a #caseOf:otherwise: call.
<br>> 
<br>>
<br>>       Diff of the #caseOf:otherwise: implementation:
<br>>
<br>>             caseOf: aBlockAssociationCollection otherwise: aBlock
<br>> 
<br>> "The elements of aBlockAssociationCollection are associations between blocks.  Answer the evaluated value of the first association in aBlockAssociationCollection whose evaluated key equals the receiver.  If no
<br>> match is found, answer the result of evaluating aBlock."
<br>> 
<br>> 
<br>> aBlockAssociationCollection associationsDo:
<br>> 
<br>> [:assoc | (assoc key value = self) ifTrue: [^assoc value value]].
<br>> 
<br>> - ^ aBlock value
<br>> 
<br>> + ^ aBlock cull: self
<br>> 
<br>> 
<br>> "| z | z := {[#a]->[1+1]. ['b' asSymbol]->[2+2]. [#c]->[3+3]}. #b caseOf: z otherwise: [0]"
<br>> 
<br>> "| z | z := {[#a]->[1+1]. ['d' asSymbol]->[2+2]. [#c]->[3+3]}. #b caseOf: z otherwise: [0]"
<br>> 
<br>> "The following are compiled in-line:"
<br>> 
<br>> "#b caseOf: {[#a]->[1+1]. ['b' asSymbol]->[2+2]. [#c]->[3+3]} otherwise: [0]"
<br>> 
<br>> "#b caseOf: {[#a]->[1+1]. ['d' asSymbol]->[2+2]. [#c]->[3+3]} otherwise: [0]"
<br>> 
<br>> + "#b caseOf: {[#a]->[1+1]. ['d' asSymbol]->[2+2]. [#c]->[3+3]} otherwise: [:x | x halt]"
<br>> 
<br>> 
<br>> Furthermore, the changeset includes a necessary modification of MessageNode >> #transformCase: so that the otherwise argument can be compiled in-line.
<br>> 
<br>> Last but not least, I wrote some tests for #caseOf:[otherwise:].
<br>> 
<br>> 
<br>> Please review!
<br>> 
<br>> (In a later change, it would be possible to allow arguments for the association key blocks as well. But I love short feedback loops, so let's assess this one first :-))
<br>> 
<br>> 
<br>> Best,
<br>> 
<br>> Christoph
<br>> 
<br>> 
<br>><br></christoph.thiede@student.hpi.uni-potsdam.de></div></blockquote></div>