2010/1/18 Mariano Martinez Peck <[email protected]>: > > > On Mon, Jan 18, 2010 at 5:50 PM, Igor Stasenko <[email protected]> wrote: >> >> I think the LastImageName is confusing. >> It should be CurrentImageName or LastKnownImageName. >> >> In either way, this is not an image name, which were before you >> setting a new using >> #changeImageNameTo:, this is an image name, which you set. >> >> The thing is, that if you save an image, the value of this var will be >> held within an image, >> so if you rename the image and run squeak with it, >> the #imageName will return you a file name, >> while LastImageName is the name what was assigned last. >> >> This is how it works, if i'm not mistaken. However i don't see where >> LastImageName could be useful. >> > > Are you sure ? If LastImageName is what you say, it has few things I see: > > - It has no sense and it is redudant, as I can always do "SmalltalkImage > current imageName " which uses a primitive, not that global variable > - the name is wrong from my point of view. If it is LastImageName I imagine > it is the previous one. I would rather call it CurrentImageName > > I even don't understand why it is a global. It cannot be a simple variable? > because I checked in code and it is only used in three methods, all from > SmalltalkImage. > > And, for example, for me is useful in this case. Look SmalltalkImage >> > saveImageInFileNamed: > > You see where it does a saveImageSegments ? Ok, inside that method, I need > both images name: the current and the future want. At that moment, I already > loose the original. Thus, I need to move it before changeImageNameTo: is > call. I can do that (I guess), but suppose I cannot. What would I do ? > > If I understood you correctly, I would do: > > a) Remove completely the global, as I can always do SmalltalkImage current > imageName > b) change everyplace (3 places) where it was used, and replace it by > SmalltalkImage current imageName and then, change the semantic of > LastImageName so that it is really the previous one. We can even call it > PreviousImageName. And those who wants, can use it (right now, only that > part of ImageSegment). >
You seem still confused. The LastImageName is not a 'previous image name' , it is the file name of image, when it was last saved to disk. so, if you save an image as 'myImage.image' it will set the LastImageName to that value. But next, suppose you renamed an image file, outside of squeak to , say 'myPharoimage.image' and now, if you run this image you will get: self imageName ==> 'myPharoimage.image' LastImageName ==> 'myImage.image' > What do you think ? > > >> >> 2010/1/18 Mariano Martinez Peck <[email protected]>: >> > Look at SmalltalkImage >> changeImageNameTo: >> > >> > >> > changeImageNameTo: t1 >> > self imageName: t1 asSqueakPathName. >> > LastImageName := self imageName >> > >> > >> > Here, it is putting to LastImageName the new one. Shouldn't be in the >> > other >> > order, like this: >> > >> > changeImageNameTo: t1 >> > LastImageName := self imageName >> > self imageName: t1 asSqueakPathName. >> > >> > Maybe I misunderstood what LastImageName is >> > >> > Thoughts? >> > >> > Mariano >> > >> > >> > _______________________________________________ >> > Pharo-project mailing list >> > [email protected] >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > >> >> >> >> -- >> Best regards, >> Igor Stasenko AKA sig. >> >> _______________________________________________ >> Pharo-project mailing list >> [email protected] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
