Hello All

 

Following the discussion on dark mode, I was browsing the code on themes (in Moose 6.1 = Pharo 6.0, Latest update: #60486). In Class ThemeIcons, I found this method:

 

downloadTo: dir

               | zipArchive |

              

               zipArchive := self class destinationPath / (self name, '.zip').

               zipArchive exists

                              ifFalse: [

                                             ZnClient new

                                                            url: self url;

                                                            downloadTo: zipArchive ].

 

               ^ zipArchive

 

The mystery is that the argument dir is not referred to anywhere in the code. It probably works, because the only invocation of the method is from ThemeIcons>>downloadFromUrl, which sets the argument from self class destinationPath, and the code above recreates this as the path to zipArchive.

 

I thought I understood Smalltalk coding fairly well, but this really puzzles me. Why would anyone code like this? Shouldn’t it be picked up by a code critic? Or am I going crazy?

 

Any help gratefully received

 

Peter Kenny