Interesting ... so I started guessing and searching a bit, guided by the idea that the guy is more experienced with JavaScript than with Smalltalk. What I found: In JavaScript there is an (incredibly beautiful) unary plus operator performing a Number cast on the object following. Being not shure that the value returned from the configuration call would be an Integer, he or she tried to cast it using the same unary operator, which did not work out of the box in Pharo ;) but could be fixed with a 0 as receiver. So I guess / think the intention behind was totally different compared to what it looks like for us. It's not very important here, but in general, guessing the effective intention behind some weird code you have to fix - that's the really hard part, but might save you a lot of time!

Am 22.03.2018 um 17:00 schrieb [email protected]:
Message: 3
Date: Wed, 21 Mar 2018 21:47:59 +0100
From: Stephane Ducasse<[email protected]>
To: Pharo Development List<[email protected]>
Subject: [Pharo-dev] Coding pearl of the day
Message-ID:
        <CAJ4kQBVMG-ytmLunCcBKRJqkSw5TzCyXGYXMa=mif1kcxvy...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hi

when cleaning a system sometimes you find some coding pearls.
And I want to share one I found.

currentSlide := 0 + self configuration slideInTemplateForDeckJS.

Stef (we got a good laugh with guille).

Reply via email to