+1

Inlining breaks the fundamental piece of OOP: Message sends.

I'm sure there are use cases where inlining adds a significant
speedup, but for some messages, I prefer them to be sent.

Regards!

Esteban A. Maringolo

On Tue, Mar 15, 2022 at 3:16 PM <s...@clipperadams.com> wrote:
>
> I had some chaining that was getting too complex due to many nil checks, so I 
> started to refactor using a Null Object.
>
> However, I’m struggling a bit with the refactor due to inlining. Since 
> #ifNil: variants might be inlined, it seems that something like:
>
> anObject with a long chain of messages ifNotNil: [ :result | “…” ]
>
> must be changed into something like:
>
> anObject with a long chain of messages isNil ifFalse: [ anObject with a long 
> chain of messages “…” ].
>
> Obviously, I can use a temp to have:
>
> result := anObject with a long chain of messages.
>
> result isNil ifFalse: [ result “…” ].
>
> But both seem ugly and make me question using this pattern.
>
> What am I missing?
>
> After 40+ years of Moore’s Law, can we turn off these inlines by default?

Reply via email to