[squeak-dev] Cannot store into-> (Is this related to changes in Spur)?

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Wed Nov 10 13:37:05 UTC 2021


There is a preference for this: Scanner allowBlockArgumentAssignment which false by default. However, I would rarely consider this good style; usually, it's a better idea to declare a separate temp var to keep arguments immutable. But if I did not misread your example, you do not need the assignments anyway - the into: block of #inject:into: just needs to answer the next accumulated value, and you already do this even if you do not reassign the block argument variable.


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von gettimothy via Squeak-dev <squeak-dev at lists.squeakfoundation.org>
Gesendet: Dienstag, 9. November 2021 15:44:11
An: squeak-dev
Betreff: [squeak-dev] Cannot store into-> (Is this related to changes in Spur)?

Hi Folks,

I am migrating a package from Cog to Spur and I am getting errors that I suspect are related to it.


Here is an example:


|result|
  result := pairs inject: first
                        into: [ :base  :pair |
                              (pair first = 'round')
                                    ifTrue: [
                                                (pair last >= 0)
                                                      ifTrue:[
                                                            (base >=0)
                                                                  ifTrue:["Cannot store into ->"base := base roundUpTo: ((1/10) raisedTo:(pair last truncated)) asFloat]
                                                                  ifFalse:[base := base roundDownTo: ((1/10) raisedTo:(pair last truncated)) asFloat]]
                                                      ifFalse:[
                                                            (base >=0)
                                                                  ifTrue:[
                                                                              base := base roundDownTo: ((1/10) raisedTo:(pair last truncated)) asFloat]
                                                                                         ifFalse:[base := base roundUpTo: ((1/10) raisedTo:(pair last truncated)) asFloat]]]].

                                                                        transcripton ifTrue:[Transcript show:'PHPRoundSimple ' , (result asFloat); cr. ].

^ result

Is this related to changes in Spur?

thx

t

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211110/df279f8c/attachment.html>


More information about the Squeak-dev mailing list